AudioScience HPI Version_4.24.1
|
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_t | HPI_GpioOpen (const hpi_hsubsys_t *phSubSys, uint16_t wAdapterIndex, hpi_handle_t *phGpio, uint16_t *pwNumberInputBits, uint16_t *pwNumberOutputBits) |
Opens the GPIO on a particular adapter for reading and writing. | |
hpi_err_t | HPI_GpioReadBit (const hpi_hsubsys_t *phSubSys, hpi_handle_t hGpio, uint16_t wBitIndex, uint16_t *pwBitData) |
Read a particular bit from an adapter's GPIO input port. | |
hpi_err_t | HPI_GpioReadAllBits (const hpi_hsubsys_t *phSubSys, hpi_handle_t hGpio, uint16_t awAllBitData[4]) |
Read all bits from an adapter's GPIO input ports. | |
hpi_err_t | HPI_GpioWriteBit (const hpi_hsubsys_t *phSubSys, hpi_handle_t hGpio, uint16_t wBitIndex, uint16_t wBitData) |
Write a particular bit to an adapter's GPIO output port. | |
hpi_err_t | HPI_GpioWriteStatus (const hpi_hsubsys_t *phSubSys, hpi_handle_t hGpio, uint16_t awAllBitData[4]) |
Read back the current status of all GPIO outputs on an adapter. |
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.
hpi_err_t HPI_GpioOpen | ( | const hpi_hsubsys_t * | phSubSys, |
uint16_t | wAdapterIndex, | ||
hpi_handle_t * | phGpio, | ||
uint16_t * | pwNumberInputBits, | ||
uint16_t * | 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.
phSubSys | Vestigial subsys handle (unused), may be set to NULL |
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. |
References HPI_IndexesToHandle().
hpi_err_t HPI_GpioReadBit | ( | const hpi_hsubsys_t * | phSubSys, |
hpi_handle_t | hGpio, | ||
uint16_t | wBitIndex, | ||
uint16_t * | pwBitData | ||
) |
Read a particular bit from an adapter's GPIO input port.
phSubSys | Vestigial subsys handle (unused), may be set to NULL |
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_t HPI_GpioReadAllBits | ( | const hpi_hsubsys_t * | phSubSys, |
hpi_handle_t | hGpio, | ||
uint16_t | awAllBitData[4] | ||
) |
Read all bits from an adapter's GPIO input ports.
phSubSys | Vestigial subsys handle (unused), may be set to NULL |
hGpio | Handle to GPIO object. |
awAllBitData | Returned input states. pwBitData should point to an array of uint16_t bits[4]. Bit 0 refers to the 1st GPIO input. |
hpi_err_t HPI_GpioWriteBit | ( | const hpi_hsubsys_t * | phSubSys, |
hpi_handle_t | hGpio, | ||
uint16_t | wBitIndex, | ||
uint16_t | wBitData | ||
) |
Write a particular bit to an adapter's GPIO output port.
phSubSys | Vestigial subsys handle (unused), may be set to NULL |
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_t HPI_GpioWriteStatus | ( | const hpi_hsubsys_t * | phSubSys, |
hpi_handle_t | hGpio, | ||
uint16_t | awAllBitData[4] | ||
) |
Read back the current status of all GPIO outputs on an adapter.
phSubSys | Vestigial subsys handle (unused), may be set to NULL |
hGpio | Handle to GPIO object. |
awAllBitData | Returned output states. pwBitData should point to an array of uint16_t bits[4]. Bit 0 refers to the 1st GPIO output. |