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 (const 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 (const 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 (const HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 awAllBitData[4])
 Read all bits from an adapter's GPIO input ports.
HPI_ERR HPI_GpioWriteBit (const HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 wBitIndex, HW16 wBitData)
 Write a particular bit to an adapter's GPIO output port.
HPI_ERR HPI_GpioWriteStatus (const HPI_HSUBSYS *phSubSys, HPI_HGPIO hGpio, HW16 awAllBitData[4])
 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 const 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:
phSubSys  Pointer to HPI subsystem handle.
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 const 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 const HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16  awAllBitData[4]
 

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.
awAllBitData  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 const 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_GpioWriteStatus const HPI_HSUBSYS *  phSubSys,
HPI_HGPIO  hGpio,
HW16  awAllBitData[4]
 

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.
awAllBitData  Returned output bit settings. pwBitData should point to an array of HW16 bits[4]. Bit 0 refers to the 1st GPIO output.


Generated on Thu Jul 29 09:56:42 2010 for AudioScience HPI by  doxygen 1.4.6-NO