10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/AnalogInData.h"
22 explicit AnalogInSim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterInitializedCallback(
25 NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelAnalogInInitializedCallback);
28 store->SetUid(HALSIM_RegisterAnalogInInitializedCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetInitialized() {
return HALSIM_GetAnalogInInitialized(m_index); }
33 void SetInitialized(
bool initialized) {
34 HALSIM_SetAnalogInInitialized(m_index, initialized);
37 std::unique_ptr<CallbackStore> RegisterAverageBitsCallback(
38 NotifyCallback callback,
bool initialNotify) {
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelAnalogInAverageBitsCallback);
41 store->SetUid(HALSIM_RegisterAnalogInAverageBitsCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
45 int GetAverageBits() {
return HALSIM_GetAnalogInAverageBits(m_index); }
46 void SetAverageBits(
int averageBits) {
47 HALSIM_SetAnalogInAverageBits(m_index, averageBits);
50 std::unique_ptr<CallbackStore> RegisterOversampleBitsCallback(
51 NotifyCallback callback,
bool initialNotify) {
52 auto store = std::make_unique<CallbackStore>(
53 m_index, -1, callback, &HALSIM_CancelAnalogInOversampleBitsCallback);
54 store->SetUid(HALSIM_RegisterAnalogInOversampleBitsCallback(
55 m_index, &CallbackStoreThunk, store.get(), initialNotify));
58 int GetOversampleBits() {
return HALSIM_GetAnalogInOversampleBits(m_index); }
59 void SetOversampleBits(
int oversampleBits) {
60 HALSIM_SetAnalogInOversampleBits(m_index, oversampleBits);
63 std::unique_ptr<CallbackStore> RegisterVoltageCallback(
64 NotifyCallback callback,
bool initialNotify) {
65 auto store = std::make_unique<CallbackStore>(
66 m_index, -1, callback, &HALSIM_CancelAnalogInVoltageCallback);
67 store->SetUid(HALSIM_RegisterAnalogInVoltageCallback(
68 m_index, &CallbackStoreThunk, store.get(), initialNotify));
71 double GetVoltage() {
return HALSIM_GetAnalogInVoltage(m_index); }
72 void SetVoltage(
double voltage) {
73 HALSIM_SetAnalogInVoltage(m_index, voltage);
76 std::unique_ptr<CallbackStore> RegisterAccumulatorInitializedCallback(
77 NotifyCallback callback,
bool initialNotify) {
78 auto store = std::make_unique<CallbackStore>(
79 m_index, -1, callback,
80 &HALSIM_CancelAnalogInAccumulatorInitializedCallback);
81 store->SetUid(HALSIM_RegisterAnalogInAccumulatorInitializedCallback(
82 m_index, &CallbackStoreThunk, store.get(), initialNotify));
85 bool GetAccumulatorInitialized() {
86 return HALSIM_GetAnalogInAccumulatorInitialized(m_index);
88 void SetAccumulatorInitialized(
bool accumulatorInitialized) {
89 HALSIM_SetAnalogInAccumulatorInitialized(m_index, accumulatorInitialized);
92 std::unique_ptr<CallbackStore> RegisterAccumulatorValueCallback(
93 NotifyCallback callback,
bool initialNotify) {
94 auto store = std::make_unique<CallbackStore>(
95 m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorValueCallback);
96 store->SetUid(HALSIM_RegisterAnalogInAccumulatorValueCallback(
97 m_index, &CallbackStoreThunk, store.get(), initialNotify));
100 int64_t GetAccumulatorValue() {
101 return HALSIM_GetAnalogInAccumulatorValue(m_index);
103 void SetAccumulatorValue(int64_t accumulatorValue) {
104 HALSIM_SetAnalogInAccumulatorValue(m_index, accumulatorValue);
107 std::unique_ptr<CallbackStore> RegisterAccumulatorCountCallback(
108 NotifyCallback callback,
bool initialNotify) {
109 auto store = std::make_unique<CallbackStore>(
110 m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorCountCallback);
111 store->SetUid(HALSIM_RegisterAnalogInAccumulatorCountCallback(
112 m_index, &CallbackStoreThunk, store.get(), initialNotify));
115 int64_t GetAccumulatorCount() {
116 return HALSIM_GetAnalogInAccumulatorCount(m_index);
118 void SetAccumulatorCount(int64_t accumulatorCount) {
119 HALSIM_SetAnalogInAccumulatorCount(m_index, accumulatorCount);
122 std::unique_ptr<CallbackStore> RegisterAccumulatorCenterCallback(
123 NotifyCallback callback,
bool initialNotify) {
124 auto store = std::make_unique<CallbackStore>(
125 m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorCenterCallback);
126 store->SetUid(HALSIM_RegisterAnalogInAccumulatorCenterCallback(
127 m_index, &CallbackStoreThunk, store.get(), initialNotify));
130 int GetAccumulatorCenter() {
131 return HALSIM_GetAnalogInAccumulatorCenter(m_index);
133 void SetAccumulatorCenter(
int accumulatorCenter) {
134 HALSIM_SetAnalogInAccumulatorCenter(m_index, accumulatorCenter);
137 std::unique_ptr<CallbackStore> RegisterAccumulatorDeadbandCallback(
138 NotifyCallback callback,
bool initialNotify) {
139 auto store = std::make_unique<CallbackStore>(
140 m_index, -1, callback,
141 &HALSIM_CancelAnalogInAccumulatorDeadbandCallback);
142 store->SetUid(HALSIM_RegisterAnalogInAccumulatorDeadbandCallback(
143 m_index, &CallbackStoreThunk, store.get(), initialNotify));
146 int GetAccumulatorDeadband() {
147 return HALSIM_GetAnalogInAccumulatorDeadband(m_index);
149 void SetAccumulatorDeadband(
int accumulatorDeadband) {
150 HALSIM_SetAnalogInAccumulatorDeadband(m_index, accumulatorDeadband);
153 void ResetData() { HALSIM_ResetAnalogInData(m_index); }
160 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: AnalogInSim.h:20