Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Reading GPIO inputs

Reading GPIO inputs

Anonymous
Not applicable
Answer:

Question:How to read GPIO inputs?

Response:The SYSIRQ pin provides a way for systems to request service from host software by using the USB Interrupt pipe on endpoint 1 (EP1). If the AT2LP has no pending interrupt data to return,USB interrupt pipe data requests are NAKed. If pending data is available, the AT2LP returns 16 bits of data. This data indicates whether AT2LP is operating in high-speed or full-speed, whether the AT2LP is reporting self-powered or bus-powered operation, and the states of any GPIO pins that are configured as inputs. GPIO pins can be individually set as inputs or outputs, with byte 0x09 of the configuration data. The state of any GPIO pin that is not set as an input is reported as 0 in the EP1 data.The host software has to read from EP1 data byte 1 and mask of bit 7 and 6. The lower bits 5:0 show GPIO data.

The following table gives the Interrupt Data Bitmap for the data returned on the interrupt pipe.             

 
                                                                EP1 Data Byte 1                                          EP1 Data Byte 0

                                
7654321076543210
ReservedReservedReservedReservedReservedReservedUSB High-SpeedVBUS PoweredReservedReservedGPIO[5]GPIO[4]GPIO[3]GPIO[2]GPIO[1]

GPIO[0]

 

 

 

 

Referenced Documents ::

EZ-USB AT2LP USB 2.0 to ATA/ATAPI Bridge

 

0 Likes
238 Views
Contributors