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

Contains the configuration data for a VMXResource whose VMXResourceType is InputCapture. More...

#include <VMXResourceConfig.h>

Inheritance diagram for InputCaptureConfig:
InputCaptureConfigBase VMXResourceConfig PWMCaptureConfig

Public Types

enum  CounterClockSource { INTERNAL, EDGEDETECT_CH1, FILTERED_CH1, FILTERED_CH2 }
 
enum  CounterDirection { DIRECTION_UP, DIRECTION_DN }
 
enum  SlaveMode {
  SLAVEMODE_DISABLED, SLAVEMODE_RESET, SLAVEMODE_GATED, SLAVEMODE_TRIGGER,
  SLAVEMODE_FILTERED_INPUT_TRIGGER
}
 
enum  SlaveModeTriggerSource { TRIGGER_EDGEDETECT_CH1, TRIGGER_FILTERED_CH1, TRIGGER_FILTERED_CH2, TRIGGER_DYNAMIC }
 
enum  CaptureChannelSource { CAPTURE_SIGNAL_A, CAPTURE_SIGNAL_B, CAPTURE_SIGNAL_DYNAMIC }
 
enum  CaptureChannelActiveEdge { ACTIVE_RISING, ACTIVE_FALLING, ACTIVE_BOTH }
 
enum  CaptureChannelPrescaler { x1, x2, x4, x8 }
 
enum  StallAction { ACTION_NONE, ACTION_CLEAR_COUNTER }
 
enum  VirtualCounterMode { VC_MODE_DISABLED, VC_MODE_DUTYCYCLE_ENCODER, VC_MODE_DUAL_INPUT_UPDOWN }
 
enum  VirtualCounterSource { VC_SOURCE_CH1, VC_SOURCE_CH2 }
 
- Public Types inherited from InputCaptureConfigBase
enum  CaptureChannel { CH1, CH2 }
 

Public Member Functions

uint32_t GetMicrosecondsPerTick ()
 Returns the configured Input Capture (internal clock source) Microseconds per Tick Rate. More...
 
void SetMicrosecondsPerTick (uint32_t microseconds_per_tick)
 Sets the configured Input Capture (internal clock source) Microseconds per Tick Rate. More...
 
void SetCounterClockSource (CounterClockSource counter_clock_source)
 
CounterClockSource GetCounterClockSource ()
 
void SetCounterDirection (CounterDirection counter_direction)
 
CounterDirection GetCounterDirection ()
 
void SetSlaveMode (SlaveMode slave_mode)
 
SlaveMode GetSlaveMode ()
 
void SetSlaveModeTriggerSource (SlaveModeTriggerSource slave_mode_trigger_source)
 
SlaveModeTriggerSource GetSlaveModeTriggerSource ()
 
void SetCaptureChannelSource (CaptureChannel capture_channel, CaptureChannelSource source)
 
CaptureChannelSource GetCaptureChannelSource (CaptureChannel capture_channel)
 
void SetCaptureChannelActiveEdge (CaptureChannel capture_channel, CaptureChannelActiveEdge active_edge)
 
CaptureChannelActiveEdge GetCaptureChannelActiveEdge (CaptureChannel capture_channel)
 
void SetCaptureChannelPrescaler (CaptureChannel capture_channel, CaptureChannelPrescaler prescaler)
 
CaptureChannelPrescaler GetCaptureChannelPrescaler (CaptureChannel capture_channel)
 
void SetStallAction (StallAction stall_action)
 
StallAction GetStallAction ()
 
void SetVirtualCounterMode (VirtualCounterMode vc_mode)
 
VirtualCounterMode GetVirtualCounterMode ()
 
void SetVirtualCounterSource (VirtualCounterSource vc_source)
 
VirtualCounterSource GetVirtualCounterSource ()
 
void SetVirtualCounterParameter1 (uint16_t value)
 
uint16_t GetVirtualCounterParameter1 ()
 
void SetVirtualCounterParameter2 (uint16_t value)
 
uint16_t GetVirtualCounterParameter2 ()
 
void SetVirtualCounterDutyCycleEncoderLowTicks (uint16_t value)
 
uint16_t GetVirtualCounterDutyCycleEncoderLowTicks ()
 
void SetVirtualCounterDutyCycleEncoderHighTicks (uint16_t value)
 
uint16_t GetVirtualCounterDutyCycleEncoderHighTicks ()
 
virtual size_t GetSize () const
 
virtual VMXResourceConfigGetCopy () const
 Instantiates a copy of the configuration data. More...
 
virtual bool Copy (const VMXResourceConfig *p_config)
 Copies the contents of the source VMXResourceConfig object into this object. More...
 
- Public Member Functions inherited from InputCaptureConfigBase
 InputCaptureConfigBase (VMXResourceType resource_type)
 
void SetStallTimeout20MsPeriods (uint8_t stall_timeout_20ms_periods)
 
uint8_t GetStallTimeout20MsPeriods ()
 
void SetCaptureChannelFilter (CaptureChannel capture_channel, uint8_t filter)
 
uint8_t GetCaptureChannelFilter (CaptureChannel capture_channel)
 
uint8_t GetClosestCaptureChannelFilter (uint32_t period_nanoseconds)
 
uint8_t GetClosestCaptureCaptureFilterNumSamples (uint32_t num_samples)
 
uint32_t GetCaptureChannelFilterPeriodNanoseconds (uint8_t filter)
 
uint32_t GetCaptureChannelFilterNumSamples (uint8_t filter)
 
- Public Member Functions inherited from VMXResourceConfig
 VMXResourceConfig (VMXResourceType res_type)
 
VMXResourceType GetResourceType () const
 VMXResourceType which this configuration applies to.
 

Public Attributes

uint32_t microseconds_per_tick
 Specifies the Input Capture internal clock source resolution (number of microseconds per tick)
 
CounterClockSource counter_clock_source
 
CounterDirection counter_direction
 
SlaveMode slave_mode
 
SlaveModeTriggerSource slave_mode_trigger_source
 
CaptureChannelSource capture_channel_source [2]
 
CaptureChannelActiveEdge capture_channel_active_edge [2]
 
CaptureChannelPrescaler capture_channel_prescaler [2]
 
StallAction stall_action
 
VirtualCounterMode virtual_counter_mode
 
VirtualCounterSource virtual_counter_source
 
uint16_t virtual_counter_parameter1
 
uint16_t virtual_counter_parameter2
 
- Public Attributes inherited from InputCaptureConfigBase
uint8_t capture_channel_filter [2]
 
uint8_t stall_timeout_20ms_periods
 
- Public Attributes inherited from VMXResourceConfig
VMXResourceType res_type
 

Detailed Description

Contains the configuration data for a VMXResource whose VMXResourceType is InputCapture.

Member Function Documentation

◆ Copy()

virtual bool InputCaptureConfig::Copy ( const VMXResourceConfig p_config)
inlinevirtual

Copies the contents of the source VMXResourceConfig object into this object.

NOTE: The source object's VMXResourceType must match this object's VMXResourceType.

Parameters
[in]p_configThe source VMXResourceConfig object from which to copy configuration data into this object.

Implements VMXResourceConfig.

Reimplemented in PWMCaptureConfig.

◆ GetCopy()

virtual VMXResourceConfig* InputCaptureConfig::GetCopy ( ) const
inlinevirtual

Instantiates a copy of the configuration data.

NOTE: The caller is responsible to delete the object returned from this method.

Implements VMXResourceConfig.

Reimplemented in PWMCaptureConfig.

◆ GetMicrosecondsPerTick()

uint32_t InputCaptureConfig::GetMicrosecondsPerTick ( )
inline

Returns the configured Input Capture (internal clock source) Microseconds per Tick Rate.

NOTE: This value is ignored if CounterClockSource is INTERNAL.

◆ SetMicrosecondsPerTick()

void InputCaptureConfig::SetMicrosecondsPerTick ( uint32_t  microseconds_per_tick)
inline

Sets the configured Input Capture (internal clock source) Microseconds per Tick Rate.

NOTE: This value is ignored if CounterClockSource is INTERNAL.


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