Changeset 3141


Ignore:
Timestamp:
Aug 9, 2012, 10:27:52 AM (2 years ago)
Author:
quozl
Message:

ARM - TWSI, add twsi-read for reading bytes from a device into a buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/mmp2/twsi.fth

    r3136 r3141  
    151151   1-  0  ?do  dup c@  0 twsi-putbyte  1+  loop   ( adr' ) 
    152152   c@ bbu_ICR_STOP twsi-putbyte                   ( ) 
     153; 
     154: twsi-read  ( adr len -- ) 
     155   dup 0=  if  2drop exit  then       ( adr len ) 
     156   slave-address 1 or twsi-start      ( adr len ) 
     157 
     158   1-  0  ?do  0 twsi-getbyte  over c!  1+  loop   ( adr' ) 
     159   bbu_ICR_STOP bbu_ICR_ACKNAK or twsi-getbyte swap c!  ( ) 
    153160; 
    154161 
Note: See TracChangeset for help on using the changeset viewer.