|
Lamp-Da 0.1
A compact lantern project
|
Handle the two main power gates : Output and USB. More...
Namespaces | |
| namespace | power |
| specific power commands | |
Classes | |
| struct | PowerGateLock |
| Hold _powerGateMutex for the scope. More... | |
Variables | |
| bool | _isInit = false |
| static constexpr uint32_t | gateSwitchDelay_ms = 50 |
| static constexpr uint32_t | BLIP_MAX_TIME = 10000 |
| max off delay of the gate blip | |
| static uint32_t | _blipStartTime_ms = 0 |
| static uint32_t | _blipDuration_ms = 0 |
| static bool | _isPowerGateReallyEnabled = false |
| static hal::mutex::hal_mutex_t | _powerGateMutex |
| Guards the power gate pin, the blip state (_blipStartTime_ms, _blipDuration_ms) and _isPowerGateReallyEnabled: blip() and cancel_blip() run on the user thread, while loop() and the gate switches run on the power thread. A blip start, its timeout and its cancellation are then never interleaved with each other or with a gate switch. Not recursive. | |
| static const bool | _isPowerGateMutexInit = (hal::mutex::hal_mutex_init(&_powerGateMutex), true) |
| Initialized at program start: blips can be requested before the power init. | |
| static bool | _isVbusGateEnabled = false |
| static bool | _isVbusGateSwitching = false |
| static uint32_t | _vbusGateStartSwitchingTime = 0 |
| static bool | _isPowerGateEnabled = false |
| static bool | _isPowerGateSwitching = false |
| static uint32_t | _powerGateStartSwitchingTime = 0 |
Handle the two main power gates : Output and USB.