Acrosser AR-B6050 User Manual

Page 5

Advertising
background image

2

2

2. API List and Descriptions

2.1. GPIO and Watchdog

2.1.1. GPIO

1. Syntax:

Status_t getGpioCapability(uint32_t *pInputs, uint32_t *pOutput )

Description: This function shows the capability of each GPIO port that it is an

output port or an input port.

Parameters:

The returned value which is put at *pInput indicates whether the corresponding

GPIO ports are input ports or not. For example, say, the value at *pInput is

0x00000005, it indicates that the ports GPIO0 and GPIO2 are both input ports.

The returned value which is put at *pOutput indicates whether the corresponding

GPIO ports are output ports or not. For example, say, the value at *pOutput is

0x000000FA, it indicates that the ports GPIO7, GPIO6, GPIO5, GPIO4, GPIO3,

GPIO1 are all output ports. If the *pInput shows that a certain GPIO port is an

input port and the *pOutput shows that this port is an output port, this means this

port can be configured as an input port or an output port by invoking the

‘setGpioDirection( )’. If a certain GPIO port is neither an input port nor an output

port, this model does not enable this GPIO port.

Return Value: If the function gets the value successfully, it returns

STATUS_SUCCESS, any other returned value stands for error.

2. Syntax:

Status_t getGpioDirection( uint32_t Id, uint32_t *pDirection )

Description: Get the current state of GPIO input/output configuration.

Parameters:

The argument ‘Id’ has two formats of parameters. If ‘Id’ is ‘GPIO_ALL’, the

returned value at *pDirection shows the state of every GPIO port. A bit ‘1’ at the

value of *pDirection stands for an input port. A bit ‘0’ at the value of *pDirection

stands for an output port. For example, say, the *pDirection is 0x00000085, this

indicates that the ports GPIO7, GPIO2, GPIO0 are input ports. Other GPIO ports

(if enabled) are output ports. The other format of the argument ‘Id’ is that the ‘Id’

Advertising