Contains the configuration data for a VMXResource whose VMXResourceType is SPI.
More...
#include <VMXResourceConfig.h>
|
| SPIConfig () |
| SPIConfig default constructor; sets all values to defaults (1Mhz SPI Click, Mode 3, CS Active Low, MSBFirst.
|
|
| SPIConfig (uint32_t bitrate) |
| SPIConfig constructor; initializes bitrate, sets remaining value to defaults. More...
|
|
| SPIConfig (uint32_t bitrate, uint8_t mode, bool cs_active_low, bool msbfirst) |
| SPIConfig constructor; initializes values with the provided input parameters *. More...
|
|
uint32_t | GetBitrate () |
| Returns the configured SPI bitrate.
|
|
uint8_t | GetMode () |
| Returns the configure SPI mode.
|
|
bool | GetCSActiveLow () |
| Returns true if the SPI CS is active low; false if the SPI CS is active high.
|
|
bool | GetMSBFirst () |
| Returns true if the most-significant bit is transmitted first; false if the least-significant bit is transmitted first.
|
|
void | SetBitrate (uint32_t bitrate) |
| Sets the configured SPI bitrate.
|
|
void | SetMode (uint8_t mode) |
| Sets the configured SPI mode, which must be a value from 0-3. More...
|
|
void | SetCSActiveLow (bool cs_active_low) |
| Sets the SPI CS Active low if true, Active high if false.
|
|
void | SetMSBFirst (bool msbfirst) |
| Sets the SPI bit transmit order to most-significant bit first if true; least-significant bit order is used if false.
|
|
virtual VMXResourceConfig * | GetCopy () 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...
|
|
| VMXResourceConfig (VMXResourceType res_type) |
|
VMXResourceType | GetResourceType () const |
| VMXResourceType which this configuration applies to.
|
|
|
uint32_t | bitrate_bps |
|
uint8_t | mode |
|
bool | cs_active_low |
|
bool | msbfirst |
|
VMXResourceType | res_type |
|
Contains the configuration data for a VMXResource whose VMXResourceType is SPI.
◆ SPIConfig() [1/2]
SPIConfig::SPIConfig |
( |
uint32_t |
bitrate | ) |
|
|
inline |
SPIConfig constructor; initializes bitrate, sets remaining value to defaults.
- Parameters
-
bitrate | The SPI Clock Bitrate |
◆ SPIConfig() [2/2]
SPIConfig::SPIConfig |
( |
uint32_t |
bitrate, |
|
|
uint8_t |
mode, |
|
|
bool |
cs_active_low, |
|
|
bool |
msbfirst |
|
) |
| |
|
inline |
SPIConfig constructor; initializes values with the provided input parameters *.
- Parameters
-
bitrate | The SPI Clock bitrate |
mode | The SPI Mode (0-3) |
cs_active_low | true if the SPI CS signal is active low; false if SPI CS signal is active high |
msbvirst | true if the most significant Bit is transmitted first, false if the least-significant bit is transmitted first |
◆ Copy()
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_config | The source VMXResourceConfig object from which to copy configuration data into this object. |
Implements VMXResourceConfig.
◆ GetCopy()
Instantiates a copy of the configuration data.
NOTE: The caller is responsible to delete the object returned from this method.
Implements VMXResourceConfig.
◆ SetMode()
void SPIConfig::SetMode |
( |
uint8_t |
mode | ) |
|
|
inline |
Sets the configured SPI mode, which must be a value from 0-3.
Invalid mode input values are coerced to a value from 0-3.
The documentation for this struct was generated from the following file: