ASX Version4.20.14
Functions

GPIO control functions

These functions implement GPIO operations. More...

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.

Detailed Description

These functions implement GPIO operations.

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


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:
hGPIOA handle to an ASX GPIO control object.
pnNumberOfInputBitsThe number of input bits.
pnNumberOfOutputBitsThe 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:
hGPIOA handle to an ASX GPIO control object.
pnInputBitsAn 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.
nNumberOfBitsThe 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:
hGPIOA handle to an ASX GPIO control object.
pnOutputBitsAn array of dimension nNumberOfBits elements that is used to return the relay settings.
nNumberOfBitsThe 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:
hGPIOA handle to an ASX GPIO control object.
pnOutputBitsAn 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.
nNumberOfBitsThe 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.