OceanDirect  2.4.0
OceanDirect C++/C API
oceandirect::api::GpioAPI Class Reference

Public Member Functions

int getNumberOfGPIO (long deviceID, int *errorCode)
 
uint32_t getOutputAlternate (long deviceID, int *errorCode)
 
bool getOutputAlternate (long deviceID, int *errorCode, int bit)
 
std::uint32_t getOutputEnable (long deviceID, int *errorCode)
 
bool getOutputEnable (long deviceID, int *errorCode, int bit)
 
uint32_t getValue (long deviceID, int *errorCode)
 
bool getValue (long deviceID, int *errorCode, int bit)
 
void setOutputAlternate (long deviceID, int *errorCode, int bit, bool isAlternate)
 
void setOutputAlternate (long deviceID, int *errorCode, uint32_t bitMask)
 
void setOutputEnable (long deviceID, int *errorCode, std::uint32_t bitmask)
 
void setOutputEnable (long deviceID, int *errorCode, std::uint32_t bitPosition, bool isOutput)
 
void setValue (long deviceID, int *errorCode, std::uint32_t bitmask)
 
void setValue (long deviceID, int *errorCode, std::uint32_t bitPosition, bool isHigh)
 

Static Public Member Functions

static GpioAPIgetInstance ()
 
static void shutdown ()
 

Member Function Documentation

◆ getNumberOfGPIO()

int oceandirect::api::GpioAPI::getNumberOfGPIO ( long  deviceID,
int *  errorCode 
)
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
Returns
the number of GPIO pins provided by the device.

◆ getOutputAlternate() [1/2]

uint32_t oceandirect::api::GpioAPI::getOutputAlternate ( long  deviceID,
int *  errorCode 
)

Get the settings for alternate functionality on the GPIO pins. Not all spectrometers support this functionality.

Deprecated:
This function is deprecated starting with release 2.1 and will be removed in the future release.
Parameters
deviceIDThe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
Returns
a bitmask with value 1 where the corresponding pin is set to alternate functionality, 0 otherwise (pin is a GPIO pin).

◆ getOutputAlternate() [2/2]

bool oceandirect::api::GpioAPI::getOutputAlternate ( long  deviceID,
int *  errorCode,
int  bit 
)

Get the setting for alternate functionality on the specified bit (pin). Not all spectrometers support this functionality.

Deprecated:
This function is deprecated starting with release 2.1 and will be removed in the future release.
Parameters
deviceIDThe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitWhich GPIO bit or pin to query.
Returns
true if the pin is set to alternate functionality, false otherwise (pin is a GPIO pin).

◆ getOutputEnable() [1/2]

std::uint32_t oceandirect::api::GpioAPI::getOutputEnable ( long  deviceID,
int *  errorCode 
)
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
Returns
the bitmask specifying the direction of each GPIO pin.

◆ getOutputEnable() [2/2]

bool oceandirect::api::GpioAPI::getOutputEnable ( long  deviceID,
int *  errorCode,
int  bit 
)
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitthe GPIO pin to query.
Returns
true if the pin is an output pin, false if the pin is an input pin.

◆ getValue() [1/2]

uint32_t oceandirect::api::GpioAPI::getValue ( long  deviceID,
int *  errorCode 
)
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
Returns
the bitmask specifying the logic level of each GPIO pin.

◆ getValue() [2/2]

bool oceandirect::api::GpioAPI::getValue ( long  deviceID,
int *  errorCode,
int  bit 
)
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitthe GPIO pin to query.
Returns
true if the specified pin is set to logic level hig, false if the specified pin is set to logic level low.

◆ setOutputAlternate() [1/2]

void oceandirect::api::GpioAPI::setOutputAlternate ( long  deviceID,
int *  errorCode,
int  bit,
bool  isAlternate 
)

Set the alternate functionality for the specified pin (bit) number. Not all spectrometers support this functionality.

Deprecated:
This function is deprecated starting with release 2.1 and will be removed in the future release.
Parameters
deviceIDThe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitWhich GPIO bit or pin to set
isAlternateset true to enable the alternate functionality for the pin, false otherwise (pin is a GPIO pin).

◆ setOutputAlternate() [2/2]

void oceandirect::api::GpioAPI::setOutputAlternate ( long  deviceID,
int *  errorCode,
uint32_t  bitMask 
)

Set the alternate functionality for the specified pins (bits). Not all spectrometers support this functionality.

Deprecated:
This function is deprecated starting with release 2.1 and will be removed in the future release.
Parameters
deviceIDThe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitMaskwith bit set to 1 to set enable the alternate functionality, 0 otherwise (pin is a GPIO pin).

◆ setOutputEnable() [1/2]

void oceandirect::api::GpioAPI::setOutputEnable ( long  deviceID,
int *  errorCode,
std::uint32_t  bitmask 
)

Set the direction (input/output) of the GPIO pins.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitmaska bitmask specifying the pin directions i.e. the nth bit set to 1 sets the nth pin to output.

◆ setOutputEnable() [2/2]

void oceandirect::api::GpioAPI::setOutputEnable ( long  deviceID,
int *  errorCode,
std::uint32_t  bitPosition,
bool  isOutput 
)

Set the direction (input/output) of a specified GPIO pin.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitthe GPIO pin to set.
isOutputset to true to make the pin output, false to make the pin input.

◆ setValue() [1/2]

void oceandirect::api::GpioAPI::setValue ( long  deviceID,
int *  errorCode,
std::uint32_t  bitmask 
)

Set the logic value for all GPIO pins.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitmaskthe bitmask specifying the logic level of each GPIO pin.

◆ setValue() [2/2]

void oceandirect::api::GpioAPI::setValue ( long  deviceID,
int *  errorCode,
std::uint32_t  bitPosition,
bool  isHigh 
)

Set the logic value for a spcified pin.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodeon exit this contains zero on success, nonzero otherwise.
bitthe GPIO pin to set.
isHighset true to set the logic level high, set false to set the logic level low.

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