Package edu.wpi.first.wpilibj
Class DMASample
java.lang.Object
edu.wpi.first.wpilibj.DMASample
public class DMASample extends Object
DMA sample.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DMASample.DMAReadStatus
DMA read status. -
Constructor Summary
Constructors Constructor Description DMASample()
Default constructor. -
Method Summary
Modifier and Type Method Description int
getAnalogInputRaw(AnalogInput analogInput)
Returns raw analog input value from DMA.double
getAnalogInputVoltage(AnalogInput analogInput)
Returns analog input voltage from DMA.int
getAveragedAnalogInputRaw(AnalogInput analogInput)
Returns averaged raw analog input value from DMA.double
getAveragedAnalogInputVoltage(AnalogInput analogInput)
Returns averaged analog input voltage from DMA.int
getCaptureSize()
Returns the DMA sample capture size.int
getCounter(Counter counter)
Returns counter value from DMA.int
getCounterPeriod(Counter counter)
Returns counter period from DMA.boolean
getDigitalSource(DigitalSource digitalSource)
Returns digital source value from DMA.double
getDutyCycleOutput(DutyCycle dutyCycle)
Returns duty cycle output (0-1) from DMA.int
getDutyCycleOutputRaw(DutyCycle dutyCycle)
Returns raw duty cycle output from DMA.double
getEncoderDistance(Encoder encoder)
Returns encoder distance from DMA.int
getEncoderPeriodRaw(Encoder encoder)
Returns raw encoder period from DMA.int
getEncoderRaw(Encoder encoder)
Returns raw encoder value from DMA.int
getRemaining()
Returns the number of remaining samples.long
getTime()
Returns the DMA sample time in microseconds.double
getTimeStamp()
Returns the DMA sample timestamp in seconds.int
getTriggerChannels()
Returns the number of DMA trigger channels.DMASample.DMAReadStatus
update(DMA dma, double timeoutSeconds)
Retrieves a new DMA sample.
-
Constructor Details
-
Method Details
-
update
Retrieves a new DMA sample.- Parameters:
dma
- DMA object.timeoutSeconds
- Timeout in seconds for retrieval.- Returns:
- DMA read status.
-
getTime
Returns the DMA sample time in microseconds.- Returns:
- The DMA sample time in microseconds.
-
getTimeStamp
Returns the DMA sample timestamp in seconds.- Returns:
- The DMA sample timestamp in seconds.
-
getCaptureSize
Returns the DMA sample capture size.- Returns:
- The DMA sample capture size.
-
getTriggerChannels
Returns the number of DMA trigger channels.- Returns:
- The number of DMA trigger channels.
-
getRemaining
Returns the number of remaining samples.- Returns:
- The number of remaining samples.
-
getEncoderRaw
Returns raw encoder value from DMA.- Parameters:
encoder
- Encoder used for DMA.- Returns:
- Raw encoder value from DMA.
-
getEncoderDistance
Returns encoder distance from DMA.- Parameters:
encoder
- Encoder used for DMA.- Returns:
- Encoder distance from DMA.
-
getEncoderPeriodRaw
Returns raw encoder period from DMA.- Parameters:
encoder
- Encoder used for DMA.- Returns:
- Raw encoder period from DMA.
-
getCounter
Returns counter value from DMA.- Parameters:
counter
- Counter used for DMA.- Returns:
- Counter value from DMA.
-
getCounterPeriod
Returns counter period from DMA.- Parameters:
counter
- Counter used for DMA.- Returns:
- Counter period from DMA.
-
getDigitalSource
Returns digital source value from DMA.- Parameters:
digitalSource
- DigitalSource used for DMA.- Returns:
- DigitalSource value from DMA.
-
getAnalogInputRaw
Returns raw analog input value from DMA.- Parameters:
analogInput
- AnalogInput used for DMA.- Returns:
- Raw analog input value from DMA.
-
getAnalogInputVoltage
Returns analog input voltage from DMA.- Parameters:
analogInput
- AnalogInput used for DMA.- Returns:
- Analog input voltage from DMA.
-
getAveragedAnalogInputRaw
Returns averaged raw analog input value from DMA.- Parameters:
analogInput
- AnalogInput used for DMA.- Returns:
- Averaged raw analog input value from DMA.
-
getAveragedAnalogInputVoltage
Returns averaged analog input voltage from DMA.- Parameters:
analogInput
- AnalogInput used for DMA.- Returns:
- Averaged analog input voltage from DMA.
-
getDutyCycleOutputRaw
Returns raw duty cycle output from DMA.- Parameters:
dutyCycle
- DutyCycle used for DMA.- Returns:
- Raw duty cycle output from DMA.
-
getDutyCycleOutput
Returns duty cycle output (0-1) from DMA.- Parameters:
dutyCycle
- DutyCycle used for DMA.- Returns:
- Duty cycle output (0-1) from DMA.
-