24 kTimeout = HAL_DMA_TIMEOUT,
25 kError = HAL_DMA_ERROR
37 return units::second_t{
static_cast<double>(
GetTime()) * 1.0e-6};
46 val *= encoder->DecodingScaleFactor();
111static_assert(std::is_standard_layout_v<frc::DMASample>,
112 "frc::DMASample must have standard layout");
Class for counting the number of ticks on a digital input channel.
Definition: Counter.h:35
hal::Handle< HAL_CounterHandle > m_counter
Definition: Counter.h:433
Definition: DMASample.h:20
double GetEncoderDistance(const Encoder *encoder, int32_t *status) const
Definition: DMASample.h:44
double GetAveragedAnalogInputVoltage(const AnalogInput *analogInput, int32_t *status)
Definition: DMASample.h:86
void GetAnalogAccumulator(const AnalogInput *analogInput, int64_t *count, int64_t *value, int32_t *status) const
Definition: DMASample.h:93
int32_t GetCounter(const Counter *counter, int32_t *status) const
Definition: DMASample.h:55
int32_t GetCounterPeriod(const Counter *counter, int32_t *status) const
Definition: DMASample.h:59
uint64_t GetTime() const
Definition: DMASample.h:34
bool GetDigitalSource(const DigitalSource *digitalSource, int32_t *status) const
Definition: DMASample.h:63
int32_t GetEncoderRaw(const Encoder *encoder, int32_t *status) const
Definition: DMASample.h:40
double GetDutyCycleOutput(const DutyCycle *dutyCycle, int32_t *status)
Definition: DMASample.h:105
int32_t GetAveragedAnalogInputRaw(const AnalogInput *analogInput, int32_t *status) const
Definition: DMASample.h:80
int32_t GetDutyCycleOutputRaw(const DutyCycle *dutyCycle, int32_t *status) const
Definition: DMASample.h:99
int32_t GetEncoderPeriodRaw(const Encoder *encoder, int32_t *status) const
Definition: DMASample.h:51
DMAReadStatus
Definition: DMASample.h:22
double GetAnalogInputVoltage(const AnalogInput *analogInput, int32_t *status)
Definition: DMASample.h:74
units::second_t GetTimeStamp() const
Definition: DMASample.h:36
int32_t GetAnalogInputRaw(const AnalogInput *analogInput, int32_t *status) const
Definition: DMASample.h:69
DMAReadStatus Update(const DMA *dma, units::second_t timeout, int32_t *remaining, int32_t *status)
Definition: DMASample.h:28
DigitalSource Interface.
Definition: DigitalSource.h:22
virtual HAL_Handle GetPortHandleForRouting() const =0
Class to read a duty cycle PWM input.
Definition: DutyCycle.h:31
unsigned int GetOutputScaleFactor() const
Get the scale factor of the output.
Class to read quad encoders.
Definition: Encoder.h:41
double GetDistancePerPulse() const
Get the distance per pulse for this encoder.
constexpr auto count() -> size_t
Definition: core.h:1204
int32_t HAL_GetDMASampleDutyCycleOutputRaw(const HAL_DMASample *dmaSample, HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Returns the raw duty cycle input ratio data from the sample.
enum HAL_DMAReadStatus HAL_ReadDMA(HAL_DMAHandle handle, HAL_DMASample *dmaSample, double timeoutSeconds, int32_t *remainingOut, int32_t *status)
Reads a DMA sample from the queue.
int32_t HAL_GetDMASampleAveragedAnalogInputRaw(const HAL_DMASample *dmaSample, HAL_AnalogInputHandle aInHandle, int32_t *status)
Returns the raw averaged analog data for an analog input from the sample.
HAL_Bool HAL_GetDMASampleDigitalSource(const HAL_DMASample *dmaSample, HAL_Handle dSourceHandle, int32_t *status)
Returns the state of a digital source from the sample.
int32_t HAL_GetDMASampleEncoderPeriodRaw(const HAL_DMASample *dmaSample, HAL_EncoderHandle encoderHandle, int32_t *status)
Returns the raw period data for an encoder from the sample.
int32_t HAL_GetDMASampleCounter(const HAL_DMASample *dmaSample, HAL_CounterHandle counterHandle, int32_t *status)
Returns the distance data for an counter from the sample.
int32_t HAL_GetDMASampleCounterPeriod(const HAL_DMASample *dmaSample, HAL_CounterHandle counterHandle, int32_t *status)
Returns the period data for an counter from the sample.
int32_t HAL_GetDMASampleAnalogInputRaw(const HAL_DMASample *dmaSample, HAL_AnalogInputHandle aInHandle, int32_t *status)
Returns the raw analog data for an analog input from the sample.
void HAL_GetDMASampleAnalogAccumulator(const HAL_DMASample *dmaSample, HAL_AnalogInputHandle aInHandle, int64_t *count, int64_t *value, int32_t *status)
Returns the analog accumulator data for an analog input from the sample.
int32_t HAL_GetDMASampleEncoderRaw(const HAL_DMASample *dmaSample, HAL_EncoderHandle encoderHandle, int32_t *status)
Returns the raw distance data for an encoder from the sample.
::uint64_t uint64_t
Definition: Meta.h:58
::int32_t int32_t
Definition: Meta.h:57
::int64_t int64_t
Definition: Meta.h:59
Definition: AprilTagFieldLayout.h:22
GHC_FS_API file_status status(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4892
Buffer for containing all DMA data for a specific sample.
Definition: DMA.h:30
uint64_t timeStamp
Definition: DMA.h:33