MgslSetGpio


Prototype  
ULONG MgslSetGpio( HANDLE hDevice, GPIO_DESC *gpio );
Parameters  
hDevice
handle to open port
gpio
pointer to GPIO_DESC structure
Return Value  
ERROR_SUCCESS (0)
parameters set successfully
ERROR_INVALID_PARAMETER
invalid option ID or value pointer
ERROR_INVALID_HANDLE
hDevice is invalid

Set the current direction configuration of all GPIO signals and the state of output signals.

GPIO_DESC Setup
smask set bit for each output state to set
state target state for each output specified in smask
dmask set bit for each signal direction to set
dir direction for each signal (0=input 1=output)

Both direction and output state may bet set in a single call, depending on the settings of the smask and dmask fields. If both state and direction are set in a single call, the direction setting is applied first and then the output state. The state setting is only for outputs, and state settings for inputs are ignored.

See also: MgslGetGpio, GPIO_DESC, General Purpose I/O


Previous Contents Next