LoRa-BLE-Sensor
|
This is a library for sensor power configurations and control. This is manages the power configuration, pin configuration, and control of sensor power. More...
Go to the source code of this file.
Classes | |
struct | sensor_power_config_t |
Sensor power configuration. More... | |
Macros | |
#define | OUTUT_READ_DIVIDER_HIGH 100 |
#define | OUTUT_READ_DIVIDER_LOW 13 |
Functions | |
int | sensor_power_init (sensor_power_config_t *config) |
Initialize a sensor_power_setup. This sets the id of the output, the gpios beings used and the regulator device being used. After configurations are set, the sensors output is set OFF. | |
enum sensor_voltage | get_sensor_output (sensor_power_config_t *config) |
Get the sensor voltage that is set for an output. | |
int | set_sensor_output (sensor_power_config_t *config, enum sensor_voltage voltage) |
Set the sensor voltage for an output, enabling/disabling the correct regulators, and setting the correct gpios. When setting the voltage to OFF the voltage may take 1-2 seconds to fully turn off, due to capacitors on the output. | |
float | read_sensor_output (sensor_power_config_t *config) |
Read the voltage output of the selected sensor power configuration. Takes into account resistor divider on output. | |
int | validate_output (sensor_power_config_t *config, enum sensor_voltage voltage, uint8_t accepted_error) |
This is a library for sensor power configurations and control. This is manages the power configuration, pin configuration, and control of sensor power.
enum sensor_voltage get_sensor_output | ( | sensor_power_config_t * | config | ) |
Get the sensor voltage that is set for an output.
config | sensor_power_config_t sensor power configuration for the current sensor |
float read_sensor_output | ( | sensor_power_config_t * | config | ) |
Read the voltage output of the selected sensor power configuration. Takes into account resistor divider on output.
config | sensor_power_config_t sensor power configuration for the current sensor |
int sensor_power_init | ( | sensor_power_config_t * | config | ) |
Initialize a sensor_power_setup. This sets the id of the output, the gpios beings used and the regulator device being used. After configurations are set, the sensors output is set OFF.
config | sensor_power_config_t sensor power configuration for the current sensor |
int set_sensor_output | ( | sensor_power_config_t * | config, |
enum sensor_voltage | voltage | ||
) |
Set the sensor voltage for an output, enabling/disabling the correct regulators, and setting the correct gpios. When setting the voltage to OFF the voltage may take 1-2 seconds to fully turn off, due to capacitors on the output.
config | sensor_power_config_t sensor power configuration for the current sensor |
voltage | enum sensor_voltage setting selected |
int validate_output | ( | sensor_power_config_t * | config, |
enum sensor_voltage | voltage, | ||
uint8_t | accepted_error | ||
) |
config | sensor_power_config_t sensor power configuration for the current sensor |
voltage | enum sensor_voltage setting selected |
accepted_error | error in percent that the device is allowed to be off by |