Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
lampda::power::powergates Namespace Reference

Handle the two main power gates : Output and USB. More...

Namespaces

namespace  power
 specific power commands
 

Functions

bool is_power_gate_switched ()
 
bool is_vbus_gate_switched ()
 
bool is_power_gate_enabled ()
 return true when the gate if enabled (after the delay).
 
bool __is_power_gate_enabled ()
 check if power gate is enabled
 
void enable_gate (bool isVbusGate)
 
void disable_vbus_gate ()
 
void disable_power_gate ()
 
void switch_delayed_vbus_gate (bool enable)
 
void switch_delayed_power_gate (bool enable)
 
void init ()
 Called once on system startup.
 
void loop ()
 Called often to refresh the status.
 
void enable_power_gate ()
 enable the power gate. This will first disable the vbus gate, then after a delay enable the power gate.
 
void enable_vbus_gate ()
 enable the vbus gate. This will first disable the power gate, then after a delay enable the vbus gate.
 
void enable_vbus_gate_DIRECT ()
 Fast swap only: directly close output gate and enable vbus gate.
 
bool is_vbus_gate_enabled ()
 return true when the gate if enabled (after the delay).
 
void disable_gates ()
 disable immediatly all gates, stop the unlocking processes.
 
bool are_gate_disabled ()
 return true if the gates are disabled.
 

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 _blipWakeUpTime_ms = 0
 
bool _isPowerGateReallyEnabled = false
 
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
 

Detailed Description

Handle the two main power gates : Output and USB.