« Close

Datasheets and User Guides

App Notes

Software & Driver

 

5.2.5.14 - PortDirWrite: IOType=29

Table 5.2.5.12-1. PortDirWrite Command Response

PortStateWrite, 7 Command Bytes: 
0 IOType = 29
1-3 WriteMask
4-6 Direction
   
0 Response Bytes: 
    

This IOType writes the direction of all digital I/O, where 0-7=FIO, 8-15=EIO, and 16-19=CIO. Note that CIO0-2 and MIO0-2 are shared, so for writes to MIO0-2 use channel numbers 16-18. Note that the desired lines must be configured as digital (not analog).

  • WriteMask: Each bit specifies whether to update the corresponding bit of I/O.
  • Direction: Each bit of this value corresponds to the specified bit of I/O such that 1=Output and 0=Input. To configure all as input, Direction=d0. For all 20 standard digital I/O as output, Direction=d1048575. To configure FIO0-FIO2 as output, EIO0-EIO2 as output, CIO0 as output, and all other I/O as input (b00010000011100000111), Direction=d67335.