10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/RoboRioData.h"
22 explicit RoboRioSim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterFPGAButtonCallback(
25 NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelRoboRioFPGAButtonCallback);
28 store->SetUid(HALSIM_RegisterRoboRioFPGAButtonCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetFPGAButton() {
return HALSIM_GetRoboRioFPGAButton(m_index); }
33 void SetFPGAButton(
bool fPGAButton) {
34 HALSIM_SetRoboRioFPGAButton(m_index, fPGAButton);
37 std::unique_ptr<CallbackStore> RegisterVInVoltageCallback(
38 NotifyCallback callback,
bool initialNotify) {
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelRoboRioVInVoltageCallback);
41 store->SetUid(HALSIM_RegisterRoboRioVInVoltageCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
45 double GetVInVoltage() {
return HALSIM_GetRoboRioVInVoltage(m_index); }
46 void SetVInVoltage(
double vInVoltage) {
47 HALSIM_SetRoboRioVInVoltage(m_index, vInVoltage);
50 std::unique_ptr<CallbackStore> RegisterVInCurrentCallback(
51 NotifyCallback callback,
bool initialNotify) {
52 auto store = std::make_unique<CallbackStore>(
53 m_index, -1, callback, &HALSIM_CancelRoboRioVInCurrentCallback);
54 store->SetUid(HALSIM_RegisterRoboRioVInCurrentCallback(
55 m_index, &CallbackStoreThunk, store.get(), initialNotify));
58 double GetVInCurrent() {
return HALSIM_GetRoboRioVInCurrent(m_index); }
59 void SetVInCurrent(
double vInCurrent) {
60 HALSIM_SetRoboRioVInCurrent(m_index, vInCurrent);
63 std::unique_ptr<CallbackStore> RegisterUserVoltage6VCallback(
64 NotifyCallback callback,
bool initialNotify) {
65 auto store = std::make_unique<CallbackStore>(
66 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage6VCallback);
67 store->SetUid(HALSIM_RegisterRoboRioUserVoltage6VCallback(
68 m_index, &CallbackStoreThunk, store.get(), initialNotify));
71 double GetUserVoltage6V() {
return HALSIM_GetRoboRioUserVoltage6V(m_index); }
72 void SetUserVoltage6V(
double userVoltage6V) {
73 HALSIM_SetRoboRioUserVoltage6V(m_index, userVoltage6V);
76 std::unique_ptr<CallbackStore> RegisterUserCurrent6VCallback(
77 NotifyCallback callback,
bool initialNotify) {
78 auto store = std::make_unique<CallbackStore>(
79 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent6VCallback);
80 store->SetUid(HALSIM_RegisterRoboRioUserCurrent6VCallback(
81 m_index, &CallbackStoreThunk, store.get(), initialNotify));
84 double GetUserCurrent6V() {
return HALSIM_GetRoboRioUserCurrent6V(m_index); }
85 void SetUserCurrent6V(
double userCurrent6V) {
86 HALSIM_SetRoboRioUserCurrent6V(m_index, userCurrent6V);
89 std::unique_ptr<CallbackStore> RegisterUserActive6VCallback(
90 NotifyCallback callback,
bool initialNotify) {
91 auto store = std::make_unique<CallbackStore>(
92 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive6VCallback);
93 store->SetUid(HALSIM_RegisterRoboRioUserActive6VCallback(
94 m_index, &CallbackStoreThunk, store.get(), initialNotify));
97 bool GetUserActive6V() {
return HALSIM_GetRoboRioUserActive6V(m_index); }
98 void SetUserActive6V(
bool userActive6V) {
99 HALSIM_SetRoboRioUserActive6V(m_index, userActive6V);
102 std::unique_ptr<CallbackStore> RegisterUserVoltage5VCallback(
103 NotifyCallback callback,
bool initialNotify) {
104 auto store = std::make_unique<CallbackStore>(
105 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage5VCallback);
106 store->SetUid(HALSIM_RegisterRoboRioUserVoltage5VCallback(
107 m_index, &CallbackStoreThunk, store.get(), initialNotify));
110 double GetUserVoltage5V() {
return HALSIM_GetRoboRioUserVoltage5V(m_index); }
111 void SetUserVoltage5V(
double userVoltage5V) {
112 HALSIM_SetRoboRioUserVoltage5V(m_index, userVoltage5V);
115 std::unique_ptr<CallbackStore> RegisterUserCurrent5VCallback(
116 NotifyCallback callback,
bool initialNotify) {
117 auto store = std::make_unique<CallbackStore>(
118 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent5VCallback);
119 store->SetUid(HALSIM_RegisterRoboRioUserCurrent5VCallback(
120 m_index, &CallbackStoreThunk, store.get(), initialNotify));
123 double GetUserCurrent5V() {
return HALSIM_GetRoboRioUserCurrent5V(m_index); }
124 void SetUserCurrent5V(
double userCurrent5V) {
125 HALSIM_SetRoboRioUserCurrent5V(m_index, userCurrent5V);
128 std::unique_ptr<CallbackStore> RegisterUserActive5VCallback(
129 NotifyCallback callback,
bool initialNotify) {
130 auto store = std::make_unique<CallbackStore>(
131 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive5VCallback);
132 store->SetUid(HALSIM_RegisterRoboRioUserActive5VCallback(
133 m_index, &CallbackStoreThunk, store.get(), initialNotify));
136 bool GetUserActive5V() {
return HALSIM_GetRoboRioUserActive5V(m_index); }
137 void SetUserActive5V(
bool userActive5V) {
138 HALSIM_SetRoboRioUserActive5V(m_index, userActive5V);
141 std::unique_ptr<CallbackStore> RegisterUserVoltage3V3Callback(
142 NotifyCallback callback,
bool initialNotify) {
143 auto store = std::make_unique<CallbackStore>(
144 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage3V3Callback);
145 store->SetUid(HALSIM_RegisterRoboRioUserVoltage3V3Callback(
146 m_index, &CallbackStoreThunk, store.get(), initialNotify));
149 double GetUserVoltage3V3() {
150 return HALSIM_GetRoboRioUserVoltage3V3(m_index);
152 void SetUserVoltage3V3(
double userVoltage3V3) {
153 HALSIM_SetRoboRioUserVoltage3V3(m_index, userVoltage3V3);
156 std::unique_ptr<CallbackStore> RegisterUserCurrent3V3Callback(
157 NotifyCallback callback,
bool initialNotify) {
158 auto store = std::make_unique<CallbackStore>(
159 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent3V3Callback);
160 store->SetUid(HALSIM_RegisterRoboRioUserCurrent3V3Callback(
161 m_index, &CallbackStoreThunk, store.get(), initialNotify));
164 double GetUserCurrent3V3() {
165 return HALSIM_GetRoboRioUserCurrent3V3(m_index);
167 void SetUserCurrent3V3(
double userCurrent3V3) {
168 HALSIM_SetRoboRioUserCurrent3V3(m_index, userCurrent3V3);
171 std::unique_ptr<CallbackStore> RegisterUserActive3V3Callback(
172 NotifyCallback callback,
bool initialNotify) {
173 auto store = std::make_unique<CallbackStore>(
174 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive3V3Callback);
175 store->SetUid(HALSIM_RegisterRoboRioUserActive3V3Callback(
176 m_index, &CallbackStoreThunk, store.get(), initialNotify));
179 bool GetUserActive3V3() {
return HALSIM_GetRoboRioUserActive3V3(m_index); }
180 void SetUserActive3V3(
bool userActive3V3) {
181 HALSIM_SetRoboRioUserActive3V3(m_index, userActive3V3);
184 std::unique_ptr<CallbackStore> RegisterUserFaults6VCallback(
185 NotifyCallback callback,
bool initialNotify) {
186 auto store = std::make_unique<CallbackStore>(
187 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults6VCallback);
188 store->SetUid(HALSIM_RegisterRoboRioUserFaults6VCallback(
189 m_index, &CallbackStoreThunk, store.get(), initialNotify));
192 int GetUserFaults6V() {
return HALSIM_GetRoboRioUserFaults6V(m_index); }
193 void SetUserFaults6V(
int userFaults6V) {
194 HALSIM_SetRoboRioUserFaults6V(m_index, userFaults6V);
197 std::unique_ptr<CallbackStore> RegisterUserFaults5VCallback(
198 NotifyCallback callback,
bool initialNotify) {
199 auto store = std::make_unique<CallbackStore>(
200 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults5VCallback);
201 store->SetUid(HALSIM_RegisterRoboRioUserFaults5VCallback(
202 m_index, &CallbackStoreThunk, store.get(), initialNotify));
205 int GetUserFaults5V() {
return HALSIM_GetRoboRioUserFaults5V(m_index); }
206 void SetUserFaults5V(
int userFaults5V) {
207 HALSIM_SetRoboRioUserFaults5V(m_index, userFaults5V);
210 std::unique_ptr<CallbackStore> RegisterUserFaults3V3Callback(
211 NotifyCallback callback,
bool initialNotify) {
212 auto store = std::make_unique<CallbackStore>(
213 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults3V3Callback);
214 store->SetUid(HALSIM_RegisterRoboRioUserFaults3V3Callback(
215 m_index, &CallbackStoreThunk, store.get(), initialNotify));
218 int GetUserFaults3V3() {
return HALSIM_GetRoboRioUserFaults3V3(m_index); }
219 void SetUserFaults3V3(
int userFaults3V3) {
220 HALSIM_SetRoboRioUserFaults3V3(m_index, userFaults3V3);
223 void ResetData() { HALSIM_ResetRoboRioData(m_index); }
230 #endif // __FRC_ROBORIO__
Definition: SPIAccelerometerSim.h:18
Definition: RoboRioSim.h:20