- Cleanup unused code and move ISR/IRQ checks to `Kernel.h` - Improve clang-format - Fix for LVGL lock transfer: ensure lock isn't activate when changing the lock - Implement SPI HAL - Remove `initHardware` HAL configuration entry - Fix `I2cScanner`: don't scan when port isn't started
33 lines
787 B
C++
33 lines
787 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace tt::kernel {
|
|
|
|
enum class SystemEvent {
|
|
BootInitHalBegin,
|
|
BootInitHalEnd,
|
|
BootInitI2cBegin,
|
|
BootInitI2cEnd,
|
|
BootInitSpiBegin,
|
|
BootInitSpiEnd,
|
|
BootInitLvglBegin,
|
|
BootInitLvglEnd,
|
|
BootSplash,
|
|
/** Gained IP address */
|
|
NetworkConnected,
|
|
NetworkDisconnected,
|
|
/** An important system time-related event, such as NTP update or time-zone change */
|
|
Time,
|
|
};
|
|
|
|
/** Value 0 mean "no subscription" */
|
|
typedef uint32_t SystemEventSubscription;
|
|
|
|
typedef void (*OnSystemEvent)(SystemEvent event);
|
|
|
|
void systemEventPublish(SystemEvent event);
|
|
SystemEventSubscription systemEventAddListener(SystemEvent event, OnSystemEvent handler);
|
|
void systemEventRemoveListener(SystemEventSubscription subscription);
|
|
|
|
} |