13 #include "CallbackStore.h"
14 #include "mockdata/SPIAccelerometerData.h"
22 std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
24 auto store = std::make_unique<CallbackStore>(
25 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerActiveCallback);
26 store->SetUid(HALSIM_RegisterSPIAccelerometerActiveCallback(
27 m_index, &CallbackStoreThunk, store.get(), initialNotify));
31 bool GetActive()
const {
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));
46 int GetRange()
const {
return HALSIM_GetSPIAccelerometerRange(m_index); }
48 void SetRange(
int range) { HALSIM_SetSPIAccelerometerRange(m_index, range); }
50 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
52 auto store = std::make_unique<CallbackStore>(
53 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerXCallback);
54 store->SetUid(HALSIM_RegisterSPIAccelerometerXCallback(
55 m_index, &CallbackStoreThunk, store.get(), initialNotify));
59 double GetX()
const {
return HALSIM_GetSPIAccelerometerX(m_index); }
61 void SetX(
double x) { HALSIM_SetSPIAccelerometerX(m_index, x); }
63 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
65 auto store = std::make_unique<CallbackStore>(
66 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerYCallback);
67 store->SetUid(HALSIM_RegisterSPIAccelerometerYCallback(
68 m_index, &CallbackStoreThunk, store.get(), initialNotify));
72 double GetY()
const {
return HALSIM_GetSPIAccelerometerY(m_index); }
74 void SetY(
double y) { HALSIM_SetSPIAccelerometerY(m_index, y); }
76 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
78 auto store = std::make_unique<CallbackStore>(
79 m_index, -1, callback, &HALSIM_CancelSPIAccelerometerZCallback);
80 store->SetUid(HALSIM_RegisterSPIAccelerometerZCallback(
81 m_index, &CallbackStoreThunk, store.get(), initialNotify));
85 double GetZ()
const {
return HALSIM_GetSPIAccelerometerZ(m_index); }
87 void SetZ(
double z) { HALSIM_SetSPIAccelerometerZ(m_index, z); }
89 void ResetData() { HALSIM_ResetSPIAccelerometerData(m_index); }