mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal] Add support for DMA to Java (#3158)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hal/Types.h>
|
||||
#include <units/time.h>
|
||||
|
||||
namespace frc {
|
||||
class Encoder;
|
||||
@@ -13,6 +14,8 @@ class DigitalSource;
|
||||
class DutyCycle;
|
||||
class AnalogInput;
|
||||
class DMASample;
|
||||
class PWM;
|
||||
class PWMMotorController;
|
||||
|
||||
class DMA {
|
||||
friend class DMASample;
|
||||
@@ -25,7 +28,8 @@ class DMA {
|
||||
DMA(DMA&& other) = default;
|
||||
|
||||
void SetPause(bool pause);
|
||||
void SetRate(int cycles);
|
||||
void SetTimedTrigger(units::second_t seconds);
|
||||
void SetTimedTriggerCycles(int cycles);
|
||||
|
||||
void AddEncoder(const Encoder* encoder);
|
||||
void AddEncoderPeriod(const Encoder* encoder);
|
||||
@@ -41,10 +45,15 @@ class DMA {
|
||||
void AddAveragedAnalogInput(const AnalogInput* analogInput);
|
||||
void AddAnalogAccumulator(const AnalogInput* analogInput);
|
||||
|
||||
void SetExternalTrigger(DigitalSource* source, bool rising, bool falling);
|
||||
int SetExternalTrigger(DigitalSource* source, bool rising, bool falling);
|
||||
int SetPwmEdgeTrigger(PWM* pwm, bool rising, bool falling);
|
||||
int SetPwmEdgeTrigger(PWMMotorController* pwm, bool rising, bool falling);
|
||||
|
||||
void StartDMA(int queueDepth);
|
||||
void StopDMA();
|
||||
void ClearSensors();
|
||||
void ClearExternalTriggers();
|
||||
|
||||
void Start(int queueDepth);
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_DMAHandle> dmaHandle;
|
||||
|
||||
Reference in New Issue
Block a user