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));
33 bool GetActive()
const {
return HALSIM_GetSPIAccelerometerActive(m_index); }
35 void SetActive(
bool active) {
36 HALSIM_SetSPIAccelerometerActive(m_index, active);
39 std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
41 auto store = std::make_unique<CallbackStore>(
42 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerRangeCallback);
43 store->SetUid(HALSIM_RegisterSPIAccelerometerRangeCallback(
44 m_index, &CallbackStoreThunk, store.get(), initialNotify));
48 int GetRange()
const {
return HALSIM_GetSPIAccelerometerRange(m_index); }
50 void SetRange(
int range) { HALSIM_SetSPIAccelerometerRange(m_index, range); }
52 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
54 auto store = std::make_unique<CallbackStore>(
55 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerXCallback);
56 store->SetUid(HALSIM_RegisterSPIAccelerometerXCallback(
57 m_index, &CallbackStoreThunk, store.get(), initialNotify));
61 double GetX()
const {
return HALSIM_GetSPIAccelerometerX(m_index); }
63 void SetX(
double x) { HALSIM_SetSPIAccelerometerX(m_index, x); }
65 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
67 auto store = std::make_unique<CallbackStore>(
68 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerYCallback);
69 store->SetUid(HALSIM_RegisterSPIAccelerometerYCallback(
70 m_index, &CallbackStoreThunk, store.get(), initialNotify));
74 double GetY()
const {
return HALSIM_GetSPIAccelerometerY(m_index); }
76 void SetY(
double y) { HALSIM_SetSPIAccelerometerY(m_index, y); }
78 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
80 auto store = std::make_unique<CallbackStore>(
81 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerZCallback);
82 store->SetUid(HALSIM_RegisterSPIAccelerometerZCallback(
83 m_index, &CallbackStoreThunk, store.get(), initialNotify));
87 double GetZ()
const {
return HALSIM_GetSPIAccelerometerZ(m_index); }
89 void SetZ(
double z) { HALSIM_SetSPIAccelerometerZ(m_index, z); }
91 void ResetData() { HALSIM_ResetSPIAccelerometerData(m_index); }
98 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: SPIAccelerometerSim.h:20