40 lines
882 B
C++
40 lines
882 B
C++
#pragma once
|
|
|
|
#include "core/runtime_state.h"
|
|
|
|
#include <cstdint>
|
|
|
|
namespace borla {
|
|
|
|
struct DeviceIdentity {
|
|
char board[24]{};
|
|
char mac[18]{};
|
|
char app_version[32]{};
|
|
char chip_model[24]{};
|
|
};
|
|
|
|
enum class SoftOffWakeReason : uint8_t {
|
|
kNone,
|
|
kButton,
|
|
kTimer,
|
|
kOther,
|
|
};
|
|
|
|
class IDevicePlatform {
|
|
public:
|
|
virtual ~IDevicePlatform() = default;
|
|
|
|
virtual bool Initialize() = 0;
|
|
virtual const DeviceIdentity& Identity() const = 0;
|
|
virtual void SetLed(LedPattern pattern) = 0;
|
|
virtual void ShowTemporaryLedAlert(uint32_t duration_ms) = 0;
|
|
virtual void ReportError(uint32_t error_id) = 0;
|
|
virtual void Reboot() = 0;
|
|
virtual void EnterSoftOff(uint64_t timer_wakeup_us) = 0;
|
|
virtual SoftOffWakeReason ConsumeSoftOffWakeReason() = 0;
|
|
//2026-8-26 ckkj add
|
|
virtual bool ReadWakeButton() = 0;
|
|
};
|
|
|
|
} // namespace borla
|