forked from libhal-google/libhal.github.io
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Explain how powering down devices and peripherals works in libhal. Specifically, power down APIs should be:
void class::power_down();But this may be too limiting as there maybe other options for powering down the devices such as deep sleep, complete shutdown, low power mode, etc.
An important specification is that all APIs that are not powering down the device, MUST perform the work of bringing the device into a power state where the API can work successfully. This prevents the viral pattern of:
if (driver.is_powered_down()) {
driver.power_on();
}
driver.use_api();The issue with this pattern is that it spreads EVERYWHERE and will have to be placed before every driver api usage, when possible.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation