A structure for storing device modes. More...
#include <Robots/SeaBeeIII/IMUDataServer/cmtdef.h>
Public Member Functions | |
CmtDeviceMode (const CmtOutputMode mode=CMT_DEFAULT_OUTPUT_MODE, const CmtOutputSettings settings=CMT_DEFAULT_OUTPUT_SETTINGS, const uint16_t frequency=CMT_DEFAULT_SAMPLE_FREQUENCY) | |
default constructor, initializes to the given (default) MT settings | |
void | getPeriodAndSkipFactor (uint16_t &period, uint16_t &skip) const |
Compute the period and skip factor. | |
double | getRealSampleFrequency (void) const |
Return the real sample frequency in Hz. | |
void | setPeriodAndSkipFactor (uint16_t period, uint16_t skip) |
Compute the sample frequency from a period and skip factor. | |
bool | operator== (const CmtDeviceMode &dev) const |
Check if all fields of the two structures are equal. | |
Public Attributes | |
CmtOutputMode | m_outputMode |
CmtOutputSettings | m_outputSettings |
uint16_t | m_sampleFrequency |
A structure for storing device modes.
Definition at line 1029 of file cmtdef.h.
CmtDeviceMode::CmtDeviceMode | ( | const CmtOutputMode | mode = CMT_DEFAULT_OUTPUT_MODE , |
|
const CmtOutputSettings | settings = CMT_DEFAULT_OUTPUT_SETTINGS , |
|||
const uint16_t | frequency = CMT_DEFAULT_SAMPLE_FREQUENCY | |||
) | [inline] |
void CmtDeviceMode::getPeriodAndSkipFactor | ( | uint16_t & | period, | |
uint16_t & | skip | |||
) | const |
Compute the period and skip factor.
This function computes the period and skipFactor fields from the stored m_sampleFrequency field. The maximum error in the frequency is approximately 0.4%, which occurs at 510Hz (= actually 512 Hz). In general, the higher frequencies are harder to set up exactly.
Definition at line 85 of file cmt3.cpp.
Referenced by getRealSampleFrequency().
double CmtDeviceMode::getRealSampleFrequency | ( | void | ) | const |
Return the real sample frequency in Hz.
This may be up to 2Hz different from the value that is set.
Definition at line 121 of file cmt3.cpp.
References getPeriodAndSkipFactor().
bool CmtDeviceMode::operator== | ( | const CmtDeviceMode & | dev | ) | const |
void CmtDeviceMode::setPeriodAndSkipFactor | ( | uint16_t | period, | |
uint16_t | skip | |||
) |