4 set gpio configuration – IBASE IBD185 User Manual

Page 11

Advertising
background image

IBD185 User Guide

11

1.3.4 Set GPIO Configuration

Set up the GPIO pin configuration of the MCU

Request

Header Size

Command

Data

CRC

0xFF 0xEE

0x00

SET_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

SET_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

Host can set 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.

Advertising