WPILibC++ 2024.3.2
frc::DMASample Class Reference

DMA sample. More...

#include <frc/DMASample.h>

Inheritance diagram for frc::DMASample:
HAL_DMASample

Public Types

enum class  DMAReadStatus { kOk = HAL_DMA_OK , kTimeout = HAL_DMA_TIMEOUT , kError = HAL_DMA_ERROR }
 DMA read status. More...
 

Public Member Functions

DMAReadStatus Update (const DMA *dma, units::second_t timeout, int32_t *remaining, int32_t *status)
 Retrieves a new DMA sample. More...
 
uint64_t GetTime () const
 Returns the DMA sample time in microseconds. More...
 
units::second_t GetTimeStamp () const
 Returns the DMA sample timestamp. More...
 
int32_t GetEncoderRaw (const Encoder *encoder, int32_t *status) const
 Returns raw encoder value from DMA. More...
 
double GetEncoderDistance (const Encoder *encoder, int32_t *status) const
 Returns encoder distance from DMA. More...
 
int32_t GetEncoderPeriodRaw (const Encoder *encoder, int32_t *status) const
 Returns raw encoder period from DMA. More...
 
int32_t GetCounter (const Counter *counter, int32_t *status) const
 Returns counter value from DMA. More...
 
int32_t GetCounterPeriod (const Counter *counter, int32_t *status) const
 Returns counter period from DMA. More...
 
bool GetDigitalSource (const DigitalSource *digitalSource, int32_t *status) const
 Returns digital source value from DMA. More...
 
int32_t GetAnalogInputRaw (const AnalogInput *analogInput, int32_t *status) const
 Returns raw analog input value from DMA. More...
 
double GetAnalogInputVoltage (const AnalogInput *analogInput, int32_t *status)
 Returns analog input voltage from DMA. More...
 
int32_t GetAveragedAnalogInputRaw (const AnalogInput *analogInput, int32_t *status) const
 Returns averaged analog input raw value from DMA. More...
 
double GetAveragedAnalogInputVoltage (const AnalogInput *analogInput, int32_t *status)
 Returns averaged analog input voltage from DMA. More...
 
void GetAnalogAccumulator (const AnalogInput *analogInput, int64_t *count, int64_t *value, int32_t *status) const
 Returns analog accumulator value from DMA. More...
 
int32_t GetDutyCycleOutputRaw (const DutyCycle *dutyCycle, int32_t *status) const
 Returns raw duty cycle output from DMA. More...
 
double GetDutyCycleOutput (const DutyCycle *dutyCycle, int32_t *status)
 Returns duty cycle output (0-1) from DMA. More...
 

Additional Inherited Members

- Public Attributes inherited from HAL_DMASample
uint32_t readBuffer [74]
 
int32_t channelOffsets [22]
 
uint64_t timeStamp
 
uint32_t captureSize
 
uint8_t triggerChannels
 

Detailed Description

DMA sample.

Member Enumeration Documentation

◆ DMAReadStatus

enum class frc::DMASample::DMAReadStatus
strong

DMA read status.

Enumerator
kOk 

OK status.

kTimeout 

Timeout status.

kError 

Error status.

Member Function Documentation

◆ GetAnalogAccumulator()

void frc::DMASample::GetAnalogAccumulator ( const AnalogInput analogInput,
int64_t *  count,
int64_t *  value,
int32_t *  status 
) const
inline

Returns analog accumulator value from DMA.

Parameters
analogInputAnalogInput used for DMA.
countAccumulator sample count.
valueAccumulator value.
statusDMA read status.

◆ GetAnalogInputRaw()

int32_t frc::DMASample::GetAnalogInputRaw ( const AnalogInput analogInput,
int32_t *  status 
) const
inline

Returns raw analog input value from DMA.

Parameters
analogInputAnalogInput used for DMA.
statusDMA read status.
Returns
Raw analog input value from DMA.

◆ GetAnalogInputVoltage()

double frc::DMASample::GetAnalogInputVoltage ( const AnalogInput analogInput,
int32_t *  status 
)
inline

Returns analog input voltage from DMA.

Parameters
analogInputAnalogInput used for DMA.
statusDMA read status.
Returns
Analog input voltage from DMA.

◆ GetAveragedAnalogInputRaw()

int32_t frc::DMASample::GetAveragedAnalogInputRaw ( const AnalogInput analogInput,
int32_t *  status 
) const
inline

Returns averaged analog input raw value from DMA.

Parameters
analogInputAnalogInput used for DMA.
statusDMA read status.
Returns
Averaged analog input raw value from DMA.

◆ GetAveragedAnalogInputVoltage()

double frc::DMASample::GetAveragedAnalogInputVoltage ( const AnalogInput analogInput,
int32_t *  status 
)
inline

Returns averaged analog input voltage from DMA.

Parameters
analogInputAnalogInput used for DMA.
statusDMA read status.
Returns
Averaged analog input voltage from DMA.

◆ GetCounter()

int32_t frc::DMASample::GetCounter ( const Counter counter,
int32_t *  status 
) const
inline

Returns counter value from DMA.

Parameters
counterCounter used for DMA.
statusDMA read status.
Returns
Counter value from DMA.

◆ GetCounterPeriod()

int32_t frc::DMASample::GetCounterPeriod ( const Counter counter,
int32_t *  status 
) const
inline

Returns counter period from DMA.

Parameters
counterCounter used for DMA.
statusDMA read status.
Returns
Counter period from DMA.

◆ GetDigitalSource()

bool frc::DMASample::GetDigitalSource ( const DigitalSource digitalSource,
int32_t *  status 
) const
inline

Returns digital source value from DMA.

Parameters
digitalSourceDigitalSource used for DMA.
statusDMA read status.
Returns
DigitalSource value from DMA.

◆ GetDutyCycleOutput()

double frc::DMASample::GetDutyCycleOutput ( const DutyCycle dutyCycle,
int32_t *  status 
)
inline

Returns duty cycle output (0-1) from DMA.

Parameters
dutyCycleDutyCycle used for DMA.
statusDMA read status.
Returns
Duty cycle output (0-1) from DMA.

◆ GetDutyCycleOutputRaw()

int32_t frc::DMASample::GetDutyCycleOutputRaw ( const DutyCycle dutyCycle,
int32_t *  status 
) const
inline

Returns raw duty cycle output from DMA.

Parameters
dutyCycleDutyCycle used for DMA.
statusDMA read status.
Returns
Raw duty cycle output from DMA.

◆ GetEncoderDistance()

double frc::DMASample::GetEncoderDistance ( const Encoder encoder,
int32_t *  status 
) const
inline

Returns encoder distance from DMA.

Parameters
encoderEncoder used for DMA.
statusDMA read status.
Returns
Encoder distance from DMA.

◆ GetEncoderPeriodRaw()

int32_t frc::DMASample::GetEncoderPeriodRaw ( const Encoder encoder,
int32_t *  status 
) const
inline

Returns raw encoder period from DMA.

Parameters
encoderEncoder used for DMA.
statusDMA read status.
Returns
Raw encoder period from DMA.

◆ GetEncoderRaw()

int32_t frc::DMASample::GetEncoderRaw ( const Encoder encoder,
int32_t *  status 
) const
inline

Returns raw encoder value from DMA.

Parameters
encoderEncoder used for DMA.
statusDMA read status.
Returns
Raw encoder value from DMA.

◆ GetTime()

uint64_t frc::DMASample::GetTime ( ) const
inline

Returns the DMA sample time in microseconds.

Returns
The DMA sample time in microseconds.

◆ GetTimeStamp()

units::second_t frc::DMASample::GetTimeStamp ( ) const
inline

Returns the DMA sample timestamp.

Returns
The DMA sample timestamp.

◆ Update()

DMAReadStatus frc::DMASample::Update ( const DMA dma,
units::second_t  timeout,
int32_t *  remaining,
int32_t *  status 
)
inline

Retrieves a new DMA sample.

Parameters
dmaDMA object.
timeoutTimeout for retrieval.
remainingNumber of remaining samples.
statusDMA read status.

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