Files
MuditaOS/module-bsp/board/linux/magnetometer/magnetometer.cpp
Lefucjusz 773f2c7eb1 [BH-2069] Update license URL in headers
Update outdated license file URL in
license headers across all project.
2024-09-18 11:53:01 +02:00

47 lines
949 B
C++

// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md
#include "bsp/magnetometer/magnetometer.hpp"
namespace
{
constexpr auto offlineSliderPosition = bsp::KeyCodes::SSwitchDown;
xQueueHandle qHandleIrq = nullptr;
void requestReadout()
{
if (qHandleIrq == nullptr) {
return;
}
std::uint8_t val = 0x01;
xQueueSend(qHandleIrq, &val, 0);
}
} // namespace
namespace bsp::magnetometer
{
std::int32_t init(xQueueHandle qHandle)
{
qHandleIrq = qHandle;
requestReadout();
return 0;
}
void deinit()
{}
bool isPresent()
{
return false;
}
std::optional<bsp::KeyCodes> WorkerEventHandler()
{
return offlineSliderPosition;
}
void resetCurrentParsedValue()
{}
} // namespace bsp::magnetometer