Revision: 1.23
70
getInChLevel( GPO0 | GPO3, 0 );
Return Value: If the function sets the values successfully, it returns 0. If any error, it
returns –1.
3. Syntax:
i32 getOutchLevel( i32 channel, u8 *val )
Description: Get the value of GPIO Output and put the value at *val.
Parameters:
I. The parameter ‘channel’ indicates the GPIO Output pins to show. Users can use the
macros GPO0, GPO1, GPO2, GPO3 to indicate the GPIO Output channel. For example:
getOutChLevel( GPO2, &val); // Indicate the GPIO Output channel 2
/* Indicate the GPIO Output channel 0 and channel 3. */
getOutChLevel( GPO0 | GPO3, &val);
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 Output channel 0. The bit 1 of *val shows the value of GPIO Output
channel 1. Other bits show the corresponding GPIO Output channels. Because there are
only four channels, bit 4 ~ bit 7 of *val are always zero.
Here is an example:
If GPIO Output channel 0 and channel 2 are both 1.
unsigned char ch;
getOutChLevel( GPO0|GPO2, &ch );
The returned value of variable ‘ch’ is 0x5.
Return Value: If the function gets the values successfully, it returns 0. If any error, it
returns –1.
Under windows platform:
1. Syntax:
int getGPIOBitValue(int iBitNumber, bool * bValue)