Acrosser Technology AR-V6002FL User Manual page 74

Hide thumbs Also See for AR-V6002FL:
Table of Contents

Advertisement

5.3.2 GPIO and Watchdog
GPIO
1. Syntax:
i32 getInChLevel( i32 channel, u8 *val )
Description: Get the value of GPIO Input and put the value at *val.
Parameters:
I.
The parameter 'channel' indicates the GPIO Input pins to show. Users can use the
macros GPI0, GPI1, GPI2, GPI3 to indicate the GPIO Input channel. For example:
getInChLevel( GPI2, &val); // Indicate the GPIO Input channel 2
getInChLevel( GPI0 | GPI3, &val); // Indicate the GPIO Input
II.
The parameter 'val' is an unsigned character pointer. The function puts the values
of the indicated GPIO channels at the memory pointed by 'val'. The bit 0 of *val
shows the value of GPIO Input channel 0. The bit 1 of *val shows the value of
GPIO Input channel 1. Other bits show the corresponding GPIO Input channels.
Because there are only four channels, bit 4 ~ bit 7 of *val are always zero.
Here is an example:
If GPIO Input channel 1 and channel 3 are both 1.
unsigned char ch;
getInChLevel( GPI1|GPI3, &ch );
The returned value of variable 'ch' is 0xa.
Return Value: If the function gets the values successfully, it returns 0. If any error, it
returns –1.
// channel 0 and channel 3
74
Revision: 1.0

Advertisement

Table of Contents
loading

Table of Contents