Changeset 3257
- Timestamp:
- Aug 31, 2012 1:28:30 AM (9 months ago)
- Location:
- cpu/arm/olpc
- Files:
-
- 2 edited
-
nn-touchscreen.fth (modified) (10 diffs)
-
twsi-i2c.fth (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/nn-touchscreen.fth
r3250 r3257 2 2 purpose: Driver and diagnostic for Neonode zForce MultiSensing I2C Touchscreen 3 3 4 0 0 " 4,50" " /twsi" begin-package 5 my-space encode-int my-address encode-int encode+ " reg" property 4 dev /i2c@d4033000 5 new-device 6 7 h# 50 1 reg 8 9 " zforce" +compatible 10 touch-rst-gpio# 1 " reset-gpios" gpio-property 11 touch-tck-gpio# 1 " test-gpios" gpio-property 12 touch-hd-gpio# 1 " hd-gpios" gpio-property 13 touch-int-gpio# 1 " dr-gpios" gpio-property 14 15 : read-bytes ( adr len -- ) " read-bytes" $call-parent ; 16 : bytes-out ( byte .. #bytes -- ) " bytes-out" $call-parent ; 6 17 7 18 create nn-os \ open short test … … 51 62 no-data? if false exit then 52 63 53 pbuf 2 twsi-read( )64 pbuf 2 read-bytes ( ) 54 65 pbuf 1+ c@ ( len ) 55 66 dup 2+ to plen ( len ) 56 67 57 pbuf 2+ swap twsi-read( )68 pbuf 2+ swap read-bytes ( ) 58 69 59 70 pbuf 2+ c@ h# 07 = pbuf 3 + c@ 0= and if ( ) … … 81 92 : read-boot-complete ( -- ) h# 07 d# 0 anticipate ; 82 93 83 : initialise ( -- ) h# 01 h# 01 h# ee 3 twsi-out h# 01 d# 20 anticipate ;94 : initialise ( -- ) h# 01 h# 01 h# ee 3 bytes-out h# 01 d# 20 anticipate ; 84 95 85 96 : set-resolution ( -- ) 86 97 set-geometry 87 screen-h wbsplit swap screen-w wbsplit swap h# 02 h# 05 h# ee 7 twsi-out98 screen-h wbsplit swap screen-w wbsplit swap h# 02 h# 05 h# ee 7 bytes-out 88 99 h# 02 d# 20 anticipate 89 100 ; 90 101 91 : start ( -- ) h# 04 h# 01 h# ee 3 twsi-out ;102 : start ( -- ) h# 04 h# 01 h# ee 3 bytes-out ; 92 103 93 104 : deactivate ( -- ) 94 h# 00 h# 01 h# ee 3 twsi-out h# 00 d# 20 anticipate105 h# 00 h# 01 h# ee 3 bytes-out h# 00 d# 20 anticipate 95 106 true to configure? 96 107 ; … … 107 118 : open ( -- okay? ) 108 119 pbuf-alloc 109 my-unit set-twsi-target120 my-unit " set-address" $call-parent 110 121 set-gpios 111 122 no-data? if … … 175 186 176 187 : test-version ( -- ) 177 h# 1e h# 01 h# ee 3 twsi-out188 h# 1e h# 01 h# ee 3 bytes-out 178 189 h# 1e d# 30 anticipate 179 190 … … 335 346 336 347 : test-os-axis ( axis -- ) 337 h# 21 h# 02 h# ee 4 twsi-out348 h# 21 h# 02 h# ee 4 bytes-out 338 349 h# 21 d# 30 anticipate 339 350 pbuf 2+ c@ h# 21 <> abort" bad response" … … 395 406 396 407 : test-fss-axis ( axis -- ) 397 d# 64 swap h# 0f h# 03 h# ee 5 twsi-out408 d# 64 swap h# 0f h# 03 h# ee 5 bytes-out 398 409 h# 0f d# 20 anticipate 399 410 pbuf 2+ c@ h# 0f <> abort" bad response" … … 425 436 [ifdef] nn-ls \ low signals test 426 437 : test-ls-axis ( axis -- ) 427 h# 0d h# 02 h# ee 4 twsi-out438 h# 0d h# 02 h# ee 4 bytes-out 428 439 h# 0d d# 200 anticipate 429 440 pbuf 2+ c@ h# 0d <> abort" bad response" … … 482 493 483 494 : test-fll-axis ( axis -- ) 484 h# 20 h# 02 h# ee 4 twsi-out495 h# 20 h# 02 h# ee 4 bytes-out 485 496 h# 1c d# 200 anticipate 486 497 pbuf plen cdump cr … … 591 602 ; 592 603 593 end-package 604 finish-device 605 device-end 594 606 595 607 \ LICENSE_BEGIN -
cpu/arm/olpc/twsi-i2c.fth
r3256 r3257 12 12 13 13 [ifdef] soon-olpc-cl2 \ this breaks cl4-a1 boards, which ofw calls cl2. 14 0 0 " 30" " /i2c@d4033000" begin-package \ TWSI4 14 dev /i2c@d4033000 \ TWSI4 15 new-device 16 h# 30 1 reg 15 17 " touchscreen" name 16 18 " raydium_ts" +compatible 17 my-address my-space 1 reg18 end-package19 [else]20 dev /i2c@d4033000 \ TWSI421 new-device22 h# 50 1 reg23 " touchscreen" name24 " zforce" +compatible25 my-address my-space 1 reg26 touch-rst-gpio# 1 " reset-gpios" gpio-property27 touch-tck-gpio# 1 " test-gpios" gpio-property28 touch-hd-gpio# 1 " hd-gpios" gpio-property29 touch-int-gpio# 1 " dr-gpios" gpio-property30 19 finish-device 31 20 device-end
Note: See TracChangeset
for help on using the changeset viewer.
