MRPT  1.9.9
CmtDeviceMode Struct Reference

Detailed Description

A structure for storing device modes.

Definition at line 1004 of file cmtdef.h.

#include <xSens_MT3/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 More...
 
void getPeriodAndSkipFactor (uint16_t &period, uint16_t &skip) const
 Compute the period and skip factor. More...
 
double getRealSampleFrequency (void) const
 Return the real sample frequency in Hz. More...
 
void setPeriodAndSkipFactor (uint16_t period, uint16_t skip)
 Compute the sample frequency from a period and skip factor. More...
 
bool operator== (const CmtDeviceMode &dev) const
 Check if all fields of the two structures are equal. More...
 

Public Attributes

CmtOutputMode m_outputMode
 
CmtOutputSettings m_outputSettings
 
uint16_t m_sampleFrequency
 

Constructor & Destructor Documentation

◆ CmtDeviceMode()

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

default constructor, initializes to the given (default) MT settings

Definition at line 1012 of file cmtdef.h.

Member Function Documentation

◆ getPeriodAndSkipFactor()

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 93 of file cmt3.cpp.

References m_sampleFrequency.

Referenced by getRealSampleFrequency().

◆ 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 125 of file cmt3.cpp.

References getPeriodAndSkipFactor().

◆ operator==()

bool CmtDeviceMode::operator== ( const CmtDeviceMode dev) const

Check if all fields of the two structures are equal.

Definition at line 142 of file cmt3.cpp.

References m_outputMode, m_outputSettings, and m_sampleFrequency.

◆ setPeriodAndSkipFactor()

void CmtDeviceMode::setPeriodAndSkipFactor ( uint16_t  period,
uint16_t  skip 
)

Compute the sample frequency from a period and skip factor.

This function does the reverse of the getPeriodAndSkipFactor function, storing the value in the m_sampleFrequency field.

Definition at line 134 of file cmt3.cpp.

References m_sampleFrequency.

Member Data Documentation

◆ m_outputMode

CmtOutputMode CmtDeviceMode::m_outputMode

Definition at line 1006 of file cmtdef.h.

Referenced by operator==().

◆ m_outputSettings

CmtOutputSettings CmtDeviceMode::m_outputSettings

Definition at line 1007 of file cmtdef.h.

Referenced by operator==().

◆ m_sampleFrequency

uint16_t CmtDeviceMode::m_sampleFrequency

Definition at line 1008 of file cmtdef.h.

Referenced by getPeriodAndSkipFactor(), operator==(), and setPeriodAndSkipFactor().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020