OceanDirectLighthouse  3.1.1
OceanDirect Lighthouse C++/C API
oceandirect::api::LHGpioAPI Class Reference

Public Member Functions

virtual size_t getNumberOfGPIO (lh_device_id_t deviceID, lh_error_code_t *errorCode)
 
virtual lh_gpio_directions_t getOutputState (lh_device_id_t deviceID, lh_error_code_t *errorCode)
 
virtual lh_gpio_values_t getValue (lh_device_id_t deviceID, lh_error_code_t *errorCode)
 
virtual void setOutputState (lh_device_id_t deviceID, lh_error_code_t *errorCode, lh_gpio_directions_t direction, lh_gpio_bitmask_t bitmask)
 
virtual void setValue (lh_device_id_t deviceID, lh_error_code_t *errorCode, lh_gpio_values_t value, lh_gpio_bitmask_t bitmask)
 

Member Function Documentation

◆ getNumberOfGPIO()

virtual size_t oceandirect::api::LHGpioAPI::getNumberOfGPIO ( lh_device_id_t  deviceID,
lh_error_code_t *  errorCode 
)
virtual

.getNumberOfGPIO Return the total number of GPIO pins.

Parameters
deviceIDthe identifier of the device as returned by getDeviceIDs.
errorCodesee LHErrorCode.
Returns
the total number of GPIO pins (input and output) or 0 on error.

◆ getOutputState()

virtual lh_gpio_directions_t oceandirect::api::LHGpioAPI::getOutputState ( lh_device_id_t  deviceID,
lh_error_code_t *  errorCode 
)
virtual

.getOutputState Return the direction (input or output) of the pins.

See also
setOutputState()
Parameters
deviceIDthe identifier of the device as returned by getDeviceIDs.
errorCodesee LHErrorCode.
Returns
a value specifying the direction of the corresponding pin i.e. bit "n" determines the direction of the nth GPIO pin. A bit value of 0 specifes an input pin; a bit value of 1 specifies an output pin. A value of 0 will also be returned on error.

◆ getValue()

virtual lh_gpio_values_t oceandirect::api::LHGpioAPI::getValue ( lh_device_id_t  deviceID,
lh_error_code_t *  errorCode 
)
virtual

.getValue Return the value of the pins.

See also
setValue()
Parameters
deviceIDthe identifier of the device as returned by getDeviceIDs.
errorCodesee LHErrorCode.
Returns
the values of the corresponding pin i.e. bit "n" determines the value of the nth GPIO pin. A value of 0 will also be returned on error.

◆ setOutputState()

virtual void oceandirect::api::LHGpioAPI::setOutputState ( lh_device_id_t  deviceID,
lh_error_code_t *  errorCode,
lh_gpio_directions_t  direction,
lh_gpio_bitmask_t  bitmask 
)
virtual

.setOutputState Set the direction (input or output) of the pins specified by the supplied bitmask.

See also
getOutputState()
Parameters
deviceIDthe identifier of the device as returned by getDeviceIDs.
errorCodesee LHErrorCode.
directionthe bits of this value determine the direction of the corresponding pin i.e. bit "n" determines the direction of the nth GPIO pin. A bit value of 0 specifes an input pin; a bit value of 1 specifies an output pin.
bitmaskthe bitmask determines which values of the direction parameter shall be used i.e. if the nth bit of the bitmask is 1 then the corresponding direction bit will be applied, if the bit is 0 the corresponding direction bit will not be applied.

◆ setValue()

virtual void oceandirect::api::LHGpioAPI::setValue ( lh_device_id_t  deviceID,
lh_error_code_t *  errorCode,
lh_gpio_values_t  value,
lh_gpio_bitmask_t  bitmask 
)
virtual

.setValue Set the value of the pins specified by the supplied bitmask.

See also
getValue()
Parameters
deviceIDthe identifier of the device as returned by getDeviceIDs.
errorCodesee LHErrorCode.
valuethe bits of this value determine the value of the corresponding pin i.e. bit "n" determines the value of the nth GPIO pin.
bitmaskthe bitmask determines which bits of the value parameter shall be used i.e. if the nth bit of the bitmask is 1 then the corresponding value bit will be applied, if the bit is 0 the corresponding value bit will not be applied.

The documentation for this class was generated from the following file: