VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
|
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... | |
bool | GetResourceHandle (VMXResourceType resource_type, VMXResourceIndex res_index, VMXResourceHandle &resource_handle, VMXErrorCode *errcode=0) |
Returns the VMXResourceHandle of the VMX Resource identified by the specified VMXResourceType and VMXResourceIndex. More... | |
bool | GetResourcesCompatibleWithChannelAndCapability (VMXChannelIndex channel_index, VMXChannelCapability capability, std::list< VMXResourceHandle > &compatible_res_handles) |
Returns a list of VMXResourceHandles which are compatible with the specified VMXChannelIndex and VMXChannelCapability. More... | |
bool | GetUnallocatedResourcesCompatibleWithChannelAndCapability (VMXChannelIndex channel_index, VMXChannelCapability capability, std::list< VMXResourceHandle > &unallocated_compatible_res_handles) |
Returns a list of unallocated VMXResourceHandles which are compatible with the specified VMXChannelIndex and VMXChannelCapability. 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 | IsResourceAllocated (VMXResourceHandle resource, bool &allocated, bool &is_shared, VMXErrorCode *errcode=0) |
Indicates whether the specified VMXResourceHandle is currently allocated, and whether it is a shared resource. More... | |
bool | AllocateResource (VMXResourceHandle resource, VMXErrorCode *errcode=0) |
Attempts to allocate the specified VMXResourceHandle. More... | |
bool | DeallocateResource (VMXResourceHandle resource, VMXErrorCode *errcode=0) |
Attempts to deallocate the specified VMXResourceHandle. More... | |
bool | DeallocateAllResources (VMXErrorCode *last_errorcode=0) |
Attempts to deallocate all currently-allocated VMXResourceHandles. More... | |
bool | RouteChannelToResource (VMXChannelIndex channel, VMXResourceHandle resource, VMXErrorCode *errcode=0) |
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=0) |
Attempts to unroute the specified VMXChannelIndex from the allocated VMXResourceHandle. More... | |
bool | UnrouteAllChannelsFromResource (VMXResourceHandle resource, VMXErrorCode *errcode=0) |
Attempts to unroute all VMX Channels from the allocated VMXResourceHandle. More... | |
bool | SetResourceConfig (VMXResourceHandle resource, const VMXResourceConfig *p_config, VMXErrorCode *errcode=0) |
Sets the configuration to the specified VMXResourceHandle. More... | |
bool | GetResourceConfig (VMXResourceHandle resource, VMXResourceConfig *&p_config, VMXErrorCode *errcode=0) |
Gets the configuration of the specified VMXResourceHandle. More... | |
bool | GetResourceDefaultConfig (VMXResourceHandle resource, VMXResourceConfig *&p_config, VMXErrorCode *errcode=0) |
Gets the default configuration of the specified VMXResourceHandle. More... | |
bool | IsResourceActive (VMXResourceHandle, bool &active, VMXErrorCode *errcode=0) |
Indicates whether the specified VMXResourceHandle is currently active. More... | |
bool | ActivateResource (VMXResourceHandle resource, VMXErrorCode *errcode=0) |
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=0) |
Attempts to deactivate the specified VMXResourceHandle. More... | |
bool | ActivateSinglechannelResource (VMXChannelIndex channel_index, VMXChannelCapability channel_capability, VMXResourceHandle &res_handle, const VMXResourceConfig *res_cfg=0, VMXErrorCode *errcode=0) |
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 | ActivateMultichannelResource (uint8_t num_channels, VMXChannelIndex *p_channel_indexes, VMXChannelCapability *p_channel_capabilities, VMXResourceHandle &res_handle, const VMXResourceConfig *res_cfg=0, VMXErrorCode *errcode=0) |
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=0) |
Returns the current signal state from a VMX DigitalIO Resource. More... | |
bool | DIO_Set (VMXResourceHandle dio_res_handle, bool high, VMXErrorCode *errcode=0) |
Sets the current signal state of a VMX DigitalIO Resource in Digital Output mode. More... | |
bool | PWMGenerator_SetDutyCycle (VMXResourceHandle pwmgen_res_handle, VMXResourcePortIndex port_index, uint8_t duty_cycle, VMXErrorCode *errcode=0) |
Sets the VMX PWM Generator Resource's Duty Cycle to the specified value. More... | |
bool | PWMCapture_GetCount (VMXResourceHandle pwmcap_res_handle, int32_t &count, VMXErrorCode *errcode=0) |
bool | Encoder_GetCount (VMXResourceHandle encoder_res_handle, int32_t &count, VMXErrorCode *errcode=0) |
Returns the current Encoder count value from a VMX Encoder Resource. More... | |
bool | Encoder_GetDirection (VMXResourceHandle encoder_res_handle, EncoderDirection &direction, VMXErrorCode *errcode=0) |
Returns the current EncoderDirection value from a VMX Encoder Resource. More... | |
bool | Encoder_Reset (VMXResourceHandle encoder_res_handle, VMXErrorCode *errcode=0) |
Sets the VMX Encoder Resource's count value to 0. More... | |
bool | Accumulator_GetOversampleValue (VMXResourceHandle accum_res_handle, uint32_t &oversample_value, VMXErrorCode *errcode=0) |
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=0) |
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=0) |
Returns the current instantaneous (non-averaged) value from a VMX Analog Accumulator Resource. More... | |
bool | Accumulator_GetFullScaleVoltage (float &full_scale_voltage, VMXErrorCode *errcode=0) |
Returns the current VMX Analog Input full-scale voltage level. More... | |
bool | Accumulator_GetAverageVoltage (VMXResourceHandle accum_res_handle, float &average_value, VMXErrorCode *errcode=0) |
Returns the current averaged value in voltage units from a VMX Analog Accumulator Resource. More... | |
bool | AnalogTrigger_GetState (VMXResourceHandle antrig_res_handle, AnalogTriggerState &state, VMXErrorCode *errcode=0) |
Returns the current state from a VMX AnalogTrigger Resource. More... | |
bool | UART_Write (VMXResourceHandle uart_res_handle, uint8_t *p_data, uint16_t size, VMXErrorCode *errcode=0) |
Writes the specified data to the specified VMX UART Resource. More... | |
bool | UART_Read (VMXResourceHandle uart_res_handle, uint8_t *p_data, uint16_t max_size, uint16_t &actual_size_read, VMXErrorCode *errcode=0) |
Reads data from the specified VMX UART Resource. More... | |
bool | UART_GetBytesAvailable (VMXResourceHandle uart_es_handle, uint16_t &size, VMXErrorCode *errcode=0) |
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=0) |
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=0) |
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=0) |
Simultaneously Writes/Reads data to/from the specified VMX SPI Resource. More... | |
bool | I2C_Write (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t *dataToSend, int32_t sendSize, VMXErrorCode *errcode=0) |
Writes the specified data to the specified VMX I2C Resource. More... | |
bool | I2C_Read (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t *buffer, int32_t count, VMXErrorCode *errcode=0) |
Reads data from the specified VMX I2C Resource. More... | |
bool | I2C_Transaction (VMXResourceHandle i2c_res_handle, uint8_t deviceAddress, uint8_t *dataToSend, uint16_t sendSize, uint8_t *dataReceived, uint16_t receiveSize, VMXErrorCode *errcode=0) |
Simultaneously Writes/Reads data to/from the specified VMX I2C Resource. More... | |
Public Attributes | |
const uint8_t | MIN_PWM_GENERATOR_DUTY_CYCLE = 0 |
Minimum PWM Generator Duty Cycle value. | |
const uint8_t | MAX_PWM_GENERATOR_DUTY_CYCLE = 255 |
Maximum PWM Generator Duty Cycle value. | |
Friends | |
class | VMXPi |
The VMXIO class provides access to VMX Analog/Digital IO functions, including VMX Channel and VMX Resource Management and functions.
bool VMXIO::Accumulator_GetAverageValue | ( | VMXResourceHandle | accum_res_handle, |
uint32_t & | average_value, | ||
VMXErrorCode * | errcode = 0 |
||
) |
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
accum_res_handle | Handle to the activated VMX Accumulator Resource | |
[out] | average_value | Current Accumulator average value |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Accumulator_GetAverageVoltage | ( | VMXResourceHandle | accum_res_handle, |
float & | average_voltage, | ||
VMXErrorCode * | errcode = 0 |
||
) |
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
accum_res_handle | Handle to the activated VMX Accumulator Resource | |
[out] | average_voltage | Current Accumulator average value, in voltage units |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Accumulator_GetFullScaleVoltage | ( | float & | full_scale_voltage, |
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current VMX Analog Input full-scale voltage level.
[out] | full_scale_voltage | Current VMX Analog Input full-scale voltage level |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Accumulator_GetInstantaneousValue | ( | VMXResourceHandle | accum_res_handle, |
uint32_t & | instantaneous_value, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current instantaneous (non-averaged) value from a VMX Analog Accumulator Resource.
NOTE: This method bypasses the Accmulator's averaging calculation
accum_res_handle | Handle to the activated VMX Accumulator Resource | |
[out] | instantaneous_value | Current Accumulator average value |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Accumulator_GetOversampleValue | ( | VMXResourceHandle | accum_res_handle, |
uint32_t & | oversample_value, | ||
VMXErrorCode * | errcode = 0 |
||
) |
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
accum_res_handle | Handle to the activated VMX Accumulator Resource | |
[out] | oversample_value | Current Accumulator oversample value |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::ActivateMultichannelResource | ( | uint8_t | num_channels, |
VMXChannelIndex * | p_channel_indexes, | ||
VMXChannelCapability * | p_channel_capabilities, | ||
VMXResourceHandle & | res_handle, | ||
const VMXResourceConfig * | res_cfg = 0 , |
||
VMXErrorCode * | errcode = 0 |
||
) |
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.
num_channels | The number of VMXChannelIndexes in the array pointed to by the p_channel_indexes parameter | |
p_channel_indexes | Pointer to an array of VMXChannelIndexes to route to the VMX Resource | |
p_channel_capabilities | The VMXChannelCapability of the specified VMX Channel which matches the capability of the requested VMX Resource | |
res_handle | The requested VMXResourceHandle | |
res_cfg | Pointer to the VMXResourceConfig object used to configure the VMX Resource | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::ActivateResource | ( | VMXResourceHandle | resource, |
VMXErrorCode * | errcode = 0 |
||
) |
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.
resource | The requested VMXResourceHandle | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::ActivateSinglechannelResource | ( | VMXChannelIndex | channel_index, |
VMXChannelCapability | channel_capability, | ||
VMXResourceHandle & | res_handle, | ||
const VMXResourceConfig * | res_cfg = 0 , |
||
VMXErrorCode * | errcode = 0 |
||
) |
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.
channel_index | The VMXChannelIndex to route to the VMX Resource | |
channel_capability | The VMXChannelCapability of the specified VMX Channel which matches the capability of the requested VMX Resource | |
res_handle | The requested VMXResourceHandle | |
res_cfg | Pointer to the VMXResourceConfig object used to configure the VMX Resource | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::AllocateResource | ( | VMXResourceHandle | resource, |
VMXErrorCode * | errcode = 0 |
||
) |
Attempts to allocate the specified VMXResourceHandle.
resource | The requested VMXResourceHandle | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::AnalogTrigger_GetState | ( | VMXResourceHandle | antrig_res_handle, |
AnalogTriggerState & | state, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current state from a VMX AnalogTrigger Resource.
antrig_res_handle | Handle to the activated VMX Analog Trigger Resource | |
[out] | state | The current AnalogTriggerState of the VMX Analog Trigger Resource |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::ChannelSupportsCapability | ( | VMXChannelIndex | channel_index, |
VMXChannelCapability | capability | ||
) |
Indicates whether the specified VMXChannelIndex supports the specified VMXChannelCapability.
channel_index | The requested VMXChannelIndex |
capability | The returned VMXChannelCapability |
bool VMXIO::DeactivateResource | ( | VMXResourceHandle | resource, |
VMXErrorCode * | errcode = 0 |
||
) |
Attempts to deactivate the specified VMXResourceHandle.
This will disable any output activity or input electrical activity - but leave channels routed if any.
resource | The requested VMXResourceHandle | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::DeallocateAllResources | ( | VMXErrorCode * | errcode = 0 | ) |
Attempts to deallocate all currently-allocated VMXResourceHandles.
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::DeallocateResource | ( | VMXResourceHandle | resource, |
VMXErrorCode * | errcode = 0 |
||
) |
Attempts to deallocate the specified VMXResourceHandle.
resource | The requested VMXResourceHandle | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::DIO_Get | ( | VMXResourceHandle | dio_res_handle, |
bool & | high, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current signal state from a VMX DigitalIO Resource.
dio_res_handle | Handle to the activated VMX DigitalIO Resource | |
[out] | high | true if the signal state is HIGH, false if it is LOW |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::DIO_Set | ( | VMXResourceHandle | dio_res_handle, |
bool | high, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Sets the current signal state of a VMX DigitalIO Resource in Digital Output mode.
dio_res_handle | Handle to the activated VMX DigitalIO Resource | |
high | true to set the signal state HIGH, false to set it to LOW | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Encoder_GetCount | ( | VMXResourceHandle | encoder_res_handle, |
int32_t & | count, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current Encoder count value from a VMX Encoder Resource.
encoder_res_handle | Handle to the activated VMX Encoder Resource | |
[out] | count | Current encoder count value, which may be negative or positive. |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Encoder_GetDirection | ( | VMXResourceHandle | encoder_res_handle, |
EncoderDirection & | direction, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the current EncoderDirection value from a VMX Encoder Resource.
encoder_res_handle | Handle to the activated VMX Encoder Resource | |
[out] | direction | Current encoder direction |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::Encoder_Reset | ( | VMXResourceHandle | encoder_res_handle, |
VMXErrorCode * | errcode = 0 |
||
) |
Sets the VMX Encoder Resource's count value to 0.
encoder_res_handle | Handle to the activated VMX Encoder Resource | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::GetChannelCapabilities | ( | VMXChannelIndex | channel_index, |
VMXChannelType & | channel_type, | ||
VMXChannelCapability & | capability_bits | ||
) |
Returns the VMXChannelType and VMXChannelCapability for the specified VMXChannelIndex.
channel_index | The requested VMXChannelIndex | |
[out] | channel_type | The returned VMXChannelType |
[out] | capability_bits | The return VMXChannelCapability. Note that multiple capability bits may be set. |
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.
resource_handle | The requested VMXResourceHandle. | |
[out] | first_channel_index | The first VMXChannelIndex compatible with the specified VMXResourceHandle |
[out] | num_channels | The number of VMXChannels compatible with the specified VMXResourceHandle |
uint8_t VMXIO::GetNumChannelsByCapability | ( | VMXChannelCapability | channel_capability | ) |
Returns the number of VMX Channels of the specified VMXChannelCapability.
channel_capability | The requested VMXChannelCapability. |
uint8_t VMXIO::GetNumChannelsByType | ( | VMXChannelType | channel_type, |
VMXChannelIndex & | first_channel_index | ||
) |
Returns the number of VMX Channels of the specified VMXChannelType.
channel_type | The requested VMXChannelType. |
first_channel_index | The first VMXChannelIndex of the requested type. |
uint8_t VMXIO::GetNumResourcesByType | ( | VMXResourceType | resource_type | ) |
Returns the number of VMX Resources of the specified VMXResourceType.
resource_type | The requested VMXResourceType. |
bool VMXIO::GetResourceConfig | ( | VMXResourceHandle | resource, |
VMXResourceConfig *& | p_config, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Gets the configuration of the specified VMXResourceHandle.
resource | The VMXResourceHandle to acquire configuration from | |
p_config | Pointer to the VMXResourceConfig object which will contain the retrieved configuration | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::GetResourceDefaultConfig | ( | VMXResourceHandle | resource, |
VMXResourceConfig *& | p_config, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Gets the default configuration of the specified VMXResourceHandle.
resource | The VMXResourceHandle to acquire default configuration from | |
p_config | Pointer to the VMXResourceConfig object which will contain the retrieved default configuration | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::GetResourceHandle | ( | VMXResourceType | resource_type, |
VMXResourceIndex | res_index, | ||
VMXResourceHandle & | resource_handle, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the VMXResourceHandle of the VMX Resource identified by the specified VMXResourceType and VMXResourceIndex.
resource_type | The requested VMXResourceType. | |
res_index | The requested VMXResourceIndex. | |
[out] | resource_handle | The returned VMXResourceHandle, if successful |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::GetResourcesCompatibleWithChannelAndCapability | ( | VMXChannelIndex | channel_index, |
VMXChannelCapability | capability, | ||
std::list< VMXResourceHandle > & | compatible_res_handles | ||
) |
Returns a list of VMXResourceHandles which are compatible with the specified VMXChannelIndex and VMXChannelCapability.
channel_index | The requested VMXResourceType. | |
capability | The requested VMXResourceIndex. | |
[out] | compatible_res_handles | The returned VMXResourceHandles, if successful |
bool VMXIO::GetUnallocatedResourcesCompatibleWithChannelAndCapability | ( | VMXChannelIndex | channel_index, |
VMXChannelCapability | capability, | ||
std::list< VMXResourceHandle > & | unallocated_compatible_res_handles | ||
) |
Returns a list of unallocated VMXResourceHandles which are compatible with the specified VMXChannelIndex and VMXChannelCapability.
channel_index | The requested VMXResourceType. | |
capability | The requested VMXResourceIndex. | |
[out] | unallocated_compatible_res_handles | The returned VMXResourceHandles, if successful |
bool VMXIO::I2C_Read | ( | VMXResourceHandle | i2c_res_handle, |
uint8_t | deviceAddress, | ||
uint8_t * | buffer, | ||
int32_t | count, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Reads data from the specified VMX I2C Resource.
NOTE: This is a blocking call.
i2c_res_handle | Handle to the activated VMX I2C Resource | |
deviceAddress | 7-bit I2C address of the I2C device | |
buffer | Pointer to the buffer into which received data is placed | |
count | Number of bytes to receive | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
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 = 0 |
||
) |
Simultaneously Writes/Reads data to/from the specified VMX I2C Resource.
NOTE: This is a blocking call.
i2c_res_handle | Handle to the activated VMX I2c Resource | |
deviceAddress | 7-bit I2C address of the I2C device | |
dataToSend | Pointer to the buffer of data to be sent to the SPI resource | |
sendSize | Number of bytes to send. The dataToSend parameter must point to a buffer whose length is at least this value. | |
dataReceived | Pointer to the buffer into which receive data read from the SPI resource | |
receiveSize | Number of bytes to receive. The dataReceived parameter must point to a buffer whose length is at least this value. | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::I2C_Write | ( | VMXResourceHandle | i2c_res_handle, |
uint8_t | deviceAddress, | ||
uint8_t * | dataToSend, | ||
int32_t | sendSize, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Writes the specified data to the specified VMX I2C Resource.
NOTE: This is a blocking call.
i2c_res_handle | Handle to the activated VMX I2C Resource | |
deviceAddress | 7-bit I2C address of the I2C device | |
dataToSend | Pointer to the buffer of data to be sent | |
sendSize | Number of bytes to send | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::IsResourceActive | ( | VMXResourceHandle | resource, |
bool & | active, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Indicates whether the specified VMXResourceHandle is currently active.
resource | The requested VMXResourceHandle | |
[out] | active | true if the VMX Resource is currently active |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::IsResourceAllocated | ( | VMXResourceHandle | resource, |
bool & | allocated, | ||
bool & | is_shared, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Indicates whether the specified VMXResourceHandle is currently allocated, and whether it is a shared resource.
resource | The requested VMXResourceHandle | |
[out] | allocated | true if the VMX Resource is currently allocated |
[out] | is_shared | true if the VMX Resource is currently allocated in "shared" mode |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::PWMGenerator_SetDutyCycle | ( | VMXResourceHandle | pwmgen_res_handle, |
VMXResourcePortIndex | port_index, | ||
uint8_t | duty_cycle, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Sets the VMX PWM Generator Resource's Duty Cycle to the specified value.
pwmgen_res_handle | Handle to the activated VMX PWM Generator Resource | |
port_index | VMXResourcePortIndex of the port on the VMX PWM Generator Resource to modify | |
duty_cycle | The VMX PWM Generator Resource's Duty Cycle value, which must be in the range 0-255. | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::RouteChannelToResource | ( | VMXChannelIndex | channel_index, |
VMXResourceHandle | resource, | ||
VMXErrorCode * | errcode = 0 |
||
) |
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.
channel_index | The VMXChannelIndex to route to the resource | |
resource | The VMXResourceHandle to which the VMXChannel should be routed | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::SetResourceConfig | ( | VMXResourceHandle | resource, |
const VMXResourceConfig * | p_config, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Sets the configuration to the specified VMXResourceHandle.
NOTE: VMX Resources can only be configured after they are allocated and before they are activated.
resource | The VMXResourceHandle to be configured | |
p_config | Pointer to the VMXResourceConfig object used to configure the VMX Resource | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::SPI_Read | ( | VMXResourceHandle | spi_res_handle, |
uint8_t * | p_rcv_data, | ||
uint16_t | size, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Reads data from the specified VMX SPI Resource.
spi_res_handle | Handle to the activated VMX SPI Resource | |
p_rcv_data | Pointer to the buffer into which to receive data, which must be at least the size specified via the max_size parameter | |
size | The 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] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::SPI_Transaction | ( | VMXResourceHandle | spi_res_handle, |
uint8_t * | p_send_data, | ||
uint8_t * | p_rcv_data, | ||
uint16_t | size, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Simultaneously Writes/Reads data to/from the specified VMX SPI Resource.
NOTE: This is a blocking call.
spi_res_handle | Handle to the activated VMX SPI Resource | |
p_send_data | Pointer to the buffer of data to be sent to the SPI resource | |
p_rcv_data | Pointer to the buffer into which receive data read from the SPI resource | |
size | Number of bytes to send/receive | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::SPI_Write | ( | VMXResourceHandle | spi_res_handle, |
uint8_t * | p_send_data, | ||
uint16_t | size, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Writes the specified data to the specified VMX SPI Resource.
NOTE: This is a blocking call.
spi_res_handle | Handle to the activated VMX SPI Resource | |
p_send_data | Pointer to the buffer of data to be sent | |
size | Number of bytes to send | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::UART_GetBytesAvailable | ( | VMXResourceHandle | reshandle, |
uint16_t & | size, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Returns the number of data bytes which have been received from VMX UART Resource.
reshandle | Handle to the activated VMX UART Resource | |
size | The number of received data bytes, which can be read via the VMXIO::UART_Read() method. | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::UART_Read | ( | VMXResourceHandle | reshandle, |
uint8_t * | p_data, | ||
uint16_t | max_size, | ||
uint16_t & | actual_num_bytes_read, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Reads data from the specified VMX UART Resource.
reshandle | Handle to the activated VMX UART Resource | |
p_data | Pointer to the buffer into which to receive data, which must be at least the size specified via the max_size parameter | |
max_size | The 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_read | The actual number of bytes read into the buffer pointed to by p_data |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::UART_Write | ( | VMXResourceHandle | reshandle, |
uint8_t * | p_data, | ||
uint16_t | size, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Writes the specified data to the specified VMX UART Resource.
NOTE: This is a blocking call.
reshandle | Handle to the activated VMX UART Resource | |
p_data | Pointer to the buffer of data to be sent | |
size | Number of bytes to send | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::UnrouteAllChannelsFromResource | ( | VMXResourceHandle | resource, |
VMXErrorCode * | errcode = 0 |
||
) |
Attempts to unroute all VMX Channels from the allocated VMXResourceHandle.
resource | The VMXResourceHandle to which the VMXChannel should be unrouted | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |
bool VMXIO::UnrouteChannelFromResource | ( | VMXChannelIndex | channel_index, |
VMXResourceHandle | resource, | ||
VMXErrorCode * | errcode = 0 |
||
) |
Attempts to unroute the specified VMXChannelIndex from the allocated VMXResourceHandle.
channel_index | The VMXChannelIndex to unroute from the resource | |
resource | The VMXResourceHandle to which the VMXChannel should be unrouted | |
[out] | errcode | Pointer to the VMXErrorCode to be returned in case of error; may be null |