GPIO

The GPIO object on an adapter reperesents a number of input bits that may be individually sensed and a number of digital output bits that may be individually set. More...

Functions

HPI_ERR HPI_GpioOpen (HPI_HSUBSYS *phSubSys, HW16 wAdapterIndex, HPI_HGPIO *phGpio, HW16 *pwNumberInputBits, HW16 *pwNumberOutputBits)
 Opens the GPIO on a particular adapter for reading and writing.
HPI_ERR HPI_GpioReadBit (HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 wBitIndex, HW16 *pwBitData)
 Read a particular bit from an adapter's GPIO input port.
HPI_ERR HPI_GpioReadAllBits (HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 *pwBitData)
 Read all bits from an adapter's GPIO input ports.
HPI_ERR HPI_GpioWriteBit (HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 wBitIndex, HW16 wBitData)
 Write a particular bit to an adapter's GPIO output port.
HPI_ERR HPI_API HPI_GpioWriteStatus (HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 *pwBitData)
 Read back the current status of an adapter's GPIO output.

Detailed Description

The GPIO object on an adapter reperesents a number of input bits that may be individually sensed and a number of digital output bits that may be individually set.

There is at most one GPIO object per adapter.

On an adapter such as an ASI4346, the bit outputs control relay closurers. HPI_GpioWriteBit() can be used to set the state of each of the relays. Similarly, the inputs on the ASI4346 are mapped 1 to 1 to opto isolated inputs.


Function Documentation

HPI_ERR HPI_GpioOpen HPI_HSUBSYS *  phSubSys,
HW16  wAdapterIndex,
HPI_HGPIO *  phGpio,
HW16 *  pwNumberInputBits,
HW16 *  pwNumberOutputBits
 

Opens the GPIO on a particular adapter for reading and writing.

It returns a handle to the GPIO object (hGpio) and the number of input and output bits (*pwNumberInputBits,*pwNumberOutputBits). If the adapter does not have any GPIO functionality, the function will return an error.

Returns:
0 on success, or one of the HPI Error codes.
Parameters:
wAdapterIndex  Get GPIO handle for this adapter.
phGpio  Returned handle to GPIO object.
pwNumberInputBits  Returned number of GPIO inputs.
pwNumberOutputBits  Returned number of GPIO outputs.

HPI_ERR HPI_GpioReadBit HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16  wBitIndex,
HW16 *  pwBitData
 

Read a particular bit from an adapter's GPIO input port.

Returns:
0 on success, or one of the HPI Error codes.
Parameters:
phSubSys  Pointer to HPI subsystem handle.
hGpio  Handle to GPIO object.
wBitIndex  Bit index to read.
pwBitData  Returned state of the input. A "1" means the input has been set.

HPI_ERR HPI_GpioReadAllBits HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16 *  pwBitData
 

Read all bits from an adapter's GPIO input ports.

Returns:
0 on success, or one of the HPI Error codes.
Parameters:
phSubSys  Pointer to HPI subsystem handle.
hGpio  Handle to GPIO object.
pwBitData  Returned input states. pwBitData should point to an array of HW16 bits[4]. Bit 0 refers to the 1st GPIO input.

HPI_ERR HPI_GpioWriteBit HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16  wBitIndex,
HW16  wBitData
 

Write a particular bit to an adapter's GPIO output port.

Returns:
0 on success, or one of the HPI Error codes.
Parameters:
phSubSys  Pointer to HPI subsystem handle.
hGpio  Handle to GPIO object.
wBitIndex  An index which addresses one of the input bits.
wBitData  The state to set the output to. A "1" turns the output on.

HPI_ERR HPI_API HPI_GpioWriteStatus HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16 *  pwBitData
 

Read back the current status of an adapter's GPIO output.

Returns:
0 on success, or one of the HPI Error codes.
Parameters:
phSubSys  Pointer to HPI subsystem handle.
hGpio  Handle to GPIO object.
pwBitData  Returned output bit settings. pwBitData should point to an array of HW16 bits[4]. Bit 0 refers to the 1st GPIO output.


Generated on Tue Nov 18 12:59:31 2008 for AudioScience HPI by  doxygen 1.4.6-NO