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));
33 bool GetActive()
const {
return HALSIM_GetAccelerometerActive(m_index); }
35 void SetActive(
bool active) {
36 HALSIM_SetAccelerometerActive(m_index, active);
39 std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
41 auto store = std::make_unique<CallbackStore>(
42 m_index, -1, callback, &HALSIM_CancelAccelerometerRangeCallback);
43 store->SetUid(HALSIM_RegisterAccelerometerRangeCallback(
44 m_index, &CallbackStoreThunk, store.get(), initialNotify));
48 HAL_AccelerometerRange GetRange()
const {
49 return HALSIM_GetAccelerometerRange(m_index);
52 void SetRange(HAL_AccelerometerRange range) {
53 HALSIM_SetAccelerometerRange(m_index, range);
56 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
58 auto store = std::make_unique<CallbackStore>(
59 m_index, -1, callback, &HALSIM_CancelAccelerometerXCallback);
60 store->SetUid(HALSIM_RegisterAccelerometerXCallback(
61 m_index, &CallbackStoreThunk, store.get(), initialNotify));
65 double GetX()
const {
return HALSIM_GetAccelerometerX(m_index); }
67 void SetX(
double x) { HALSIM_SetAccelerometerX(m_index, x); }
69 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
71 auto store = std::make_unique<CallbackStore>(
72 m_index, -1, callback, &HALSIM_CancelAccelerometerYCallback);
73 store->SetUid(HALSIM_RegisterAccelerometerYCallback(
74 m_index, &CallbackStoreThunk, store.get(), initialNotify));
78 double GetY()
const {
return HALSIM_GetAccelerometerY(m_index); }
80 void SetY(
double y) { HALSIM_SetAccelerometerY(m_index, y); }
82 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
84 auto store = std::make_unique<CallbackStore>(
85 m_index, -1, callback, &HALSIM_CancelAccelerometerZCallback);
86 store->SetUid(HALSIM_RegisterAccelerometerZCallback(
87 m_index, &CallbackStoreThunk, store.get(), initialNotify));
91 double GetZ()
const {
return HALSIM_GetAccelerometerZ(m_index); }
93 void SetZ(
double z) { HALSIM_SetAccelerometerZ(m_index, z); }
95 void ResetData() { HALSIM_ResetAccelerometerData(m_index); }
102 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: AccelerometerSim.h:20