ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_power.h File Reference
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ri_power_regulators_t
 Enable implementation selected by application. More...
 

Functions

rd_status_t ri_power_regulators_enable (const ri_power_regulators_t regulators)
 Enable given regulators. More...
 
void ri_power_reset (void)
 Reset IC. More...
 
void ri_power_enter_bootloader (void)
 Enter bootloader. More...
 

Detailed Description

Author
Otso Jousimaa otso@.nosp@m.ojou.nosp@m.sima..nosp@m.net
Date
2019-08-01

Interface for controlling CPU-integrated regulators and system power modes.

Definition in file ruuvi_interface_power.h.

Function Documentation

◆ ri_power_enter_bootloader()

void ri_power_enter_bootloader ( void  )

Enter bootloader.

This function attempts to enter bootloader. It's main purpose is to provide a wireless recovery mechanism on fatal error.

Warning
Behaviour is undefined if bootloader is not onboard.

◆ ri_power_regulators_enable()

rd_status_t ri_power_regulators_enable ( const ri_power_regulators_t  regulators)

Enable given regulators.

The implementation must work regardless of software radio state, i.e. on S132 on nRF52 the function must check if softdevice is running and call softdevice wrapper to DC/DC if it is and write registers directly if SD is not running.

Parameters
[in]regulatorsbinary flags of regulators to enable.
Returns
RD_SUCCESS on success, error code from stack in case of a error.

◆ ri_power_reset()

void ri_power_reset ( void  )

Reset IC.

This function attempts to reset and restart the program as closely as possible to a power cycle.

Warning
This functions affects only the CPU, any peripheral sensors must be reset separately.
Some registers might retain their values across soft resets.