VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
VMXResourceConfig.h
1 /* ============================================
2 VMX-pi HAL source code is placed under the MIT license
3 Copyright (c) 2017 Kauai Labs
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 The above copyright notice and this permission notice shall be included in
11 all copies or substantial portions of the Software.
12 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18 THE SOFTWARE.
19 ===============================================
20 */
21 
22 #ifndef VMXRESOURCECONFIG_H_
23 #define VMXRESOURCECONFIG_H_
24 
25 #include "VMXResource.h"
26 #include "VMXHandlers.h"
27 
34  VMXResourceType res_type;
36  this->res_type = res_type;
37  }
39  VMXResourceType GetResourceType() const { return res_type; }
43  virtual VMXResourceConfig *GetCopy() const = 0;
49  virtual bool Copy(const VMXResourceConfig *p_config) = 0;
50  virtual ~VMXResourceConfig() {}
51 };
52 
57 
59  typedef enum { RISING, FALLING, BOTH } InterruptEdge;
60 
61  InterruptEdge edge;
62  VMXIO_InterruptHandler p_handler;
63  void *p_param;
64 
67  edge = InterruptEdge::RISING;
68  p_handler = 0;
69  p_param = 0;
70  }
76  InterruptConfig(InterruptEdge edge, VMXIO_InterruptHandler p_handler, void *p_param) :
78  this->edge = edge;
79  this->p_handler = p_handler;
80  this->p_param = p_param;
81  }
82 
84  VMXIO_InterruptHandler GetHandler() { return p_handler; }
86  void * GetParam() { return p_param; }
88  InterruptEdge GetEdge() { return edge; }
89 
91  void SetHandler(VMXIO_InterruptHandler p_handler) { this->p_handler = p_handler; }
93  void SetParam(void *p_param) { this->p_param = p_param; }
95  void SetEdge(InterruptEdge edge) { this->edge = edge; }
96 
97  virtual VMXResourceConfig *GetCopy() const {
98  InterruptConfig *p_new = new InterruptConfig();
99  *p_new = *this;
100  return p_new;
101  }
102  virtual bool Copy(const VMXResourceConfig *p_config) {
103  if (p_config->GetResourceType() != this->GetResourceType()) return false;
104  *this = *((InterruptConfig *)p_config);
105  return true;
106  }
107 
108  virtual ~InterruptConfig() {}
109 };
110 
114 struct DIOConfig : public VMXResourceConfig {
116  typedef enum { PUSHPULL, OPENDRAIN } OutputMode;
118  typedef enum { PULLUP, PULLDOWN, NONE } InputMode;
119 
120  /* NOTE: Certain DIOs may be input-only or output-only at the hardware level. */
121  /* Therefore it's possible this configuration may fail if an incompatible state is requested. */
122  bool input;
123  OutputMode outputmode; /* Not all DIO (e.g., rpi) channels can support !pushpull (opendrain) */
124  InputMode inputmode;
125 
128  input = true;
129  outputmode = OutputMode::PUSHPULL;
130  inputmode = InputMode::PULLUP;
131  }
135  DIOConfig(InputMode inputmode) :
137  this->input = true;
138  this->inputmode = inputmode;
139  this->outputmode = OutputMode::PUSHPULL;
140  }
144  DIOConfig(OutputMode outputmode) :
146  this->input = false;
147  this->inputmode = InputMode::NONE;
148  this->outputmode = outputmode;
149  }
150 
153  bool GetInput() { return input; }
155  OutputMode GetOutputMode() { return outputmode; }
157  InputMode GetInputMode() { return inputmode; }
158 
163  void SetInput(bool input) { this->input = input; }
165  void SetInputMode(InputMode inputmode) { this->inputmode = inputmode; }
167  void SetOutputMode(OutputMode outputmode) { this->outputmode = outputmode; }
168 
169  virtual VMXResourceConfig *GetCopy() const {
170  DIOConfig *p_new = new DIOConfig();
171  *p_new = *this;
172  return p_new;
173  }
174  virtual bool Copy(const VMXResourceConfig *p_config) {
175  if (p_config->GetResourceType() != this->GetResourceType()) return false;
176  *this = *((DIOConfig *)p_config);
177  return true;
178  }
179  virtual ~DIOConfig() {}
180 };
181 
186  uint32_t frequency_hz;
187 
190  frequency_hz = 200;
191  }
196  this->frequency_hz = frequency_hz;
197  }
198 
202  uint32_t GetFrequencyHz() { return frequency_hz; }
203 
205  void SetFrequencyHz(uint32_t frequency_hz) { this->frequency_hz = frequency_hz; }
206 
207  virtual VMXResourceConfig *GetCopy() const {
208  PWMGeneratorConfig *p_new = new PWMGeneratorConfig();
209  *p_new = *this;
210  return p_new;
211  }
212  virtual bool Copy(const VMXResourceConfig *p_config) {
213  if (p_config->GetResourceType() != this->GetResourceType()) return false;
214  *this = *((PWMGeneratorConfig *)p_config);
215  return true;
216  }
217  virtual ~PWMGeneratorConfig() {}
218 };
219 
225  typedef enum { RISING, FALLING } CaptureEdge;
226  CaptureEdge edge_type;
227 
230  edge_type = CaptureEdge::RISING;
231  }
236  this->edge_type = edge_type;
237  }
238 
240  CaptureEdge GetCaptureEdge() { return edge_type; }
241 
243  void SetCaptureEdge(CaptureEdge edge) { this->edge_type = edge; }
244 
245  virtual VMXResourceConfig *GetCopy() const {
246  PWMCaptureConfig *p_new = new PWMCaptureConfig();
247  *p_new = *this;
248  return p_new;
249  }
250  virtual bool Copy(const VMXResourceConfig *p_config) {
251  if (p_config->GetResourceType() != this->GetResourceType()) return false;
252  *this = *((PWMCaptureConfig *)p_config);
253  return true;
254  }
255  virtual ~PWMCaptureConfig() {}
256 };
257 
263  typedef enum { x1, x2, x4 } EncoderEdge;
264  EncoderEdge edge_count;
265 
268  edge_count = EncoderEdge::x4;
269  }
274  edge_count = edge;
275  }
276 
278  EncoderEdge GetEncoderEdge() { return edge_count; }
279 
281  void SetEncoderEdge(EncoderEdge edge) { this->edge_count = edge; }
282 
283  virtual VMXResourceConfig *GetCopy() const {
284  EncoderConfig *p_new = new EncoderConfig();
285  *p_new = *this;
286  return p_new;
287  }
288  virtual bool Copy(const VMXResourceConfig *p_config) {
289  if (p_config->GetResourceType() != this->GetResourceType()) return false;
290  *this = *((EncoderConfig *)p_config);
291  return true;
292  }
293  virtual ~EncoderConfig() {}
294 };
295 
300  uint8_t num_average_bits;
301  uint8_t num_oversample_bits;
302 
305  num_oversample_bits = 3;
306  num_average_bits = 3;
307  }
312  AccumulatorConfig(uint8_t num_oversample_bits, uint8_t num_average_bits) :
314  this->num_oversample_bits = num_oversample_bits;
315  this->num_average_bits = num_average_bits;
316  }
317 
321  uint8_t GetNumAverageBits() { return num_average_bits; }
323  /* For more information on oversampling, see <a href="https://en.wikipedia.org/wiki/Oversampling">this Wikipedia article</a> */
324  uint8_t GetNumOversampleBits() { return num_oversample_bits; }
325 
327  void SetNumAverageBits(uint8_t num_average_bits) { this->num_average_bits = num_average_bits; }
329  void SetNumOversampleBits(uint8_t num_oversample_bits) { this->num_oversample_bits = num_oversample_bits; }
330 
331  virtual VMXResourceConfig *GetCopy() const {
332  AccumulatorConfig *p_new = new AccumulatorConfig();
333  *p_new = *this;
334  return p_new;
335  }
336  virtual bool Copy(const VMXResourceConfig *p_config) {
337  if (p_config->GetResourceType() != this->GetResourceType()) return false;
338  *this = *((AccumulatorConfig *)p_config);
339  return true;
340  }
341  virtual ~AccumulatorConfig() {}
342 };
343 
349  typedef enum {
355  FALLING_EDGE_PULSE
357 
358  uint16_t threshold_high; /* 12-bit value (0-4095) */
359  uint16_t threshold_low; /* 12-bit value (0-4095) */
360  AnalogTriggerMode mode;
361 
364  threshold_high = 992; /* .8V on a 3.3V scale */
365  threshold_low = 2482; /* 2V on a 3.3V scale */
366  mode = AnalogTriggerMode::STATE;
367  }
373  AnalogTriggerConfig(uint16_t threshold_high, uint16_t threshold_low, AnalogTriggerMode mode) :
375  this->threshold_high = threshold_high;
376  this->threshold_low = threshold_low;
377  this->mode = mode;
378  }
379 
381  uint16_t GetThresholdHigh() { return threshold_high; }
383  uint16_t GetThresholdLow() { return threshold_low; }
385  AnalogTriggerMode GetMode() { return mode; }
386 
388  void SetThresholdHigh(uint16_t threshold_high) { this->threshold_high = threshold_high; }
390  void SetThresholdLow(uint16_t threshold_low) { this->threshold_low = threshold_low; }
392  void SetMode(AnalogTriggerMode mode) { this->mode = mode; }
393 
394  virtual VMXResourceConfig *GetCopy() const {
396  *p_new = *this;
397  return p_new;
398  }
399  virtual bool Copy(const VMXResourceConfig *p_config) {
400  if (p_config->GetResourceType() != this->GetResourceType()) return false;
401  *this = *((AnalogTriggerConfig *)p_config);
402  return true;
403  }
404  virtual ~AnalogTriggerConfig() {}
405 };
406 
410 struct UARTConfig : public VMXResourceConfig {
411  uint32_t baudrate_bps;
412 
415  baudrate_bps = 57600;
416  }
420  UARTConfig(uint32_t baudrate_bps) : VMXResourceConfig(VMXResourceType::UART) {
421  this->baudrate_bps = baudrate_bps;
422  }
423 
425  uint32_t GetBaudrate() { return baudrate_bps; }
426 
428  void SetBaudrate(uint32_t baudrate_bps) { this->baudrate_bps = baudrate_bps; }
429 
430  virtual VMXResourceConfig *GetCopy() const {
431  UARTConfig *p_new = new UARTConfig();
432  *p_new = *this;
433  return p_new;
434  }
435  virtual bool Copy(const VMXResourceConfig *p_config) {
436  if (p_config->GetResourceType() != this->GetResourceType()) return false;
437  *this = *((UARTConfig *)p_config);
438  return true;
439  }
440  virtual ~UARTConfig() {}
441 };
442 
446 struct SPIConfig : public VMXResourceConfig {
447  uint32_t bitrate_bps;
448  uint8_t mode; /* Range: 0-3 */
449  bool cs_active_low;
450  bool msbfirst;
451 
454  bitrate_bps = 1000000;
455  mode = 3;
456  cs_active_low = true;
457  msbfirst = true;
458  }
463  bitrate_bps = bitrate;
464  mode = 3;
465  cs_active_low = true;
466  msbfirst = true;
467  }
475  SPIConfig(uint32_t bitrate, uint8_t mode, bool cs_active_low, bool msbfirst) :
477  {
478  this->bitrate_bps = bitrate;
479  this->mode = mode;
480  this->cs_active_low = cs_active_low;
481  this->msbfirst = msbfirst;
482  }
483 
485  uint32_t GetBitrate() { return bitrate_bps; }
487  uint8_t GetMode() { return mode; }
489  bool GetCSActiveLow() { return cs_active_low; }
493  bool GetMSBFirst() { return msbfirst; }
494 
496  void SetBitrate(uint32_t bitrate) { this->bitrate_bps = bitrate; }
500  void SetMode(uint8_t mode) { this->mode = mode % 4; }
502  void SetCSActiveLow(bool cs_active_low) { this->cs_active_low = cs_active_low; }
504  void SetMSBFirst(bool msbfirst) { this->msbfirst = msbfirst; }
505 
506  virtual VMXResourceConfig *GetCopy() const {
507  SPIConfig *p_new = new SPIConfig();
508  *p_new = *this;
509  return p_new;
510  }
511  virtual bool Copy(const VMXResourceConfig *p_config) {
512  if (p_config->GetResourceType() != this->GetResourceType()) return false;
513  *this = *((SPIConfig *)p_config);
514  return true;
515  }
516  virtual ~SPIConfig() {}
517 };
518 
522 struct I2CConfig : public VMXResourceConfig {
525 
526  virtual VMXResourceConfig *GetCopy() const {
527  I2CConfig *p_new = new I2CConfig();
528  *p_new = *this;
529  return p_new;
530  }
531  virtual bool Copy(const VMXResourceConfig *p_config) {
532  if (p_config->GetResourceType() != this->GetResourceType()) return false;
533  *this = *((I2CConfig *)p_config);
534  return true;
535  }
536  virtual ~I2CConfig() {}
537 };
538 
539 #endif /* VMXRESOURCECONFIG_H_ */
EncoderEdge
Specifies whether the encoder counter is invoked on every edge, every other edge, or every fourth edg...
Definition: VMXResourceConfig.h:263
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:430
VMX Resource providing Quadrature Encoder of a VMX Channel pair in input mode.
Definition: VMXResource.h:42
Analog Trigger Events are level-triggered (occurring as long as the signal is high) ...
Definition: VMXResourceConfig.h:351
AccumulatorConfig()
AccumulatorConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:304
void * GetParam()
Retrieves the interrupt handler parameter.
Definition: VMXResourceConfig.h:86
DIOConfig()
DIOConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:127
void SetCaptureEdge(CaptureEdge edge)
Sets the configured PWM CaptureEdge.
Definition: VMXResourceConfig.h:243
CaptureEdge
Specifies which PWM input signal edge starts the PWM duty cycle timer.
Definition: VMXResourceConfig.h:225
Contains the configuration data for a VMXResource whose VMXResourceType is I2C.
Definition: VMXResourceConfig.h:522
VMX Resource providing Digital Input and Digital Output Control on a VMX Digital Channel.
Definition: VMXResource.h:36
Contains the configuration data for a VMXResource whose VMXResourceType is DigitalIO.
Definition: VMXResourceConfig.h:114
DIOConfig(OutputMode outputmode)
DIOConfig constructor; initializes values with the provided parameters *.
Definition: VMXResourceConfig.h:144
Base structure representing VMXResourceType-specific configuration data that must be set to a valid d...
Definition: VMXResourceConfig.h:33
VMXIO_InterruptHandler GetHandler()
Retrieves the interrupt handler.
Definition: VMXResourceConfig.h:84
InterruptConfig(InterruptEdge edge, VMXIO_InterruptHandler p_handler, void *p_param)
InterruptConfig constructor; initializes values with the provided input parameters *...
Definition: VMXResourceConfig.h:76
void SetHandler(VMXIO_InterruptHandler p_handler)
Sets the interrupt handler.
Definition: VMXResourceConfig.h:91
uint8_t GetNumOversampleBits()
Returns the configured number of oversample bits.
Definition: VMXResourceConfig.h:324
UARTConfig()
UARTConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:414
InterruptConfig()
InterruptConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:66
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:531
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:245
AnalogTriggerMode GetMode()
Returns the configured AnalogTriggerMode.
Definition: VMXResourceConfig.h:385
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:288
uint16_t GetThresholdLow()
Returns the low threshold, which is a 12-bit value (0-4095) representing the highest-possible voltage...
Definition: VMXResourceConfig.h:383
void SetOutputMode(OutputMode outputmode)
Specifies the output mode.
Definition: VMXResourceConfig.h:167
EncoderEdge GetEncoderEdge()
Returns the configured EncoderEdge.
Definition: VMXResourceConfig.h:278
void SetInputMode(InputMode inputmode)
Specifies the input mode.
Definition: VMXResourceConfig.h:165
EncoderConfig()
EncoderConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:267
SPIConfig(uint32_t bitrate, uint8_t mode, bool cs_active_low, bool msbfirst)
SPIConfig constructor; initializes values with the provided input parameters *.
Definition: VMXResourceConfig.h:475
void SetEdge(InterruptEdge edge)
Sets the signal edge which generates the interrupt.
Definition: VMXResourceConfig.h:95
void SetMode(AnalogTriggerMode mode)
Sets the configured AnalogTriggerMode.
Definition: VMXResourceConfig.h:392
PWMCaptureConfig()
PWMCaptureConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:229
VMX Resource providing I2C communication via a VMX Channel pair.
Definition: VMXResource.h:54
UARTConfig(uint32_t baudrate_bps)
UARTConfig constructor; initializes values with the provided input parameters.
Definition: VMXResourceConfig.h:420
InputMode
Specifies the default signal state of a floating DigitalIO in input mode.
Definition: VMXResourceConfig.h:118
VMX Resource providing Interrupt generation from a VMX Analog Input Channel.
Definition: VMXResource.h:46
Contains the configuration data for a VMXResource whose VMXResourceType is PWMCaptureConfig.
Definition: VMXResourceConfig.h:223
Analog Trigger Events occur when a low-to-high transition is detected.
Definition: VMXResourceConfig.h:353
VMX Resource providing SPI communication via a four VMX Channel set.
Definition: VMXResource.h:52
InterruptEdge
Specifies which signal edge will generate an interrupt.
Definition: VMXResourceConfig.h:59
AnalogTriggerMode
Specifies what conditions cause an AnalogTrigger event.
Definition: VMXResourceConfig.h:349
EncoderConfig(EncoderEdge edge)
EncoderConfig constructor; initializes values with the provided input parameters *.
Definition: VMXResourceConfig.h:273
void SetMSBFirst(bool msbfirst)
Sets the SPI bit transmit order to most-significant bit first if true; least-significant bit order is...
Definition: VMXResourceConfig.h:504
void SetBaudrate(uint32_t baudrate_bps)
Sets the configured UART baudrate.
Definition: VMXResourceConfig.h:428
bool GetInput()
returns true if the DigitalIO should be configured in inputmode; returns false if the DigitalIO shoul...
Definition: VMXResourceConfig.h:153
void SetCSActiveLow(bool cs_active_low)
Sets the SPI CS Active low if true, Active high if false.
Definition: VMXResourceConfig.h:502
InterruptEdge GetEdge()
Retrieves the signal edge which generates an interrupt.
Definition: VMXResourceConfig.h:88
AnalogTriggerConfig()
Default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:363
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:331
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:169
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:394
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:526
void SetBitrate(uint32_t bitrate)
Sets the configured SPI bitrate.
Definition: VMXResourceConfig.h:496
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:336
VMXResourceType
Enumerates the various types of VMXResources.
Definition: VMXResource.h:33
uint16_t GetThresholdHigh()
Returns the high threshold, which is a 12-bit value (0-4095) representing the lowest-possible voltage...
Definition: VMXResourceConfig.h:381
virtual bool Copy(const VMXResourceConfig *p_config)=0
Copies the contents of the source VMXResourceConfig object into this object.
void SetNumOversampleBits(uint8_t num_oversample_bits)
Sets the configured number of oversample bits.
Definition: VMXResourceConfig.h:329
PWMGeneratorConfig(uint32_t frequency_hz)
PWMGeneratorConfig constructor; initializes values with the provided input parameters *...
Definition: VMXResourceConfig.h:195
OutputMode
Specifies the electrical behavior of a DigitalIO in output mode.
Definition: VMXResourceConfig.h:116
bool GetMSBFirst()
Returns true if the most-significant bit is transmitted first; false if the least-significant bit is ...
Definition: VMXResourceConfig.h:493
uint8_t GetMode()
Returns the configure SPI mode.
Definition: VMXResourceConfig.h:487
Contains the configuration data for a VMXResource whose VMXResourceType is SPI.
Definition: VMXResourceConfig.h:446
void SetMode(uint8_t mode)
Sets the configured SPI mode, which must be a value from 0-3.
Definition: VMXResourceConfig.h:500
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:102
void SetInput(bool input)
Specifies whether this DIOConfig represents an input or output mode configuration.
Definition: VMXResourceConfig.h:163
SPIConfig()
SPIConfig default constructor; sets all values to defaults (1Mhz SPI Click, Mode 3, CS Active Low, MSBFirst.
Definition: VMXResourceConfig.h:453
VMX Resource providing PWM Generation Control of a VMX Digital Channel in output mode.
Definition: VMXResource.h:38
VMXResourceType GetResourceType() const
VMXResourceType which this configuration applies to.
Definition: VMXResourceConfig.h:39
AnalogTriggerConfig(uint16_t threshold_high, uint16_t threshold_low, AnalogTriggerMode mode)
AccumulatorConfig constructor; initializes values with the provided input parameters.
Definition: VMXResourceConfig.h:373
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:511
bool GetCSActiveLow()
Returns true if the SPI CS is active low; false if the SPI CS is active high.
Definition: VMXResourceConfig.h:489
uint32_t GetBaudrate()
Returns the configured UART baudrate.
Definition: VMXResourceConfig.h:425
VMX Resource providing UART communication via a VMX Channel pair.
Definition: VMXResource.h:50
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:207
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:399
void SetEncoderEdge(EncoderEdge edge)
Sets the configured EncoderEdge.
Definition: VMXResourceConfig.h:281
I2CConfig()
Default constructor.
Definition: VMXResourceConfig.h:524
virtual VMXResourceConfig * GetCopy() const =0
Instantiates a copy of the configuration data.
uint32_t GetBitrate()
Returns the configured SPI bitrate.
Definition: VMXResourceConfig.h:485
Contains the configuration data for a VMXResource whose VMXResourceType is PWMGenerator.
Definition: VMXResourceConfig.h:185
Contains the configuration data for a VMXResource whose VMXResourceType is UART.
Definition: VMXResourceConfig.h:410
PWMCaptureConfig(CaptureEdge edge_type)
PWMCaptureConfig constructor; initializes values with the provided input parameters *...
Definition: VMXResourceConfig.h:235
AccumulatorConfig(uint8_t num_oversample_bits, uint8_t num_average_bits)
AccumulatorConfig constructor; initializes values with the provided input parameters *...
Definition: VMXResourceConfig.h:312
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:283
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:435
InputMode GetInputMode()
Returns input mode; only valid if this DIOConfig represents a DigitalIO in input mode.
Definition: VMXResourceConfig.h:157
void SetThresholdLow(uint16_t threshold_low)
Sets the configured low threshold.
Definition: VMXResourceConfig.h:390
Contains the configuration data for a VMXResource whose VMXResourceType is Interrupt.
Definition: VMXResourceConfig.h:56
VMX Resource providing PWM Capture of a VMX FlexIO Digital Channel in input mode. ...
Definition: VMXResource.h:40
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:97
virtual VMXResourceConfig * GetCopy() const
Instantiates a copy of the configuration data.
Definition: VMXResourceConfig.h:506
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:174
void SetNumAverageBits(uint8_t num_average_bits)
Sets the configured number of average bits.
Definition: VMXResourceConfig.h:327
PWMGeneratorConfig()
PWMGeneratorConfig default constructor; sets all values to defaults.
Definition: VMXResourceConfig.h:189
uint32_t GetFrequencyHz()
Returns the PWM Generators&#39;s frequency in Hz.
Definition: VMXResourceConfig.h:202
DIOConfig(InputMode inputmode)
DIOConfig constructor; initializes values with the provided parameters *.
Definition: VMXResourceConfig.h:135
void SetThresholdHigh(uint16_t threshold_high)
Sets the configured high threshold.
Definition: VMXResourceConfig.h:388
void SetParam(void *p_param)
Sets the interrupt handler parameter.
Definition: VMXResourceConfig.h:93
VMX Resource providing Interrupt generation from a VMX Digital Channel in input mode.
Definition: VMXResource.h:48
SPIConfig(uint32_t bitrate)
SPIConfig constructor; initializes bitrate, sets remaining value to defaults.
Definition: VMXResourceConfig.h:462
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:250
uint8_t GetNumAverageBits()
Returns the configured number of average bits.
Definition: VMXResourceConfig.h:321
Contains the configuration data for a VMXResource whose VMXResourceType is Accumulator.
Definition: VMXResourceConfig.h:299
virtual bool Copy(const VMXResourceConfig *p_config)
Copies the contents of the source VMXResourceConfig object into this object.
Definition: VMXResourceConfig.h:212
Contains the configuration data for a VMXResource whose VMXResourceType is Encoder.
Definition: VMXResourceConfig.h:261
Contains the configuration data for a VMXResource whose VMXResourceType is AnalogTrigger.
Definition: VMXResourceConfig.h:347
VMX Resource providing Oversampling/Averaging of a VMX Analog Input Channel.
Definition: VMXResource.h:44
CaptureEdge GetCaptureEdge()
Returns the configured PWM CaptureEdge.
Definition: VMXResourceConfig.h:240
OutputMode GetOutputMode()
Returns output mode; only valid if this DIOConfig represents a DigitalIO in output mode...
Definition: VMXResourceConfig.h:155
void SetFrequencyHz(uint32_t frequency_hz)
Sets the PWM Generator&#39;s frequency in Hz.
Definition: VMXResourceConfig.h:205