10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/AccelerometerData.h"
24 std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelAccelerometerActiveCallback);
28 store->SetUid(HALSIM_RegisterAccelerometerActiveCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetActive() {
return HALSIM_GetAccelerometerActive(m_index); }
33 void SetActive(
bool active) {
34 HALSIM_SetAccelerometerActive(m_index, active);
37 std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelAccelerometerRangeCallback);
41 store->SetUid(HALSIM_RegisterAccelerometerRangeCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
45 HAL_AccelerometerRange GetRange() {
46 return HALSIM_GetAccelerometerRange(m_index);
48 void SetRange(HAL_AccelerometerRange range) {
49 HALSIM_SetAccelerometerRange(m_index, range);
52 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
54 auto store = std::make_unique<CallbackStore>(
55 m_index, -1, callback, &HALSIM_CancelAccelerometerXCallback);
56 store->SetUid(HALSIM_RegisterAccelerometerXCallback(
57 m_index, &CallbackStoreThunk, store.get(), initialNotify));
60 double GetX() {
return HALSIM_GetAccelerometerX(m_index); }
61 void SetX(
double x) { HALSIM_SetAccelerometerX(m_index, x); }
63 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
65 auto store = std::make_unique<CallbackStore>(
66 m_index, -1, callback, &HALSIM_CancelAccelerometerYCallback);
67 store->SetUid(HALSIM_RegisterAccelerometerYCallback(
68 m_index, &CallbackStoreThunk, store.get(), initialNotify));
71 double GetY() {
return HALSIM_GetAccelerometerY(m_index); }
72 void SetY(
double y) { HALSIM_SetAccelerometerY(m_index, y); }
74 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
76 auto store = std::make_unique<CallbackStore>(
77 m_index, -1, callback, &HALSIM_CancelAccelerometerZCallback);
78 store->SetUid(HALSIM_RegisterAccelerometerZCallback(
79 m_index, &CallbackStoreThunk, store.get(), initialNotify));
82 double GetZ() {
return HALSIM_GetAccelerometerZ(m_index); }
83 void SetZ(
double z) { HALSIM_SetAccelerometerZ(m_index, z); }
85 void ResetData() { HALSIM_ResetAccelerometerData(m_index); }
92 #endif // __FRC_ROBORIO__
Definition: SPIAccelerometerSim.h:18
Definition: AccelerometerSim.h:20