3 get gpio configuration – IBASE IBD185 User Manual
Page 10

10 IBD185 User Guide
1.3.3 Get GPIO Configuration
Read the GPIO pin configuration of the MCU
Request
Header Size
Command
Data
CRC
0xFF
0xEE
0x00
GET_GPIO_CONFIG
GPIO Pin Index
The “GPIO Pin Index” of GPIO pin is count from 0.
Reply
Header Size
Command
Data CRC
0xFF
0xEE
Size of
GpioPinCfg
structure
GET_GPIO_CONFIG GpioPinCfg
structure
Device reply a packet without “Data” field (“Size” is 0, none “Data”)
means fail. If the request performed successfully, device will reply a
packet with specific data structure.
The format is listed below:
GpioPinCfg Structure
Field Type
Description
Pin Index
byte
Pin Index
0x00 – 1st pin index
0x01 – 2nd pin index
……
0xFF – All of the pins
Pin Config
Array of
byte
Pin Configuration
0x00 – as a digital input pin
0x01 – as a digital output pin
The length of “Pin Config” is depends on the
number of “Pin Index”.
If the specific index is 0xFF means all of the
pins.
Host can retrieve configurations of all GPIO pins by sending a request
packet with designating the field “Pin Index” in “GpioPinCfg” as 0xFF.
Device will reply a packet with all GPIO pins configurations in sequential
bytes array. The “Pin Config[]” bytes array are in order of the GPIO pin
index.