VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
Public Types | Public Member Functions | Friends | List of all members
VMXIO Class Reference

The VMXIO class provides access to VMX Analog/Digital IO functions, including VMX Channel and VMX Resource Management and functions. More...

#include <VMXIO.h>

Public Types

enum  EncoderDirection { EncoderForward, EncoderReverse }
 Enumeration of Encoder Directions.
 
enum  AnalogTriggerState { BelowThreshold, AboveThreshold, InWindow }
 Enumeration of Analog Trigger States.
 

Public Member Functions

uint8_t GetNumResourcesByType (VMXResourceType resource_type)
 Returns the number of VMX Resources of the specified VMXResourceType. More...
 
uint8_t GetNumChannelsByCapability (VMXChannelCapability channel_capability)
 Returns the number of VMX Channels of the specified VMXChannelCapability. More...
 
uint8_t GetNumChannelsByType (VMXChannelType channel_type, VMXChannelIndex &first_channel_index)
 Returns the number of VMX Channels of the specified VMXChannelType. More...
 
bool GetChannelCapabilities (VMXChannelIndex channel_index, VMXChannelType &channel_type, VMXChannelCapability &capability_bits)
 Returns the VMXChannelType and VMXChannelCapability for the specified VMXChannelIndex. More...
 
bool ChannelSupportsCapability (VMXChannelIndex channel_index, VMXChannelCapability capability)
 Indicates whether the specified VMXChannelIndex supports the specified VMXChannelCapability. More...
 
VMXChannelIndex GetSoleChannelIndex (VMXChannelCapability capability)
 Returns the VMXChannelIndex for the single channel which implements the specified capability. More...
 
bool GetResourceHandle (VMXResourceType resource_type, VMXResourceIndex res_index, VMXResourceHandle &resource_handle, VMXErrorCode *errcode)
 Returns the VMXResourceHandle of the VMX Resource identified by the specified VMXResourceType and VMXResourceIndex. More...
 
bool GetChannelsCompatibleWithResource (VMXResourceHandle resource_handle, VMXChannelIndex &first_channel_index, uint8_t &num_channels)
 Returns a list of VMXChannelIndexes which are compatible with the specified VMXResourceHandle. More...
 
bool GetResourceHandleWithAvailablePortForChannel (VMXResourceType resource_type, VMXChannelIndex channel_index, VMXChannelCapability capability, VMXResourceHandle &resource_handle, bool &allocated, VMXErrorCode *errcode)
 
bool GetResourceFromRoutedChannel (VMXChannelIndex channel_index, VMXResourceHandle &handle_out, VMXErrorCode *errcode)
 Retrieves the VMXResourceHandle (if any) to which the specified VMXChannelIndex is routed. More...
 
bool IsResourceAllocated (VMXResourceHandle resource, bool &allocated, bool &is_shared, VMXErrorCode *errcode)
 Indicates whether the specified VMXResourceHandle is currently allocated, and whether it is a shared resource. More...
 
bool AllocateResource (VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to allocate the specified VMXResourceHandle. More...
 
bool DeallocateResource (VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to deallocate the specified VMXResourceHandle. More...
 
bool DeallocateAllResources (VMXErrorCode *last_errorcode)
 Attempts to deallocate all currently-allocated VMXResourceHandles. More...
 
bool RouteChannelToResource (VMXChannelIndex channel, VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to route the specified VMXChannelIndex to the allocated VMXResourceHandle Note: If the resource requires multiple channels to be allocated to the resource, all channels are routed when the first channel is routed. More...
 
bool UnrouteChannelFromResource (VMXChannelIndex channel, VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to unroute the specified VMXChannelIndex from the allocated VMXResourceHandle. More...
 
bool UnrouteAllChannelsFromResource (VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to unroute all VMX Channels from the allocated VMXResourceHandle. More...
 
bool GetNumChannelsRoutedToResource (VMXResourceHandle resource, uint8_t &num_routed_channels, VMXErrorCode *errcode)
 
bool SetResourceConfig (VMXResourceHandle resource, const VMXResourceConfig *p_config, VMXErrorCode *errcode)
 Sets the configuration to the specified VMXResourceHandle. More...
 
bool GetResourceConfig (VMXResourceHandle resource, VMXResourceConfig *&p_config, VMXErrorCode *errcode)
 Gets the configuration of the specified VMXResourceHandle. More...
 
bool IsResourceActive (VMXResourceHandle, bool &active, VMXErrorCode *errcode)
 Indicates whether the specified VMXResourceHandle is currently active. More...
 
bool ActivateResource (VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to activate the specified VMXResourceHandle NOTE: VMX Resources can be activated after they have been sucessfully allocated, had VMX Channels routed to them, and (optionally) configured. More...
 
bool DeactivateResource (VMXResourceHandle resource, VMXErrorCode *errcode)
 Attempts to deactivate the specified VMXResourceHandle. More...
 
bool ActivateSinglechannelResource (const VMXChannelInfo &channel_info, const VMXResourceConfig *res_cfg, VMXResourceHandle &res_handle, VMXErrorCode *errcode)
 Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the specified VMX Channel to it, then applying the specified configuration, and then finally performing resource activation. More...
 
bool ActivateDualchannelResource (const VMXChannelInfo &ch1, const VMXChannelInfo &ch2, const VMXResourceConfig *res_cfg, VMXResourceHandle &res_handle, VMXErrorCode *errcode)
 Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the two specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation. More...
 
bool ActivateQuadchannelResource (const VMXChannelInfo &ch1, const VMXChannelInfo &ch2, const VMXChannelInfo &ch3, const VMXChannelInfo &ch4, const VMXResourceConfig *res_cfg, VMXResourceHandle &res_handle, VMXErrorCode *errcode)
 Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the four specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation. More...
 
bool ActivateMultichannelResource (uint8_t num_channels, const VMXChannelInfo *p_channel_infos, const VMXResourceConfig *res_cfg, VMXResourceHandle &res_handle, VMXErrorCode *errcode)
 Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation. More...
 
bool DIO_Get (VMXResourceHandle dio_res_handle, bool &high, VMXErrorCode *errcode)
 Returns the current signal state from a VMX DigitalIO Resource. More...
 
bool DIO_Set (VMXResourceHandle dio_res_handle, bool high, VMXErrorCode *errcode)
 Sets the current signal state of a VMX DigitalIO Resource in Digital Output mode. More...
 
bool DIO_Pulse (VMXResourceHandle dio_res_handle, bool high, uint32_t num_microseconds, VMXErrorCode *errcode)
 Begins a timed pulse (with the specified level) on a VMX DigitalIO Resource in Digital Output mode. More...
 
bool DIO_IsPulsing (VMXResourceHandle dio_res_handle, bool &is_pulsing, VMXErrorCode *errcode)
 Indicates whether a previously-requested pulse is underway (not completed) on a VMX DigitalIO Resource in Digital Output mode. More...
 
bool DIO_GetNumPulsing (uint8_t &num_pulsing)
 Indicates whether pulsing is underway (not completed) on any DigitalIO Resource in Digital Output mode. More...
 
bool PWMGenerator_SetDutyCycle (VMXResourceHandle pwmgen_res_handle, VMXResourcePortIndex port_index, uint16_t duty_cycle, VMXErrorCode *errcode)
 Sets the VMX PWM Generator Resource's Duty Cycle to the specified value. More...
 
bool PWMGenerator_GetDutyCycle (VMXResourceHandle pwmgen_res_handle, VMXResourcePortIndex port_index, uint16_t *duty_cycle, VMXErrorCode *errcode)
 Gets the VMX PWM Generator Resource's current Duty Cycle value. More...
 
bool InputCapture_GetChannelCounts (VMXResourceHandle pwmcap_res_handle, uint32_t &chan1_counts, uint32_t &chan2_counts, VMXErrorCode *errcode)
 Returns the current Capture count values from a VMX Input Capture Resource. More...
 
bool InputCapture_InputStatus (VMXResourceHandle inputcap_res_handle, bool &forward_direction, bool &active, VMXErrorCode *errcode)
 Retrieves the status of the InputCapture Resource, including the "forward direction" and "active" states. More...
 
bool InputCapture_Reset (VMXResourceHandle inputcap_res_handle, VMXErrorCode *errcode)
 Sets the VMX InputCapture Resource's count value to 0. More...
 
bool InputCapture_GetCount (VMXResourceHandle inputcap_res_handle, int32_t &count, VMXErrorCode *errcode)
 
bool PWMCapture_GetCount (VMXResourceHandle inputcap_res_handle, uint32_t &frequency_us, uint32_t &duty_cycle_us, VMXErrorCode *errcode)
 Returns the current Capture count values from a VMX Input Capture Resource that has been configured for PWMCapture mode (see PWMCaptureConfig class). More...
 
bool Encoder_GetCount (VMXResourceHandle encoder_res_handle, int32_t &count, VMXErrorCode *errcode)
 Returns the current Encoder count value from a VMX Encoder Resource. More...
 
bool Encoder_GetDirection (VMXResourceHandle encoder_res_handle, EncoderDirection &direction, VMXErrorCode *errcode)
 Returns the current EncoderDirection value from a VMX Encoder Resource. More...
 
bool Encoder_Reset (VMXResourceHandle encoder_res_handle, VMXErrorCode *errcode)
 Sets the VMX Encoder Resource's count value to 0. More...
 
bool Encoder_GetLastPulsePeriodMicroseconds (VMXResourceHandle encoder_res_handle, uint16_t &encoder_curr_avg_pulse_period_microseconds, VMXErrorCode *errcode)
 Returns the average period (in microseconds) of the most recent encoder pulses captured by a VMX Encoder Resource. More...
 
bool Encoder_SetResetSource (VMXResourceHandle encoder_res_handle, VMXResourceHandle interrupt_res_handle, bool clear_on_level, bool clear_level_high, VMXErrorCode *errcode)
 
bool Encoder_ClearResetSource (VMXResourceHandle encoder_res_handle, VMXErrorCode *errcode)
 
bool Accumulator_GetOversampleValue (VMXResourceHandle accum_res_handle, uint32_t &oversample_value, VMXErrorCode *errcode)
 Returns the current oversample value from a VMX Analog Accumulator Resource. More...
 
bool Accumulator_GetAverageValue (VMXResourceHandle accum_res_handle, uint32_t &average_value, VMXErrorCode *errcode)
 Returns the current averaged value from a VMX Analog Accumulator Resource. More...
 
bool Accumulator_GetInstantaneousValue (VMXResourceHandle accum_res_handle, uint32_t &average_value, VMXErrorCode *errcode)
 Returns the current instantaneous (non-averaged) value from a VMX Analog Accumulator Resource. More...
 
bool Accumulator_GetFullScaleVoltage (float &full_scale_voltage, VMXErrorCode *errcode)
 Returns the current VMX Analog Input full-scale voltage level. More...
 
bool Accumulator_GetAverageVoltage (VMXResourceHandle accum_res_handle, float &average_value, VMXErrorCode *errcode)
 Returns the current averaged value in voltage units from a VMX Analog Accumulator Resource. More...
 
bool Accumulator_Counter_Reset (VMXResourceHandle accum_res_handle, VMXErrorCode *errcode)
 
bool Accumulator_Counter_GetValueAndCount (VMXResourceHandle accum_res_handle, int64_t &value, uint32_t &count, VMXErrorCode *errcode)
 
bool AnalogTrigger_GetState (VMXResourceHandle antrig_res_handle, AnalogTriggerState &state, VMXErrorCode *errcode)
 Returns the current state from a VMX AnalogTrigger Resource. More...
 
bool Interrupt_GetLastRisingEdgeTimestampMicroseconds (VMXResourceHandle int_res_handle, uint64_t &last_timestamp, VMXErrorCode *errcode)
 
bool Interrupt_GetLastFallingEdgeTimestampMicroseconds (VMXResourceHandle int_res_handle, uint64_t &last_timestamp, VMXErrorCode *errcode)
 
bool Interrupt_SetEnabled (VMXResourceHandle int_res_handle, bool enabled, VMXErrorCode *errcode)
 
bool Interrupt_GetEnabled (VMXResourceHandle int_res_handle, bool &enabled, VMXErrorCode *errcode)
 
bool UART_Write (VMXResourceHandle uart_res_handle, uint8_t *p_send_data, uint16_t size, VMXErrorCode *errcode)
 Writes the specified data to the specified VMX UART Resource. More...
 
bool UART_Read (VMXResourceHandle uart_res_handle, uint8_t *p_rcv_data, uint16_t max_size, uint16_t &actual_size_read, VMXErrorCode *errcode)
 Reads data from the specified VMX UART Resource. More...
 
bool UART_GetBytesAvailable (VMXResourceHandle uart_res_handle, uint16_t &size, VMXErrorCode *errcode)
 Returns the number of data bytes which have been received from VMX UART Resource. More...
 
bool SPI_Write (VMXResourceHandle spi_res_handle, uint8_t *p_send_data, uint16_t size, VMXErrorCode *errcode)
 Writes the specified data to the specified VMX SPI Resource. More...
 
bool SPI_Read (VMXResourceHandle spi_res_handle, uint8_t *p_rcv_data, uint16_t size, VMXErrorCode *errcode)
 Reads data from the specified VMX SPI Resource. More...
 
bool SPI_Transaction (VMXResourceHandle spi_res_handle, uint8_t *p_send_data, uint8_t *p_rcv_data, uint16_t size, VMXErrorCode *errcode)
 Simultaneously Writes/Reads data to/from the specified VMX SPI Resource. More...
 
bool I2C_Write (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t register_address, uint8_t *p_send_data, int32_t sendSize, VMXErrorCode *errcode)
 Writes the specified data to the specified VMX I2C Resource. More...
 
bool I2C_Read (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t register_address, uint8_t *p_rcv_data, int32_t count, VMXErrorCode *errcode)
 Reads data from the specified VMX I2C Resource. More...
 
bool I2C_Transaction (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t *p_send_data, uint16_t sendSize, uint8_t *p_rcv_data, uint16_t receiveSize, VMXErrorCode *errcode)
 Writes and/or Reads data to/from the specified VMX I2C Resource. More...
 
bool AutoTransmit_Allocate (AutoTransmitEngineHandle &engine_handle_out, VMXErrorCode *errcode)
 Creates the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_Deallocate (AutoTransmitEngineHandle engine_handle, VMXErrorCode *errcode)
 Deallocates the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_StartPeriodic (AutoTransmitEngineHandle engine_handle, VMXResourceHandle spi_res_handle, uint32_t repeat_every_ms, VMXErrorCode *errcode)
 Begins a periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_StartTrigger (AutoTransmitEngineHandle engine_handle, VMXResourceHandle spi_res_handle, VMXChannelIndex input_trigger_channel, InterruptConfig::InterruptEdge edge_type, VMXErrorCode *errcode)
 Defines the "start" trigger condition which will initiate a SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_Stop (AutoTransmitEngineHandle engine_handle, VMXErrorCode *errcode)
 Stops any currently-active periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_SetData (AutoTransmitEngineHandle engine_handle, uint8_t *dataToSend, int32_t request_size, int32_t reply_size, VMXErrorCode *errcode)
 Registers the Data which will be next sent as part of the currently-active periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_Immediate (AutoTransmitEngineHandle engine_handle, VMXErrorCode *errcode)
 Forces the AutoTransmit engine to immediately start a Transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_GetData (AutoTransmitEngineHandle engine_handle, uint8_t *p_rcv_data, int32_t numToRead, uint32_t timeout_ms, int32_t &num_bytes_remaining, VMXErrorCode *errcode)
 Retrieves data most recently received by the AutoTransmit engine during, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission. More...
 
bool AutoTransmit_GetNumDropped (AutoTransmitEngineHandle engine_handle, int &num_dropped, VMXErrorCode *errcode)
 Returns the number of bytes dropped by the AutoTransmit transfer engine due to the receive buffer being full. More...
 
bool GetWatchdogEnabled (bool &enabled, VMXErrorCode *errcode)
 Returns whether the IO Watchdog is currently enabled. More...
 
bool SetWatchdogEnabled (bool enabled, VMXErrorCode *errcode)
 Changes the IO Watchdog enabled state. More...
 
bool GetWatchdogExpired (bool &expired, VMXErrorCode *errcode)
 Returns whether the IO Watchdog is expired. More...
 
bool GetWatchdogManagedOutputs (bool &flexdio, bool &hicurrdio, bool &commdio, VMXErrorCode *errcode)
 Returns which output groups are managed by the IO Watchdog. More...
 
bool SetWatchdogManagedOutputs (bool flexdio, bool hicurrdio, bool commdio, VMXErrorCode *errcode)
 Configures which output groups are managed by the IO Watchdog. More...
 
bool GetWatchdogTimeoutPeriodMS (uint16_t &timeout_period_ms, VMXErrorCode *errcode)
 Returns the IO Watchdog timeout period. More...
 
bool SetWatchdogTimeoutPeriodMS (uint16_t timeout_period_ms, VMXErrorCode *errcode)
 Configures the IO Watchdog timeout period. More...
 
bool FeedWatchdog (VMXErrorCode *errcode)
 "Feeds" the IO Watchdog. More...
 
bool ExpireWatchdogNow (VMXErrorCode *errcode)
 Forces the IO Watchdog to immediately disable all managed outputs. More...
 
bool LEDArrayBuffer_Create (int n_pixels, LEDArrayBufferHandle &buffer_handle_out, VMXErrorCode *errcode)
 Creates a new LEDArrayBuffer, which can be later transmitted via a LEDArray resource. More...
 
bool LEDArrayBuffer_Delete (LEDArrayBufferHandle buffer_handle, VMXErrorCode *errorcode)
 Deallocates a previously-created LEDArrayBuffer. More...
 
bool LEDArrayBuffer_SetRGBValue (LEDArrayBufferHandle buffer_handle, int index, int r, int g, int b, VMXErrorCode *errocode)
 Modifies the RGB value for a particular "pixel" index within the LEDArrayBuffer. More...
 
bool LEDArrayBuffer_GetLength (LEDArrayBufferHandle buffer_handle, int &length_out, VMXErrorCode *errcode)
 Returns the length (in "pixels") of the LEDArrayBuffer. More...
 
bool LEDArrayBuffer_GetRBGValue (LEDArrayBufferHandle buffer_handle, int index, int &r, int &g, int &b, VMXErrorCode *errcode)
 Returns the current RGB value for a particular "pixel" index within the LEDArrayBuffer. More...
 
bool LEDArray_SetBuffer (VMXResourceHandle led_array_resource_handle, LEDArrayBufferHandle buffer_handle, VMXErrorCode *errcode)
 Registers the specified LEDArrayBuffer with the specified LEDArray. More...
 
bool LEDArray_Render (VMXResourceHandle led_array_resource_handle, VMXErrorCode *errcode)
 Immediately begins transmitting all RGBValues in the LEDArrayBuffer currently registered with the specified LEDArray. More...
 
bool LEDArray_Configure (VMXResourceHandle led_array_resource_handle, LEDArray_OneWireConfig &config, VMXErrorCode *errcode)
 Updates the LEDArray Configuration with the parameters specified in the LEDArray_OneWireConfig object. More...
 

Friends

class VMXPi
 
class VMXZero
 

Detailed Description

The VMXIO class provides access to VMX Analog/Digital IO functions, including VMX Channel and VMX Resource Management and functions.

Member Function Documentation

◆ Accumulator_GetAverageValue()

bool VMXIO::Accumulator_GetAverageValue ( VMXResourceHandle  accum_res_handle,
uint32_t &  average_value,
VMXErrorCode *  errcode 
)

Returns the current averaged value from a VMX Analog Accumulator Resource.

NOTE: The number of samples averaged to calculate the average value is specified by the number of average bits See AccumulatorConfig for more information on modifying these bits

Parameters
accum_res_handleHandle to the activated VMX Accumulator Resource
[out]average_valueCurrent Accumulator average value
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Accumulator average value was returned. If false, the error code will be returned via the errcode parameter.

◆ Accumulator_GetAverageVoltage()

bool VMXIO::Accumulator_GetAverageVoltage ( VMXResourceHandle  accum_res_handle,
float &  average_voltage,
VMXErrorCode *  errcode 
)

Returns the current averaged value in voltage units from a VMX Analog Accumulator Resource.

NOTE: The number of samples averaged to calculate the average value is specified by the number of average bits See AccumulatorConfig for more information on modifying these bits

Parameters
accum_res_handleHandle to the activated VMX Accumulator Resource
[out]average_voltageCurrent Accumulator average value, in voltage units
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Accumulator average voltage was returned. If false, the error code will be returned via the errcode parameter.

◆ Accumulator_GetFullScaleVoltage()

bool VMXIO::Accumulator_GetFullScaleVoltage ( float &  full_scale_voltage,
VMXErrorCode *  errcode 
)

Returns the current VMX Analog Input full-scale voltage level.

Parameters
[out]full_scale_voltageCurrent VMX Analog Input full-scale voltage level
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid full-scale voltage value was returned. If false, the error code will be returned via the errcode parameter.

◆ Accumulator_GetInstantaneousValue()

bool VMXIO::Accumulator_GetInstantaneousValue ( VMXResourceHandle  accum_res_handle,
uint32_t &  instantaneous_value,
VMXErrorCode *  errcode 
)

Returns the current instantaneous (non-averaged) value from a VMX Analog Accumulator Resource.

NOTE: This method bypasses the Accmulator's averaging calculation

Parameters
accum_res_handleHandle to the activated VMX Accumulator Resource
[out]instantaneous_valueCurrent Accumulator average value
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Accumulator instantaneous value was returned. If false, the error code will be returned via the errcode parameter.

◆ Accumulator_GetOversampleValue()

bool VMXIO::Accumulator_GetOversampleValue ( VMXResourceHandle  accum_res_handle,
uint32_t &  oversample_value,
VMXErrorCode *  errcode 
)

Returns the current oversample value from a VMX Analog Accumulator Resource.

NOTE: The resolution of Accumulator values is dependent upon the current number of bits 0 bits: 12-bit resolution, 1 bit: 13-bit resolution, etc. See AccumulatorConfig for more information on modifying these bits

Parameters
accum_res_handleHandle to the activated VMX Accumulator Resource
[out]oversample_valueCurrent Accumulator oversample value
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Accumulator Oversample value was returned. If false, the error code will be returned via the errcode parameter.

◆ ActivateDualchannelResource()

bool VMXIO::ActivateDualchannelResource ( const VMXChannelInfo ch1,
const VMXChannelInfo ch2,
const VMXResourceConfig res_cfg,
VMXResourceHandle res_handle,
VMXErrorCode *  errcode 
)

Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the two specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation.

NOTE: This method should be used for dual-channel VMX Resources.

Parameters
ch1The VMXChannelInfo describing the first channel and associated capabilities to route to the VMX Resource
ch2The VMXChannelInfo describing the second channel and associated capabilities to route to the VMX Resource
res_cfgPointer to the VMXResourceConfig object used to configure the VMX Resource
[out]res_handleThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully activated. If false, the error code will be returned via the errcode parameter.

◆ ActivateMultichannelResource()

bool VMXIO::ActivateMultichannelResource ( uint8_t  num_channels,
const VMXChannelInfo p_channel_infos,
const VMXResourceConfig res_cfg,
VMXResourceHandle res_handle,
VMXErrorCode *  errcode 
)

Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation.

NOTE: This method should be used for multiple-channel VMX Resources.

Parameters
num_channelsThe number of VMXChannelIndexes in the array pointed to by the p_channel_indexes parameter
channel_infoThe VMXChannelInfo objects describing the channel and associated capabilities to route to the VMX Resource
res_cfgPointer to the VMXResourceConfig object used to configure the VMX Resource
[out]res_handleThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully activated. If false, the error code will be returned via the errcode parameter.

◆ ActivateQuadchannelResource()

bool VMXIO::ActivateQuadchannelResource ( const VMXChannelInfo ch1,
const VMXChannelInfo ch2,
const VMXChannelInfo ch3,
const VMXChannelInfo ch4,
const VMXResourceConfig res_cfg,
VMXResourceHandle res_handle,
VMXErrorCode *  errcode 
)

Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the four specified VMX Channels to it, then applying the specified configuration, and then finally performing resource activation.

NOTE: This method should be used for dual-channel VMX Resources.

Parameters
ch1The VMXChannelInfo describing the first channel and associated capabilities to route to the VMX Resource
ch2The VMXChannelInfo describing the second channel and associated capabilities to route to the VMX Resource
ch3The VMXChannelInfo describing the third channel and associated capabilities to route to the VMX Resource
ch4The VMXChannelInfo describing the fourth channel and associated capabilities to route to the VMX Resource
res_cfgPointer to the VMXResourceConfig object used to configure the VMX Resource
[out]res_handleThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully activated. If false, the error code will be returned via the errcode parameter.

◆ ActivateResource()

bool VMXIO::ActivateResource ( VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to activate the specified VMXResourceHandle NOTE: VMX Resources can be activated after they have been sucessfully allocated, had VMX Channels routed to them, and (optionally) configured.

Parameters
resourceThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully activate. If false, the error code will be returned via the errcode parameter.

Virtual Counter Configuration

◆ ActivateSinglechannelResource()

bool VMXIO::ActivateSinglechannelResource ( const VMXChannelInfo channel_info,
const VMXResourceConfig res_cfg,
VMXResourceHandle res_handle,
VMXErrorCode *  errcode 
)

Attempts to activate the specified VMXResourceHandle, by first allocating the resource, then routing the specified VMX Channel to it, then applying the specified configuration, and then finally performing resource activation.

NOTE: This method should be used for single-channel VMX Resources.

Parameters
channel_infoThe VMXChannelInfo describing the channel and associated capabilities to route to the VMX Resource
res_cfgPointer to the VMXResourceConfig object used to configure the VMX Resource
[out]res_handleThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully activated. If false, the error code will be returned via the errcode parameter.

◆ AllocateResource()

bool VMXIO::AllocateResource ( VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to allocate the specified VMXResourceHandle.

Parameters
resourceThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully allocated. If false, the error code will be returned via the errcode parameter.

◆ AnalogTrigger_GetState()

bool VMXIO::AnalogTrigger_GetState ( VMXResourceHandle  antrig_res_handle,
AnalogTriggerState state,
VMXErrorCode *  errcode 
)

Returns the current state from a VMX AnalogTrigger Resource.

Parameters
antrig_res_handleHandle to the activated VMX Analog Trigger Resource
[out]stateThe current AnalogTriggerState of the VMX Analog Trigger Resource
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Analog Trigger state was returned. If false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_Allocate()

bool VMXIO::AutoTransmit_Allocate ( AutoTransmitEngineHandle &  engine_handle_out,
VMXErrorCode *  errcode 
)

Creates the AutoTransmit engine, which manages automatic SPI Data Transmission.

NOTE: Only one AutoTransmit Engine instance may be allocated.

Parameters
[out]engine_handle_outHandle to the activate AutoTransmit Engine.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the AutoTransmit Engine was allocated; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_Deallocate()

bool VMXIO::AutoTransmit_Deallocate ( AutoTransmitEngineHandle  engine_handle,
VMXErrorCode *  errcode 
)

Deallocates the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the AutoTransmit Engine was deallocated; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_GetData()

bool VMXIO::AutoTransmit_GetData ( AutoTransmitEngineHandle  engine_handle,
uint8_t *  p_rcv_data,
int32_t  numToRead,
uint32_t  timeout_ms,
int32_t &  num_bytes_remaining,
VMXErrorCode *  errcode 
)

Retrieves data most recently received by the AutoTransmit engine during, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

This function blocks until either numToRead bytes have been read, or a timeout expires. This function may be invoked with a numToRead parameter value of 0, in order to retrieve how many bytes are available without actually copying any data.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
p_rcv_dataPointer to the beginning of the buffer to copy the most recently-received data into.
numToReadMaxinum Number of bytes to transfer into the provided buffer.
timeout_msThe maximum number of milliseconds to wait for data to be available.
num_bytes_remainingThe number of bytes remaining that can be returned after this function completes.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if any data was successfully retrieved; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_GetNumDropped()

bool VMXIO::AutoTransmit_GetNumDropped ( AutoTransmitEngineHandle  engine_handle,
int &  num_dropped,
VMXErrorCode *  errcode 
)

Returns the number of bytes dropped by the AutoTransmit transfer engine due to the receive buffer being full.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
[out]num_droppedThe number of bytes dropped by the AutoTransmit transfer engine because the receive buffer was full.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the Number of Bytes Dropped was successfully returned; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_Immediate()

bool VMXIO::AutoTransmit_Immediate ( AutoTransmitEngineHandle  engine_handle,
VMXErrorCode *  errcode 
)

Forces the AutoTransmit engine to immediately start a Transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the immediate SPI Automatic Transfer was started; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_SetData()

bool VMXIO::AutoTransmit_SetData ( AutoTransmitEngineHandle  engine_handle,
uint8_t *  dataToSend,
int32_t  request_size,
int32_t  reply_size,
VMXErrorCode *  errcode 
)

Registers the Data which will be next sent as part of the currently-active periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
dataToSendaddress of the beginning of the data to be transmitted
request_sizeThe size of the data to be transmitted
reply_sizeThe size of data to be received during the transfer; this value may be 0.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the periodic SPI Automatic Transfer was started; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_StartPeriodic()

bool VMXIO::AutoTransmit_StartPeriodic ( AutoTransmitEngineHandle  engine_handle,
VMXResourceHandle  spi_res_handle,
uint32_t  repeat_every_ms,
VMXErrorCode *  errcode 
)

Begins a periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
spi_res_handleHandle to the SPI Resource with which the periodic SPI transfer will occur
repeat_every_msThe duration (in milliseconds) between each periodic SPI transfer
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the periodic SPI Automatic Transfer was started; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_StartTrigger()

bool VMXIO::AutoTransmit_StartTrigger ( AutoTransmitEngineHandle  engine_handle,
VMXResourceHandle  spi_res_handle,
VMXChannelIndex  input_trigger_channel,
InterruptConfig::InterruptEdge  edge_type,
VMXErrorCode *  errcode 
)

Defines the "start" trigger condition which will initiate a SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
spi_res_handleHandle to the SPI Resource with which the periodic SPI transfer will occur
input_trigger_channelVMXChannelIndex of the trigger source
edge_typeThe InterruptEdge type which will trigger the transfer
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the periodic SPI Automatic Transfer trigger was started; if false, the error code will be returned via the errcode parameter.

◆ AutoTransmit_Stop()

bool VMXIO::AutoTransmit_Stop ( AutoTransmitEngineHandle  engine_handle,
VMXErrorCode *  errcode 
)

Stops any currently-active periodic SPI transfer, managed by the AutoTransmit engine, which manages automatic SPI Data Transmission.

Parameters
engine_handleHandle to the active AutoTransmit Engine.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the periodic SPI Automatic Transfer was stopped; if false, the error code will be returned via the errcode parameter.

◆ ChannelSupportsCapability()

bool VMXIO::ChannelSupportsCapability ( VMXChannelIndex  channel_index,
VMXChannelCapability  capability 
)

Indicates whether the specified VMXChannelIndex supports the specified VMXChannelCapability.

Parameters
channel_indexThe requested VMXChannelIndex
capabilityThe returned VMXChannelCapability
Returns
Returns true if the specified VMXChannelIndex has the specified capabilities

◆ DeactivateResource()

bool VMXIO::DeactivateResource ( VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to deactivate the specified VMXResourceHandle.

This will disable any output activity or input electrical activity - but leave channels routed if any.

Parameters
resourceThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully deactivated. If false, the error code will be returned via the errcode parameter.

◆ DeallocateAllResources()

bool VMXIO::DeallocateAllResources ( VMXErrorCode *  errcode)

Attempts to deallocate all currently-allocated VMXResourceHandles.

Parameters
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if all VMX resources were successfully deallocated. If false, the error code will be returned via the errcode parameter.

◆ DeallocateResource()

bool VMXIO::DeallocateResource ( VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to deallocate the specified VMXResourceHandle.

Parameters
resourceThe requested VMXResourceHandle
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX resource was successfully deallocated. If false, the error code will be returned via the errcode parameter.

◆ DIO_Get()

bool VMXIO::DIO_Get ( VMXResourceHandle  dio_res_handle,
bool &  high,
VMXErrorCode *  errcode 
)

Returns the current signal state from a VMX DigitalIO Resource.

Parameters
dio_res_handleHandle to the activated VMX DigitalIO Resource
[out]hightrue if the signal state is HIGH, false if it is LOW
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid DigitalIO signal state was returned. If false, the error code will be returned via the errcode parameter.

◆ DIO_GetNumPulsing()

bool VMXIO::DIO_GetNumPulsing ( uint8_t &  num_pulsing)

Indicates whether pulsing is underway (not completed) on any DigitalIO Resource in Digital Output mode.

Parameters
num_pulsingThe number of DigitalIO channels on which pulsing is underway
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the "num_pulsing" status was acquired. If false, the error code will be returned via the errcode parameter.

◆ DIO_IsPulsing()

bool VMXIO::DIO_IsPulsing ( VMXResourceHandle  dio_res_handle,
bool &  is_pulsing,
VMXErrorCode *  errcode 
)

Indicates whether a previously-requested pulse is underway (not completed) on a VMX DigitalIO Resource in Digital Output mode.

Parameters
dio_res_handleHandle to the activated VMX DigitalIO Resource
is_pulsingset to true to pulse is active, false otherwise
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the "is pulsing" status was acquired. If false, the error code will be returned via the errcode parameter.

◆ DIO_Pulse()

bool VMXIO::DIO_Pulse ( VMXResourceHandle  dio_res_handle,
bool  high,
uint32_t  num_microseconds,
VMXErrorCode *  errcode 
)

Begins a timed pulse (with the specified level) on a VMX DigitalIO Resource in Digital Output mode.

Note: Pulse periods <= 100 microseconds are highly accurate, and will block for HighCurrDIO/CommDIOs. Pulse periods > 100 microseconds exibit lower timing accuracy, and may take up to 1 millisecond to terminate, however this call will not block.

Parameters
dio_res_handleHandle to the activated VMX DigitalIO Resource
hightrue to pulse HIGH, false to pulse low
num_microsecondsThe duration of the pulse.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the DigitalIO pulse was initiated. If false, the error code will be returned via the errcode parameter.

◆ DIO_Set()

bool VMXIO::DIO_Set ( VMXResourceHandle  dio_res_handle,
bool  high,
VMXErrorCode *  errcode 
)

Sets the current signal state of a VMX DigitalIO Resource in Digital Output mode.

Parameters
dio_res_handleHandle to the activated VMX DigitalIO Resource
hightrue to set the signal state HIGH, false to set it to LOW
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the DigitalIO signal state was modified. If false, the error code will be returned via the errcode parameter.

◆ Encoder_GetCount()

bool VMXIO::Encoder_GetCount ( VMXResourceHandle  encoder_res_handle,
int32_t &  count,
VMXErrorCode *  errcode 
)

Returns the current Encoder count value from a VMX Encoder Resource.

Parameters
encoder_res_handleHandle to the activated VMX Encoder Resource
[out]countCurrent encoder count value, which may be negative or positive.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Encoder count value was returned. If false, the error code will be returned via the errcode parameter.

◆ Encoder_GetDirection()

bool VMXIO::Encoder_GetDirection ( VMXResourceHandle  encoder_res_handle,
EncoderDirection direction,
VMXErrorCode *  errcode 
)

Returns the current EncoderDirection value from a VMX Encoder Resource.

Parameters
encoder_res_handleHandle to the activated VMX Encoder Resource
[out]directionCurrent encoder direction
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Encoder direction was returned. If false, the error code will be returned via the errcode parameter.

◆ Encoder_GetLastPulsePeriodMicroseconds()

bool VMXIO::Encoder_GetLastPulsePeriodMicroseconds ( VMXResourceHandle  encoder_res_handle,
uint16_t &  encoder_curr_avg_pulse_period_microseconds,
VMXErrorCode *  errcode 
)

Returns the average period (in microseconds) of the most recent encoder pulses captured by a VMX Encoder Resource.

The period over which averaging occurs is approximately the last 50 microseconds.

For all encoding types (x4, x2, x1), this represents the active "high" period of the "A source" signal.

Parameters
encoder_res_handleHandle to the activated VMX Encoder Resource
[out]encoder_curr_avg_pulse_period_microsecondsCurrent avg pulse period (microseconds)
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Encoder direction was returned. If false, the error code will be returned via the errcode parameter.

◆ Encoder_Reset()

bool VMXIO::Encoder_Reset ( VMXResourceHandle  encoder_res_handle,
VMXErrorCode *  errcode 
)

Sets the VMX Encoder Resource's count value to 0.

Parameters
encoder_res_handleHandle to the activated VMX Encoder Resource
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the Encoder count was reset to 0. If false, the error code will be returned via the errcode parameter.

◆ ExpireWatchdogNow()

bool VMXIO::ExpireWatchdogNow ( VMXErrorCode *  errcode)

Forces the IO Watchdog to immediately disable all managed outputs.

Any active PWM Generators are set to output one final period with a low signal before the managed outputs are disabled, to ensure that a truncated pulse is not generated. In this case, a delay of up to the longest PWM frequency is inserted before all managed outputs are disabled, causing the current thread to be blocked for that period of time.

Parameters
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if all IO Watchdog managed outputs were disabled; if false, the error code will be returned via the errcode parameter.

◆ FeedWatchdog()

bool VMXIO::FeedWatchdog ( VMXErrorCode *  errcode)

"Feeds" the IO Watchdog.

All outputs managed by the IO Watchdog will be automatically disabled if "FeedWatchdog()" is not regularly invoked once every IO Watchdog Timeout Period.

Parameters
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog was fed; if false, the error code will be returned via the errcode parameter.

◆ GetChannelCapabilities()

bool VMXIO::GetChannelCapabilities ( VMXChannelIndex  channel_index,
VMXChannelType channel_type,
VMXChannelCapability capability_bits 
)

Returns the VMXChannelType and VMXChannelCapability for the specified VMXChannelIndex.

Parameters
channel_indexThe requested VMXChannelIndex
[out]channel_typeThe returned VMXChannelType
[out]capability_bitsThe return VMXChannelCapability. Note that multiple capability bits may be set.
Returns
Returns true if a VMXChannelIndex matching the specified parameters was found.

◆ GetChannelsCompatibleWithResource()

bool VMXIO::GetChannelsCompatibleWithResource ( VMXResourceHandle  resource_handle,
VMXChannelIndex first_channel_index,
uint8_t &  num_channels 
)

Returns a list of VMXChannelIndexes which are compatible with the specified VMXResourceHandle.

Parameters
resource_handleThe requested VMXResourceHandle.
[out]first_channel_indexThe first VMXChannelIndex compatible with the specified VMXResourceHandle
[out]num_channelsThe number of VMXChannels compatible with the specified VMXResourceHandle
Returns
Returns true if any matching VMX Channels were identified based on the input parameters. If false, the error code will be returned via the errcode parameter.

◆ GetNumChannelsByCapability()

uint8_t VMXIO::GetNumChannelsByCapability ( VMXChannelCapability  channel_capability)

Returns the number of VMX Channels of the specified VMXChannelCapability.

Parameters
channel_capabilityThe requested VMXChannelCapability.
Returns
The number of VNX Resources with the specified capability.

◆ GetNumChannelsByType()

uint8_t VMXIO::GetNumChannelsByType ( VMXChannelType  channel_type,
VMXChannelIndex first_channel_index 
)

Returns the number of VMX Channels of the specified VMXChannelType.

Parameters
channel_typeThe requested VMXChannelType.
first_channel_indexThe first VMXChannelIndex of the requested type.
Returns
The number of VNX Resources with the specified capability.

◆ GetNumResourcesByType()

uint8_t VMXIO::GetNumResourcesByType ( VMXResourceType  resource_type)

Returns the number of VMX Resources of the specified VMXResourceType.

Parameters
resource_typeThe requested VMXResourceType.
Returns
The number of VMX Resources of the specified type.

◆ GetResourceConfig()

bool VMXIO::GetResourceConfig ( VMXResourceHandle  resource,
VMXResourceConfig *&  p_config,
VMXErrorCode *  errcode 
)

Gets the configuration of the specified VMXResourceHandle.

Parameters
resourceThe VMXResourceHandle to acquire configuration from
p_configPointer to the VMXResourceConfig object which will contain the retrieved configuration
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the configuration data was retrieved from the VMX Resource. If false, the error code will be returned via the errcode parameter.

◆ GetResourceFromRoutedChannel()

bool VMXIO::GetResourceFromRoutedChannel ( VMXChannelIndex  channel_index,
VMXResourceHandle res_handle_out,
VMXErrorCode *  errcode 
)

Retrieves the VMXResourceHandle (if any) to which the specified VMXChannelIndex is routed.

Parameters
channel_indexThe index of the VMXChannel to query
[out]res_handle_outThe VMXResourceHandle VMXResourceHandle of the resource to which the queried channel_index is routed.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the queried channel_index is routed to a VMX resource. If false, the channel_index is not currently routed to any resource.

◆ GetResourceHandle()

bool VMXIO::GetResourceHandle ( VMXResourceType  resource_type,
VMXResourceIndex  res_index,
VMXResourceHandle resource_handle,
VMXErrorCode *  errcode 
)

Returns the VMXResourceHandle of the VMX Resource identified by the specified VMXResourceType and VMXResourceIndex.

Parameters
resource_typeThe requested VMXResourceType.
res_indexThe requested VMXResourceIndex.
[out]resource_handleThe returned VMXResourceHandle, if successful
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a matching VMXResource was identifed based on the input parameters. If false, the error code will be returned via the errcode parameter.

◆ GetSoleChannelIndex()

VMXChannelIndex VMXIO::GetSoleChannelIndex ( VMXChannelCapability  capability)

Returns the VMXChannelIndex for the single channel which implements the specified capability.

If no channels implement this capability, or if more than one channel implements this capability, VMX_INVALID_CHANNEL_INDEX is returned.

◆ GetWatchdogEnabled()

bool VMXIO::GetWatchdogEnabled ( bool &  enabled,
VMXErrorCode *  errcode 
)

Returns whether the IO Watchdog is currently enabled.

Parameters
[out]enabledreturns True if the IO Watchdog is enabled, false otherwise.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog enabled state was successfully returned; if false, the error code will be returned via the errcode parameter.

◆ GetWatchdogExpired()

bool VMXIO::GetWatchdogExpired ( bool &  expired,
VMXErrorCode *  errcode 
)

Returns whether the IO Watchdog is expired.

Parameters
[out]expiredreturns True if the IO Watchdog is expired, false otherwise.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog expired state was successfully returned; if false, the error code will be returned via the errcode parameter.

◆ GetWatchdogManagedOutputs()

bool VMXIO::GetWatchdogManagedOutputs ( bool &  flexdio,
bool &  hicurrdio,
bool &  commdio,
VMXErrorCode *  errcode 
)

Returns which output groups are managed by the IO Watchdog.

Parameters
[out]flexdioreturns True the FlexDIO output is managed by the IO Watchdog.
[out]hicurrdioreturns True the HighCurrentDIO output is managed by the IO Watchdog.
[out]commdioreturns True the CommDIO output is managed by the IO Watchdog.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog managed output states were successfully returned; if false, the error code will be returned via the errcode parameter.

◆ GetWatchdogTimeoutPeriodMS()

bool VMXIO::GetWatchdogTimeoutPeriodMS ( uint16_t &  timeout_period_ms,
VMXErrorCode *  errcode 
)

Returns the IO Watchdog timeout period.

All outputs managed by the IO Watchdog will be automatically disabled if "FeedWatchdog()" is not regularly invoked at this frequency.

Parameters
[out]timeout_period_msThe current IO Watchdog timeout period, in milliseconds.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog timeout period was successfully returned; if false, the error code will be returned via the errcode parameter.

◆ I2C_Read()

bool VMXIO::I2C_Read ( VMXResourceHandle  i2c_res_handle,
uint8_t  deviceAddress,
uint8_t  register_address,
uint8_t *  buffer,
int32_t  count,
VMXErrorCode *  errcode 
)

Reads data from the specified VMX I2C Resource.

NOTE: This is a blocking call.

Parameters
i2c_res_handleHandle to the activated VMX I2C Resource
deviceAddress7-bit I2C address of the I2C device
bufferPointer to the buffer into which received data is placed
countNumber of bytes to receive
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was received via the I2C interface. If false, the error code will be returned via the errcode parameter.

◆ I2C_Transaction()

bool VMXIO::I2C_Transaction ( VMXResourceHandle  i2c_res_handle,
uint8_t  deviceAddress,
uint8_t *  dataToSend,
uint16_t  sendSize,
uint8_t *  dataReceived,
uint16_t  receiveSize,
VMXErrorCode *  errcode 
)

Writes and/or Reads data to/from the specified VMX I2C Resource.

If both writing and reading are requested, the write occurs first before the read. NOTE: This is a blocking call.

Parameters
i2c_res_handleHandle to the activated VMX I2c Resource
deviceAddress7-bit I2C address of the I2C device
dataToSendPointer to the buffer of data to be sent to the SPI resource This parameter value should be NULL if writing should not occur.
sendSizeNumber of bytes to send. The dataToSend parameter must point to a buffer whose length is at least this value. This value should be 0 if writing should not occur.
dataReceivedPointer to the buffer into which receive data read from the SPI resource. This parameter value should be NULL if reading should not occur.
receiveSizeNumber of bytes to receive. The dataReceived parameter must point to a buffer whose length is at least this value. This parameter value should be 0 if reading should not occur.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was successfully transmitted/received via the I2C interface. If false, the error code will be returned via the errcode parameter.

◆ I2C_Write()

bool VMXIO::I2C_Write ( VMXResourceHandle  i2c_res_handle,
uint8_t  deviceAddress,
uint8_t  register_address,
uint8_t *  dataToSend,
int32_t  sendSize,
VMXErrorCode *  errcode 
)

Writes the specified data to the specified VMX I2C Resource.

NOTE: This is a blocking call.

Parameters
i2c_res_handleHandle to the activated VMX I2C Resource
deviceAddress7-bit I2C address of the I2C device
dataToSendPointer to the buffer of data to be sent
sendSizeNumber of bytes to send
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was transmitted via the I2C interface. If false, the error code will be returned via the errcode parameter.

◆ InputCapture_GetChannelCounts()

bool VMXIO::InputCapture_GetChannelCounts ( VMXResourceHandle  inputcap_res_handle,
uint32_t &  chan1_counts,
uint32_t &  chan2_counts,
VMXErrorCode *  errcode 
)

Returns the current Capture count values from a VMX Input Capture Resource.

Parameters
inputcap_res_handleHandle to the activated VMX Input Capture Resource
[out]chan1_countsCurrent Input Capture Channel 1 counts (unitless)
[out]chan2_countsCurrent Input Capture Channel 2 counts (unitless)
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Input Capture count value was returned. If false, the error code will be returned via the errcode parameter.

◆ InputCapture_InputStatus()

bool VMXIO::InputCapture_InputStatus ( VMXResourceHandle  inputcap_res_handle,
bool &  forward_direction,
bool &  active,
VMXErrorCode *  errcode 
)

Retrieves the status of the InputCapture Resource, including the "forward direction" and "active" states.

Parameters
inputcp_res_handleHandle to the activated VMX InputCapture Resource
[out]forward_directionTrue if the InputCapture Resource is rotating in a forward direction, false if in a reverse direction.
[out]activeTrue if the InputCapture Resource has recently detected activity (e.g., change in count due to rotation)
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the Encoder count was reset to 0. If false, the error code will be returned via the errcode parameter.

◆ InputCapture_Reset()

bool VMXIO::InputCapture_Reset ( VMXResourceHandle  inputcap_res_handle,
VMXErrorCode *  errcode 
)

Sets the VMX InputCapture Resource's count value to 0.

Parameters
inputcp_res_handleHandle to the activated VMX InputCapture Resource
[out]errcodePointer to the VMXErrorCode to be returned in case of
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the Encoder count was reset to 0. If false, the error code will be returned via the errcode parameter.

◆ IsResourceActive()

bool VMXIO::IsResourceActive ( VMXResourceHandle  resource,
bool &  active,
VMXErrorCode *  errcode 
)

Indicates whether the specified VMXResourceHandle is currently active.

Parameters
resourceThe requested VMXResourceHandle
[out]activetrue if the VMX Resource is currently active
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if resource activation information was successfully returned. If false, the error code will be returned via the errcode parameter.

◆ IsResourceAllocated()

bool VMXIO::IsResourceAllocated ( VMXResourceHandle  resource,
bool &  allocated,
bool &  is_shared,
VMXErrorCode *  errcode 
)

Indicates whether the specified VMXResourceHandle is currently allocated, and whether it is a shared resource.

Parameters
resourceThe requested VMXResourceHandle
[out]allocatedtrue if the VMX Resource is currently allocated
[out]is_sharedtrue if the VMX Resource is currently allocated in "shared" mode
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if resource allocation information was successfully returned. If false, the error code will be returned via the errcode parameter.

◆ LEDArray_Configure()

bool VMXIO::LEDArray_Configure ( VMXResourceHandle  led_array_resource_handle,
LEDArray_OneWireConfig config,
VMXErrorCode *  errcode 
)

Updates the LEDArray Configuration with the parameters specified in the LEDArray_OneWireConfig object.

NOTE: All configuration changes must be made before the first invocation of LEDArray_Render(). Once rendering has started, configuration changes are no longer allowed.

Parameters
led_array_resource_handleVMXResourceHandle of the currently allocated LEDArray Driver Resource.
configThe LEDArray_OneWireConfig object containing the parameters with which to configure the LEDArray.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the RGB Value for the specified pixel was successfully configured; if false, the error code will be returned via the errcode parameter.

◆ LEDArray_Render()

bool VMXIO::LEDArray_Render ( VMXResourceHandle  led_array_resource_handle,
VMXErrorCode *  errcode 
)

Immediately begins transmitting all RGBValues in the LEDArrayBuffer currently registered with the specified LEDArray.

Parameters
led_array_resource_handleVMXResourceHandle of the currently allocated LEDArray Driver Resource. During the rendering, the caller will block. The LEDArrayBuffer may be accessed (e.g., via LEDArrayBuffer_SetRGBValue) during the rendering, however there is no guarantee if whether any modifications made during this period will be transmitted during the current call to LEDArray_Render().
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the RGB Value for the specified pixel was successfully retrieved; if false, the error code will be returned via the errcode parameter.

◆ LEDArray_SetBuffer()

bool VMXIO::LEDArray_SetBuffer ( VMXResourceHandle  led_array_resource_handle,
LEDArrayBufferHandle  buffer_handle,
VMXErrorCode *  errcode 
)

Registers the specified LEDArrayBuffer with the specified LEDArray.

Once registered, the underlying LEDArray hardware will be updated using the RGB Values contained within the LEDArrayBuffer.

Parameters
indexThe index of the pixel to access within the LEDArray. This index must be less than the size of the LEDArrayBuffer.
[out]redThe intensity value of the Red component of the RGB triplet for the specified pixel.
[out]greenThe intensity value of the Green component of the RGB triplet for the specified pixel.
[out]blueThe intensity value of the Blue component of the RGB triplet for the specified pixel.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the RGB Value for the specified pixel was successfully retrieved; if false, the error code will be returned via the errcode parameter.

◆ LEDArrayBuffer_Create()

bool VMXIO::LEDArrayBuffer_Create ( int  n_pixels,
LEDArrayBufferHandle &  buffer_handle_out,
VMXErrorCode *  errcode 
)

Creates a new LEDArrayBuffer, which can be later transmitted via a LEDArray resource.

Each LEDArrayBuffer contains a number of RGB Values, which can be accessed via various LEDArrayBuffer functions.

Parameters
n_pixelsThe number of "pixels" (RGB values) to be contained within the newly-created buffer.
[out]buffer_handle_outAn opaque handle to the newly-created LEDArrayBuffer.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a new LEDArrayBuffer was created; if false, the error code will be returned via the errcode parameter.

◆ LEDArrayBuffer_Delete()

bool VMXIO::LEDArrayBuffer_Delete ( LEDArrayBufferHandle  buffer_handle,
VMXErrorCode *  errorcode 
)

Deallocates a previously-created LEDArrayBuffer.

All memory associated with the LEDArrayBuffer will be deallocated. contains a number of RGB Values, which can be accessed via various LEDArrayBuffer functions. If this buffer had been previously associated with an LEDArray (via LEDArray_SetBuffer()), it will be automatically disasociated from the LEDArray at this time.

Parameters
n_pixelsThe number of "pixels" (RGB values) to be contained within the newly-created buffer.
[out]buffer_handle_outAn opaque handle to the newly-created LEDArrayBuffer.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a new LEDArrayBuffer was created; if false, the error code will be returned via the errcode parameter.

◆ LEDArrayBuffer_GetLength()

bool VMXIO::LEDArrayBuffer_GetLength ( LEDArrayBufferHandle  buffer_handle,
int &  length_out,
VMXErrorCode *  errcode 
)

Returns the length (in "pixels") of the LEDArrayBuffer.

Parameters
[out]length_outThe number of RGB Values (one for each "pixel") represented by the LEDArrayBuffer.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the length of the LEDArrayBuffer was successfully retrieved; if false, the error code will be returned via the errcode parameter.

◆ LEDArrayBuffer_GetRBGValue()

bool VMXIO::LEDArrayBuffer_GetRBGValue ( LEDArrayBufferHandle  buffer_handle,
int  index,
int &  red,
int &  green,
int &  blue,
VMXErrorCode *  errcode 
)

Returns the current RGB value for a particular "pixel" index within the LEDArrayBuffer.

Parameters
indexThe index of the pixel to access within the LEDArray. This index must be less than the size of the LEDArrayBuffer.
[out]redThe intensity value of the Red component of the RGB triplet for the specified pixel.
[out]greenThe intensity value of the Green component of the RGB triplet for the specified pixel.
[out]blueThe intensity value of the Blue component of the RGB triplet for the specified pixel.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the RGB Value for the specified pixel was successfully retrieved; if false, the error code will be returned via the errcode parameter.

◆ LEDArrayBuffer_SetRGBValue()

bool VMXIO::LEDArrayBuffer_SetRGBValue ( LEDArrayBufferHandle  buffer_handle,
int  index,
int  red,
int  green,
int  blue,
VMXErrorCode *  errcode 
)

Modifies the RGB value for a particular "pixel" index within the LEDArrayBuffer.

Parameters
indexThe index of the pixel to modify within the LEDArray. This index must be less than the size of the LEDArrayBuffer.
redThe intensity value of the Red component of the RGB triplet for the specified pixel.
greenThe intensity value of the Green component of the RGB triplet for the specified pixel.
blueThe intensity value of the Blue component of the RGB triplet for the specified pixel.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the RGB Value for the specified pixel was successfully modified; if false, the error code will be returned via the errcode parameter.

◆ PWMCapture_GetCount()

bool VMXIO::PWMCapture_GetCount ( VMXResourceHandle  inputcap_res_handle,
uint32_t &  frequency_us,
uint32_t &  duty_cycle_us,
VMXErrorCode *  errcode 
)

Returns the current Capture count values from a VMX Input Capture Resource that has been configured for PWMCapture mode (see PWMCaptureConfig class).

Parameters
inputcap_res_handleHandle to the activated VMX Input Capture Resource
[out]frequency_usCurrent Input Capture frequency period, in microseconds
[out]duty_cycle_usCurrent Input Capture duty cycle period, in microseconds
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if a valid Input Capture count value was returned. If false, the error code will be returned via the errcode parameter.

◆ PWMGenerator_GetDutyCycle()

bool VMXIO::PWMGenerator_GetDutyCycle ( VMXResourceHandle  pwmgen_res_handle,
VMXResourcePortIndex  port_index,
uint16_t *  p_duty_cycle,
VMXErrorCode *  errcode 
)

Gets the VMX PWM Generator Resource's current Duty Cycle value.

Parameters
pwmgen_res_handleHandle to the activated VMX PWM Generator Resource
port_indexVMXResourcePortIndex of the port on the VMX PWM Generator Resource to modify
duty_cyclePointer to the PWM Generator Resource's Duty Cycle value, which will be returned from this function. This will be a value from 0 to MaxDutyCycleValue (which was previously configured via PWMGeneratorConfig).
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null. To convert this duty cycle value to the amount of "active" time (the PWM Pulse Length) multiply the duty cycle times 1 second / PWM Frequency (Hz) / (max_duty_cycle + 1). E.g., at 200Hz PWM Frequency a duty_cycle of 10 with a max duty cycle of 255 = 10 * 1/200/(255+1) = .000195 seconds = 195 microseconds.
Returns
Returns true if the Encoder count was reset to 0. If false, the error code will be returned via the errcode parameter.

◆ PWMGenerator_SetDutyCycle()

bool VMXIO::PWMGenerator_SetDutyCycle ( VMXResourceHandle  pwmgen_res_handle,
VMXResourcePortIndex  port_index,
uint16_t  duty_cycle,
VMXErrorCode *  errcode 
)

Sets the VMX PWM Generator Resource's Duty Cycle to the specified value.

Parameters
pwmgen_res_handleHandle to the activated VMX PWM Generator Resource
port_indexVMXResourcePortIndex of the port on the VMX PWM Generator Resource to modify
duty_cycleThe VMX PWM Generator Resource's Duty Cycle value, which must be in the range 0-MaxDutyCycleValue (which was previously configured via PWMGeneratorConfig). To convert this duty cycle value to the amount of "active" time (the PWM Pulse Length) multiply the duty cycle times 1 second / PWM Frequency (Hz) / (max_duty_cycle + 1). E.g., at 200Hz PWM Frequency a duty_cycle of 10 with a max duty cycle of 255 = 10 * 1/200/(255+1) = .000195 seconds = 195 microseconds.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the Encoder count was reset to 0. If false, the error code will be returned via the errcode parameter.

◆ RouteChannelToResource()

bool VMXIO::RouteChannelToResource ( VMXChannelIndex  channel_index,
VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to route the specified VMXChannelIndex to the allocated VMXResourceHandle Note: If the resource requires multiple channels to be allocated to the resource, all channels are routed when the first channel is routed.

Parameters
channel_indexThe VMXChannelIndex to route to the resource
resourceThe VMXResourceHandle to which the VMXChannel should be routed
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX Channel was routed to the VMX resource. If false, the error code will be returned via the errcode parameter.

◆ SetResourceConfig()

bool VMXIO::SetResourceConfig ( VMXResourceHandle  resource,
const VMXResourceConfig p_config,
VMXErrorCode *  errcode 
)

Sets the configuration to the specified VMXResourceHandle.

NOTE: VMX Resources can only be configured after they are allocated and before they are activated.

Parameters
resourceThe VMXResourceHandle to be configured
p_configPointer to the VMXResourceConfig object used to configure the VMX Resource
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if all VMX Channels were unrouted from the VMX resource. If false, the error code will be returned via the errcode parameter.

◆ SetWatchdogEnabled()

bool VMXIO::SetWatchdogEnabled ( bool  enabled,
VMXErrorCode *  errcode 
)

Changes the IO Watchdog enabled state.

Parameters
[out]enabledreturns True if the IO Watchdog should be enabled, false if it should be disabled.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog enabled state was successfully returned; if false, the error code will be returned via the errcode parameter.

◆ SetWatchdogManagedOutputs()

bool VMXIO::SetWatchdogManagedOutputs ( bool  flexdio,
bool  hicurrdio,
bool  commdio,
VMXErrorCode *  errcode 
)

Configures which output groups are managed by the IO Watchdog.

Parameters
flexdioIf True, the FlexDIO output is managed by the IO Watchdog.
hicurrdioIf True, the HighCurrentDIO output is managed by the IO Watchdog.
commdioIf True, the CommDIO output is managed by the IO Watchdog.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog managed output states were successfully modified; if false, the error code will be returned via the errcode parameter.

◆ SetWatchdogTimeoutPeriodMS()

bool VMXIO::SetWatchdogTimeoutPeriodMS ( uint16_t  timeout_period_ms,
VMXErrorCode *  errcode 
)

Configures the IO Watchdog timeout period.

All outputs managed by the IO Watchdog will be automatically disabled if "FeedWatchdog()" is not regularly invoked at this frequency.

Parameters
timeout_period_msThe IO Watchdog timeout period, in milliseconds.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the IO Watchdog timeout period was successfully modified; if false, the error code will be returned via the errcode parameter.

◆ SPI_Read()

bool VMXIO::SPI_Read ( VMXResourceHandle  spi_res_handle,
uint8_t *  p_rcv_data,
uint16_t  size,
VMXErrorCode *  errcode 
)

Reads data from the specified VMX SPI Resource.

Parameters
spi_res_handleHandle to the activated VMX SPI Resource
p_rcv_dataPointer to the buffer into which to receive data, which must be at least the size specified via the max_size parameter
sizeThe number of bytes to receive. The buffer pointed to by p_data must be large enough to hold at least this number of bytes
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the SPI data was received. If false, the error code will be returned via the errcode parameter.

◆ SPI_Transaction()

bool VMXIO::SPI_Transaction ( VMXResourceHandle  spi_res_handle,
uint8_t *  p_send_data,
uint8_t *  p_rcv_data,
uint16_t  size,
VMXErrorCode *  errcode 
)

Simultaneously Writes/Reads data to/from the specified VMX SPI Resource.

NOTE: This is a blocking call.

Parameters
spi_res_handleHandle to the activated VMX SPI Resource
p_send_dataPointer to the buffer of data to be sent to the SPI resource
p_rcv_dataPointer to the buffer into which receive data read from the SPI resource
sizeNumber of bytes to send/receive
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was transmitted/received via the SPI interface. If false, the error code will be returned via the errcode parameter.

◆ SPI_Write()

bool VMXIO::SPI_Write ( VMXResourceHandle  spi_res_handle,
uint8_t *  p_send_data,
uint16_t  size,
VMXErrorCode *  errcode 
)

Writes the specified data to the specified VMX SPI Resource.

NOTE: This is a blocking call.

Parameters
spi_res_handleHandle to the activated VMX SPI Resource
p_send_dataPointer to the buffer of data to be sent
sizeNumber of bytes to send
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was transmitted via the SPI interface. If false, the error code will be returned via the errcode parameter.

◆ UART_GetBytesAvailable()

bool VMXIO::UART_GetBytesAvailable ( VMXResourceHandle  reshandle,
uint16_t &  size,
VMXErrorCode *  errcode 
)

Returns the number of data bytes which have been received from VMX UART Resource.

Parameters
reshandleHandle to the activated VMX UART Resource
sizeThe number of received data bytes, which can be read via the VMXIO::UART_Read() method.
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the number of availble UART data bytes was returned. If false, the error code will be returned via the errcode parameter.

◆ UART_Read()

bool VMXIO::UART_Read ( VMXResourceHandle  reshandle,
uint8_t *  p_data,
uint16_t  max_size,
uint16_t &  actual_num_bytes_read,
VMXErrorCode *  errcode 
)

Reads data from the specified VMX UART Resource.

Parameters
reshandleHandle to the activated VMX UART Resource
p_dataPointer to the buffer into which to receive data, which must be at least the size specified via the max_size parameter
max_sizeThe maximum number of bytes to receive. The buffer pointed to by p_data must be large enough to hold at least this number of bytes
[out]actual_num_bytes_readThe actual number of bytes read into the buffer pointed to by p_data
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the UART data was returned. If false, the error code will be returned via the errcode parameter.

◆ UART_Write()

bool VMXIO::UART_Write ( VMXResourceHandle  reshandle,
uint8_t *  p_data,
uint16_t  size,
VMXErrorCode *  errcode 
)

Writes the specified data to the specified VMX UART Resource.

NOTE: This is a blocking call.

Parameters
reshandleHandle to the activated VMX UART Resource
p_dataPointer to the buffer of data to be sent
sizeNumber of bytes to send
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the data was transmitted via the UART. If false, the error code will be returned via the errcode parameter.

◆ UnrouteAllChannelsFromResource()

bool VMXIO::UnrouteAllChannelsFromResource ( VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to unroute all VMX Channels from the allocated VMXResourceHandle.

Parameters
resourceThe VMXResourceHandle to which the VMXChannel should be unrouted
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if all VMX Channels were unrouted from the VMX resource. If false, the error code will be returned via the errcode parameter.

◆ UnrouteChannelFromResource()

bool VMXIO::UnrouteChannelFromResource ( VMXChannelIndex  channel_index,
VMXResourceHandle  resource,
VMXErrorCode *  errcode 
)

Attempts to unroute the specified VMXChannelIndex from the allocated VMXResourceHandle.

Parameters
channel_indexThe VMXChannelIndex to unroute from the resource
resourceThe VMXResourceHandle to which the VMXChannel should be unrouted
[out]errcodePointer to the VMXErrorCode to be returned in case of error; may be null
Returns
Returns true if the VMX Channel was unrouted from the VMX resource. If false, the error code will be returned via the errcode parameter.

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