WPILibC++ 2024.3.2
frc::DMA Class Reference

Class for configuring Direct Memory Access (DMA) of FPGA inputs. More...

#include <frc/DMA.h>

Public Member Functions

 DMA ()
 
 ~DMA ()
 
DMAoperator= (DMA &&other)=default
 
 DMA (DMA &&other)=default
 
void SetPause (bool pause)
 Sets whether DMA is paused. More...
 
void SetTimedTrigger (units::second_t period)
 Sets DMA to trigger at an interval. More...
 
void SetTimedTriggerCycles (int cycles)
 Sets number of DMA cycles to trigger. More...
 
void AddEncoder (const Encoder *encoder)
 Adds position data for an encoder to be collected by DMA. More...
 
void AddEncoderPeriod (const Encoder *encoder)
 Adds timer data for an encoder to be collected by DMA. More...
 
void AddCounter (const Counter *counter)
 Adds position data for an counter to be collected by DMA. More...
 
void AddCounterPeriod (const Counter *counter)
 Adds timer data for an counter to be collected by DMA. More...
 
void AddDigitalSource (const DigitalSource *digitalSource)
 Adds a digital source to be collected by DMA. More...
 
void AddDutyCycle (const DutyCycle *digitalSource)
 Adds a digital source to be collected by DMA. More...
 
void AddAnalogInput (const AnalogInput *analogInput)
 Adds an analog input to be collected by DMA. More...
 
void AddAveragedAnalogInput (const AnalogInput *analogInput)
 Adds averaged data of an analog input to be collected by DMA. More...
 
void AddAnalogAccumulator (const AnalogInput *analogInput)
 Adds accumulator data of an analog input to be collected by DMA. More...
 
int SetExternalTrigger (DigitalSource *source, bool rising, bool falling)
 Sets an external DMA trigger. More...
 
int SetPwmEdgeTrigger (PWM *pwm, bool rising, bool falling)
 Sets a DMA PWM edge trigger. More...
 
int SetPwmEdgeTrigger (PWMMotorController *pwm, bool rising, bool falling)
 Sets a DMA PWMMotorController edge trigger. More...
 
void ClearSensors ()
 Clear all sensors from the DMA collection list. More...
 
void ClearExternalTriggers ()
 Clear all external triggers from the DMA trigger list. More...
 
void Start (int queueDepth)
 Starts DMA Collection. More...
 
void Stop ()
 Stops DMA Collection. More...
 

Friends

class DMASample
 

Detailed Description

Class for configuring Direct Memory Access (DMA) of FPGA inputs.

Constructor & Destructor Documentation

◆ DMA() [1/2]

frc::DMA::DMA ( )

◆ ~DMA()

frc::DMA::~DMA ( )

◆ DMA() [2/2]

frc::DMA::DMA ( DMA &&  other)
default

Member Function Documentation

◆ AddAnalogAccumulator()

void frc::DMA::AddAnalogAccumulator ( const AnalogInput analogInput)

Adds accumulator data of an analog input to be collected by DMA.

This can only be called if DMA is not started.

Parameters
analogInputAnalogInput to add to DMA.

◆ AddAnalogInput()

void frc::DMA::AddAnalogInput ( const AnalogInput analogInput)

Adds an analog input to be collected by DMA.

This can only be called if DMA is not started.

Parameters
analogInputAnalogInput to add to DMA.

◆ AddAveragedAnalogInput()

void frc::DMA::AddAveragedAnalogInput ( const AnalogInput analogInput)

Adds averaged data of an analog input to be collected by DMA.

This can only be called if DMA is not started.

Parameters
analogInputAnalogInput to add to DMA.

◆ AddCounter()

void frc::DMA::AddCounter ( const Counter counter)

Adds position data for an counter to be collected by DMA.

This can only be called if DMA is not started.

Parameters
counterCounter to add to DMA.

◆ AddCounterPeriod()

void frc::DMA::AddCounterPeriod ( const Counter counter)

Adds timer data for an counter to be collected by DMA.

This can only be called if DMA is not started.

Parameters
counterCounter to add to DMA.

◆ AddDigitalSource()

void frc::DMA::AddDigitalSource ( const DigitalSource digitalSource)

Adds a digital source to be collected by DMA.

This can only be called if DMA is not started.

Parameters
digitalSourceDigitalSource to add to DMA.

◆ AddDutyCycle()

void frc::DMA::AddDutyCycle ( const DutyCycle digitalSource)

Adds a digital source to be collected by DMA.

This can only be called if DMA is not started.

Parameters
digitalSourceDigitalSource to add to DMA.

◆ AddEncoder()

void frc::DMA::AddEncoder ( const Encoder encoder)

Adds position data for an encoder to be collected by DMA.

This can only be called if DMA is not started.

Parameters
encoderEncoder to add to DMA.

◆ AddEncoderPeriod()

void frc::DMA::AddEncoderPeriod ( const Encoder encoder)

Adds timer data for an encoder to be collected by DMA.

This can only be called if DMA is not started.

Parameters
encoderEncoder to add to DMA.

◆ ClearExternalTriggers()

void frc::DMA::ClearExternalTriggers ( )

Clear all external triggers from the DMA trigger list.

This can only be called if DMA is not started.

◆ ClearSensors()

void frc::DMA::ClearSensors ( )

Clear all sensors from the DMA collection list.

This can only be called if DMA is not started.

◆ operator=()

DMA & frc::DMA::operator= ( DMA &&  other)
default

◆ SetExternalTrigger()

int frc::DMA::SetExternalTrigger ( DigitalSource source,
bool  rising,
bool  falling 
)

Sets an external DMA trigger.

Parameters
sourcethe source to trigger from.
risingtrigger on rising edge.
fallingtrigger on falling edge.
Returns
the index of the trigger

◆ SetPause()

void frc::DMA::SetPause ( bool  pause)

Sets whether DMA is paused.

Parameters
pauseTrue pauses DMA.

◆ SetPwmEdgeTrigger() [1/2]

int frc::DMA::SetPwmEdgeTrigger ( PWM pwm,
bool  rising,
bool  falling 
)

Sets a DMA PWM edge trigger.

Parameters
pwmthe PWM to trigger from.
risingtrigger on rising edge.
fallingtrigger on falling edge.
Returns
the index of the trigger

◆ SetPwmEdgeTrigger() [2/2]

int frc::DMA::SetPwmEdgeTrigger ( PWMMotorController pwm,
bool  rising,
bool  falling 
)

Sets a DMA PWMMotorController edge trigger.

Parameters
pwmthe PWMMotorController to trigger from.
risingtrigger on rising edge.
fallingtrigger on falling edge.
Returns
the index of the trigger

◆ SetTimedTrigger()

void frc::DMA::SetTimedTrigger ( units::second_t  period)

Sets DMA to trigger at an interval.

Parameters
periodPeriod at which to trigger DMA.

◆ SetTimedTriggerCycles()

void frc::DMA::SetTimedTriggerCycles ( int  cycles)

Sets number of DMA cycles to trigger.

Parameters
cyclesNumber of cycles.

◆ Start()

void frc::DMA::Start ( int  queueDepth)

Starts DMA Collection.

Parameters
queueDepthThe number of objects to be able to queue.

◆ Stop()

void frc::DMA::Stop ( )

Stops DMA Collection.

Friends And Related Function Documentation

◆ DMASample

friend class DMASample
friend

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