|
Lamp-Da 0.1
A compact lantern project
|
Rules deciding when, and how much, current can be pulled from the USB input. More...
Go to the source code of this file.
Classes | |
| class | lampda::bsp::powerDelivery::policy::VbusLossTracker |
| struct | lampda::bsp::powerDelivery::policy::SourceStatus |
| Snapshot of the input source status. More... | |
Namespaces | |
| namespace | lampda |
| Program scope. | |
| namespace | lampda::bsp |
| Board Support Layer, handle the low level logic above the HAL. | |
| namespace | lampda::bsp::powerDelivery |
| Handles the power delivery capabilities (USB-PD). | |
| namespace | lampda::bsp::powerDelivery::policy |
| Input power rules, from a snapshot of the source status. | |
Variables | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::standardPortDetectionDelay_ms = 1500 |
| Delay after a source detection (or a PD resume) before considering it a standard (non PD) port. | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::pdLostDelay_ms = 1000 |
| Delay after the last PD source detection before considering it a standard port. | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::maxPdNegociationWait_ms = 8000 |
| static constexpr uint16_t | lampda::bsp::powerDelivery::policy::standardPortCurrent_mA = 800 |
| Current pulled from a standard port (ICO finds the real maximum) | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::pdSourceTolerance_percent = 5 |
| PD source output tolerance (vSrcNew), in percents of the negociated voltage. | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::pdCableDrop_mV = 500 |
| Cable and connectors voltage drop allowed on VBUS (USB-C, at 3A) | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::vbusMeasureResolution_mV = 420 |
| VBUS measure resolution: the FUSB302 measure has 420mV steps, and rounds down. | |
| static constexpr float | lampda::bsp::powerDelivery::policy::pdCurrentRatio = 0.90f |
| Do not use the whole PD current, or the source will cut us off. | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::unplugDeglitch_ms = 1000 |
| VBUS can be lost this long before the source is considered unplugged (flicker, ICO algorithm) | |
| static constexpr uint32_t | lampda::bsp::powerDelivery::policy::hardResetUnplugDeglitch_ms = 3000 |
Rules deciding when, and how much, current can be pulled from the USB input.
Pure functions of a status snapshot, so that the rules can be unit tested without the PD hardware.