Class DMASample

java.lang.Object
edu.wpi.first.wpilibj.DMASample

public class DMASample extends Object
DMA sample.
  • Constructor Details

    • DMASample

      public DMASample()
      Default constructor.
  • Method Details

    • update

      public DMASample.DMAReadStatus update(DMA dma, double timeoutSeconds)
      Retrieves a new DMA sample.
      Parameters:
      dma - DMA object.
      timeoutSeconds - Timeout in seconds for retrieval.
      Returns:
      DMA read status.
    • getTime

      public long getTime()
      Returns the DMA sample time in microseconds.
      Returns:
      The DMA sample time in microseconds.
    • getTimeStamp

      public double getTimeStamp()
      Returns the DMA sample timestamp in seconds.
      Returns:
      The DMA sample timestamp in seconds.
    • getCaptureSize

      public int getCaptureSize()
      Returns the DMA sample capture size.
      Returns:
      The DMA sample capture size.
    • getTriggerChannels

      public int getTriggerChannels()
      Returns the number of DMA trigger channels.
      Returns:
      The number of DMA trigger channels.
    • getRemaining

      public int getRemaining()
      Returns the number of remaining samples.
      Returns:
      The number of remaining samples.
    • getEncoderRaw

      public int getEncoderRaw(Encoder encoder)
      Returns raw encoder value from DMA.
      Parameters:
      encoder - Encoder used for DMA.
      Returns:
      Raw encoder value from DMA.
    • getEncoderDistance

      public double getEncoderDistance(Encoder encoder)
      Returns encoder distance from DMA.
      Parameters:
      encoder - Encoder used for DMA.
      Returns:
      Encoder distance from DMA.
    • getEncoderPeriodRaw

      public int getEncoderPeriodRaw(Encoder encoder)
      Returns raw encoder period from DMA.
      Parameters:
      encoder - Encoder used for DMA.
      Returns:
      Raw encoder period from DMA.
    • getCounter

      public int getCounter(Counter counter)
      Returns counter value from DMA.
      Parameters:
      counter - Counter used for DMA.
      Returns:
      Counter value from DMA.
    • getCounterPeriod

      public int getCounterPeriod(Counter counter)
      Returns counter period from DMA.
      Parameters:
      counter - Counter used for DMA.
      Returns:
      Counter period from DMA.
    • getDigitalSource

      public boolean getDigitalSource(DigitalSource digitalSource)
      Returns digital source value from DMA.
      Parameters:
      digitalSource - DigitalSource used for DMA.
      Returns:
      DigitalSource value from DMA.
    • getAnalogInputRaw

      public int getAnalogInputRaw(AnalogInput analogInput)
      Returns raw analog input value from DMA.
      Parameters:
      analogInput - AnalogInput used for DMA.
      Returns:
      Raw analog input value from DMA.
    • getAnalogInputVoltage

      public double getAnalogInputVoltage(AnalogInput analogInput)
      Returns analog input voltage from DMA.
      Parameters:
      analogInput - AnalogInput used for DMA.
      Returns:
      Analog input voltage from DMA.
    • getAveragedAnalogInputRaw

      public int getAveragedAnalogInputRaw(AnalogInput analogInput)
      Returns averaged raw analog input value from DMA.
      Parameters:
      analogInput - AnalogInput used for DMA.
      Returns:
      Averaged raw analog input value from DMA.
    • getAveragedAnalogInputVoltage

      public double getAveragedAnalogInputVoltage(AnalogInput analogInput)
      Returns averaged analog input voltage from DMA.
      Parameters:
      analogInput - AnalogInput used for DMA.
      Returns:
      Averaged analog input voltage from DMA.
    • getDutyCycleOutputRaw

      public int getDutyCycleOutputRaw(DutyCycle dutyCycle)
      Returns raw duty cycle output from DMA.
      Parameters:
      dutyCycle - DutyCycle used for DMA.
      Returns:
      Raw duty cycle output from DMA.
    • getDutyCycleOutput

      public double getDutyCycleOutput(DutyCycle dutyCycle)
      Returns duty cycle output (0-1) from DMA.
      Parameters:
      dutyCycle - DutyCycle used for DMA.
      Returns:
      Duty cycle output (0-1) from DMA.