NetOceanDirect 3.1.3
OceanDirect .NET API
NetOceanDirect::Gpio Class Reference

#include <Gpio.h>

Inherits NetOceanDirect::ManagedObject< GpioAPI >.

Public Member Functions

 Gpio (GpioAPI *instance)
 
virtual ~Gpio ()
 
int getNumberOfGPIO (long deviceID, int% errorCode)
 
uint32_t getOutputAlternate (long deviceID, int% errorCode)
 
bool getOutputAlternate (long deviceID, int% errorCode, int bit)
 
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, int bit, bool direction)
 
void setOutputEnable (long deviceID, int% errorCode, uint32_t bitmask)
 
void setOutputEnable (long deviceID, int% errorCode, uint32_t outputBits, uint32_t bitmask)
 
void setValue (long deviceID, int% errorCode, int bit, bool value)
 
void setValue (long deviceID, int% errorCode, uint32_t bitmask)
 
void setValue (long deviceID, int% errorCode, uint32_t valueBits, uint32_t bitmask)
 
- Public Member Functions inherited from NetOceanDirect::ManagedObject< GpioAPI >
 ManagedObject (GpioAPI *instance)
 
 !ManagedObject ()
 
virtual ~ManagedObject ()
 
GpioAPI * GetInstance ()
 

Static Public Member Functions

static Gpio getInstance ()
 

Protected Member Functions

 Gpio ()
 

Static Protected Attributes

static Gpio gpio
 

Additional Inherited Members

- Protected Attributes inherited from NetOceanDirect::ManagedObject< GpioAPI >
GpioAPI * m_Instance
 

Constructor & Destructor Documentation

◆ Gpio() [1/2]

Gpio::Gpio ( )
protected

◆ Gpio() [2/2]

Gpio::Gpio ( GpioAPI * instance)

◆ ~Gpio()

virtual NetOceanDirect::Gpio::~Gpio ( )
inlinevirtual

Member Function Documentation

◆ getInstance()

Gpio Gpio::getInstance ( )
static

◆ getNumberOfGPIO()

int Gpio::getNumberOfGPIO ( long deviceID,
int% errorCode )

Retrieves the number of GPIO pins available on the given device

Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
number of GPIO pins available on the given device, or 0 if an error occurred

◆ getOutputAlternate() [1/2]

uint32_t Gpio::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 Gpio::getOutputAlternate ( long deviceID,
int% errorCode,
int bit )

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

See also
setOutputAlternate()
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]

uint32_t Gpio::getOutputEnable ( long deviceID,
int% errorCode )

Retrieves the current direction of all GPIO pins on the given device.

Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
a bitmask containing the current state of all GPIO pins on the given device, in which the LSB corresponds to GPIO pin 0, and bits set to 1 indicate outputs, while bits set to 0 indicate inputs

◆ getOutputEnable() [2/2]

bool Gpio::getOutputEnable ( long deviceID,
int% errorCode,
int bit )

Retrieves the current direction (input vs. output) for a specific GPIO pin on the given device.

See also
setOutputEnable()
Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitthe index of the GPIO pin for which to query the state
Returns
true if the specified pin is an output, false if the specified pin is an input

◆ getValue() [1/2]

uint32_t Gpio::getValue ( long deviceID,
int% errorCode )

Retrieves the current logic level of all GPIO pins on the given device.

Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
bitmask with LSB corresponding to GPIO pin 0, in which bits set to 1 indicate logic level high and bits set to 0 indicate logic level low

◆ getValue() [2/2]

bool Gpio::getValue ( long deviceID,
int% errorCode,
int bit )

Retrieves the current logic level of a specific GPIO pin on the given device.

See also
* setValue()
Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitthe index of the GPIO pin for which to retrieve the logic level
Returns
the logic level of the specified GPIO pin, where true indicates logic high and false indicates logic low

◆ setOutputAlternate() [1/2]

void Gpio::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.

See also
getOutputAlternate()
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 Gpio::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/3]

void Gpio::setOutputEnable ( long deviceID,
int% errorCode,
int bit,
bool direction )

Configures a specific GPIO pin as either an input or an output on a given device.

Parameters
[in]deviceIDthe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitthe index of the GPIO pin to be configured
[in]directiontrue to configure the pin as an output, false to configure the pin as an input

◆ setOutputEnable() [2/3]

void Gpio::setOutputEnable ( long deviceID,
int% errorCode,
uint32_t bitmask )

Configures the entire bank of GPIO pins as inputs or outputs using a bitmask.

See also
getOutputEnable()
Parameters
[in]deviceIDthe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitmaska bitmask with LSB corresponding to GPIO pin 0, in which bits set to 1 indicate outputs and bits set to 0 indicate inputs - this state will be applied to the device's GPIO configuration

◆ setOutputEnable() [3/3]

void Gpio::setOutputEnable ( long deviceID,
int% errorCode,
uint32_t outputBits,
uint32_t bitmask )

◆ setValue() [1/3]

void Gpio::setValue ( long deviceID,
int% errorCode,
int bit,
bool value )

Sets the value of a specific GPIO pins on the given device.

See also
getValue()
Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitthe index of the GPIO pin for which to set the output value
[in]valuethe new value of the output pin's logic level (true indicates high, false indicates low)

◆ setValue() [2/3]

void Gpio::setValue ( long deviceID,
int% errorCode,
uint32_t bitmask )

Sets the value of all GPIO pins on the given device.

Parameters
[in]deviceIDthe device ID for the device to be configured (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]bitmaska bitmask with LSB corresponding to GPIO pin 0, in which bits set to 1 indicate logic level high and bits set to 0 indicate logic level low - this state will be applied to the device's GPIO configuration

◆ setValue() [3/3]

void Gpio::setValue ( long deviceID,
int% errorCode,
uint32_t valueBits,
uint32_t bitmask )

Sets the value of a specific GPIO pins on the given device.

Parameters
[in]deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
[out]errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
[in]valueBitsthe bit value to be applied on the gpio pin.
[in]bitmaskthe bits where the value will be applied. Only bit with 1 value will be applied.

Member Data Documentation

◆ gpio

Gpio NetOceanDirect::Gpio::gpio
staticprotected

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