10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/SPIAccelerometerData.h"
24 std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerActiveCallback);
28 store->SetUid(HALSIM_RegisterSPIAccelerometerActiveCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetActive() {
return HALSIM_GetSPIAccelerometerActive(m_index); }
33 void SetActive(
bool active) {
34 HALSIM_SetSPIAccelerometerActive(m_index, active);
37 std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerRangeCallback);
41 store->SetUid(HALSIM_RegisterSPIAccelerometerRangeCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
45 int GetRange() {
return HALSIM_GetSPIAccelerometerRange(m_index); }
46 void SetRange(
int range) { HALSIM_SetSPIAccelerometerRange(m_index, range); }
48 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
50 auto store = std::make_unique<CallbackStore>(
51 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerXCallback);
52 store->SetUid(HALSIM_RegisterSPIAccelerometerXCallback(
53 m_index, &CallbackStoreThunk, store.get(), initialNotify));
56 double GetX() {
return HALSIM_GetSPIAccelerometerX(m_index); }
57 void SetX(
double x) { HALSIM_SetSPIAccelerometerX(m_index, x); }
59 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
61 auto store = std::make_unique<CallbackStore>(
62 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerYCallback);
63 store->SetUid(HALSIM_RegisterSPIAccelerometerYCallback(
64 m_index, &CallbackStoreThunk, store.get(), initialNotify));
67 double GetY() {
return HALSIM_GetSPIAccelerometerY(m_index); }
68 void SetY(
double y) { HALSIM_SetSPIAccelerometerY(m_index, y); }
70 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
72 auto store = std::make_unique<CallbackStore>(
73 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerZCallback);
74 store->SetUid(HALSIM_RegisterSPIAccelerometerZCallback(
75 m_index, &CallbackStoreThunk, store.get(), initialNotify));
78 double GetZ() {
return HALSIM_GetSPIAccelerometerZ(m_index); }
79 void SetZ(
double z) { HALSIM_SetSPIAccelerometerZ(m_index, z); }
81 void ResetData() { HALSIM_ResetSPIAccelerometerData(m_index); }
88 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: SPIAccelerometerSim.h:20