Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Functions
power_gates.h File Reference

Interface layer that handles the safety of the power gaters of the system. More...

Go to the source code of this file.

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::power::powergates
 Handle the two main power gates : Output and USB.
 
namespace  lampda::power::powergates::power
 specific power commands
 

Functions

void lampda::power::powergates::init ()
 Called once on system startup.
 
void lampda::power::powergates::loop ()
 Called often to refresh the status.
 
void lampda::power::powergates::power::blip (const uint32_t timing)
 blip output gate (very short power interruption)
 
void lampda::power::powergates::power::cancel_blip ()
 Cancel the current blip if any.
 
bool lampda::power::powergates::power::is_bliping ()
 Return true if the output gate is in a blip.
 
void lampda::power::powergates::enable_power_gate ()
 enable the power gate. This will first disable the vbus gate, then after a delay enable the power gate.
 
bool lampda::power::powergates::is_power_gate_enabled ()
 return true when the gate if enabled (after the delay).
 
void lampda::power::powergates::enable_vbus_gate ()
 enable the vbus gate. This will first disable the power gate, then after a delay enable the vbus gate.
 
void lampda::power::powergates::enable_vbus_gate_DIRECT ()
 Fast swap only: directly close output gate and enable vbus gate.
 
bool lampda::power::powergates::is_vbus_gate_enabled ()
 return true when the gate if enabled (after the delay).
 
void lampda::power::powergates::disable_gates ()
 disable immediatly all gates, stop the unlocking processes.
 
bool lampda::power::powergates::are_gate_disabled ()
 return true if the gates are disabled.
 

Detailed Description

Interface layer that handles the safety of the power gaters of the system.

The power gates are the USB gate, to let power pass between the charger and the USB (bidirectional), and the output gate, to send power to the board main output.