GPIO control functions.


Detailed Description

These functions implement GPIO operations.

By GPIO we here mean the control of relays and the reading of optos.


Functions

ASX32_API ASX_ERROR ASX_GPIO_GetProperties (ASX_HANDLE hGPIO, int *pnNumberOfInputBits, int *pnNumberOfOutputBits)
 Get the properties of the GPIO control.
ASX32_API ASX_ERROR ASX_GPIO_InputGet (ASX_HANDLE hGPIO, int *pnInputBits, const int nNumberOfBits)
 Read the state of the GPIO opto inputs.
ASX32_API ASX_ERROR ASX_GPIO_OutputSet (ASX_HANDLE hGPIO, int *pnOutputBits, const int nNumberOfBits)
 Write to the GPIO relay outputs.
ASX32_API ASX_ERROR ASX_GPIO_OutputGet (ASX_HANDLE hGPIO, int *pnOutputBits, const int nNumberOfBits)
 Read the current GPIO relay output settings.


Function Documentation

ASX32_API ASX_ERROR ASX_GPIO_GetProperties ASX_HANDLE  hGPIO,
int *  pnNumberOfInputBits,
int *  pnNumberOfOutputBits
 

Get the properties of the GPIO control.

GPIO controls have a number of input and output bits and this function tells the application how many there are of each.

Parameters:
hGPIO A handle to an ASX GPIO control object.
pnNumberOfInputBits The number of input bits.
pnNumberOfOutputBits The number of output bits.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_GPIO_InputGet ASX_HANDLE  hGPIO,
int *  pnInputBits,
const int  nNumberOfBits
 

Read the state of the GPIO opto inputs.

This functions reads all the GPIO inputs and returns the current readings in an array of bits.

Parameters:
hGPIO A handle to an ASX GPIO control object.
pnInputBits An array of dimension nNumberOfBits items elements returns the bit readings. pnBits[0] is the reading of opto 0 and pnBits[1] is the reading of opto 1. All pnBits elements will be set to either 1 or 0.
nNumberOfBits The number of bits which should be set to the dimension of pnBits.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_GPIO_OutputGet ASX_HANDLE  hGPIO,
int *  pnOutputBits,
const int  nNumberOfBits
 

Read the current GPIO relay output settings.

This functions reads all the GPIO outputs.

Parameters:
hGPIO A handle to an ASX GPIO control object.
pnOutputBits An array of dimension nNumberOfBits elements that is used to return the relay settings.
nNumberOfBits The number of bits which must be set to the dimension of pnBits.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_GPIO_OutputSet ASX_HANDLE  hGPIO,
int *  pnOutputBits,
const int  nNumberOfBits
 

Write to the GPIO relay outputs.

This functions writes to all the GPIO outputs, setting the outputs to the values of pnBits.

Parameters:
hGPIO A handle to an ASX GPIO control object.
pnOutputBits An array of dimension nNumberOfBits elements that is used to set the relays. All elements should be set to a value of either 1 or 0.
nNumberOfBits The number of bits which must be set to the dimension of pnBits.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.


Generated on Tue Nov 18 13:03:41 2008 for ASX by  doxygen 1.4.6-NO