Acrosser AR-B6050 User Manual
Page 7
4
4
output port.
Return Value: If the function sets the values successfully, it returns
STATUS_SUCCESS, any other returned value stands for error.
4. Syntax:
Status_t getGpioLevel( uint32_t Id, uint32_t *pLevel )
Description: Get the current state of the GPIO ports.
Parameters:
The argument ‘Id’ has two formats of parameters. If ‘Id’ is ‘GPIO_ALL’, the
returned value at *pLevel shows the state of every GPIO port. A bit ‘1’ at the
value of *pLevel stands for a logical high. A bit ‘0’ at the value of *pLevel stands
for a logical low. For example, say, the *pLevel is 0x00000085, this indicates
that the ports GPIO7, GPIO2, GPIO0 are at the state of logical high. Other GPIO
ports (if enabled) are at the state of logical low. The other format of the argument
‘Id’ is that the ‘Id’ is ‘GPIO_ID0’ ~ ‘GPIO_ID32’. For example, say, ‘Id’ is
GPIO_ID2, the returned value of *pLevel is 0x1(logical high) or 0x0(logical
low).
Return Value: If the function gets the values successfully, it returns
STATUS_SUCCESS, any other returned value stands for error.
5. Syntax:
Status_t setGpioLevel( uint32_t Id, uint32_t Level )
Description: Set the current state of GPIO ports.
Parameters:
The argument ‘Id’ has two formats of parameters. If ‘Id’ is ‘GPIO_ALL’, the
parameter ‘Level’ is bit patterns to be set to the corresponding GPIO ports. A bit
‘1’ at the value of ‘Level’ sets the corresponding GPIO port to logical high. A bit
‘0’ at the value of ‘Level’ sets the corresponding GPIO port to logical low. The
setting to an input port is ignored. The other format of the argument ‘Id’ is that
the ‘Id’ is ‘GPIO_ID0’ ~ ‘GPIO_ID32’. For example, say, ‘Id’ is GPIO_ID2. If
‘Level’ is any value other than 0, it sets the port GPIO2 to logical high. If ‘Level’
is 0, it sets the port GPIO2 to logical low.