Loading...
Searching...
No Matches
bat_voltage.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 TU Dresden
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef SAUL_BAT_VOLTAGE_H
20#define SAUL_BAT_VOLTAGE_H
21
22#include <stdint.h>
23
24#include "periph/adc.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33typedef struct {
34 const char *name;
35 int8_t phydat_scale;
45 int16_t (*convert)(int32_t adc_sample);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif /* SAUL_BAT_VOLTAGE_H */
Low-level ADC peripheral driver interface definitions.
int32_t adc_sample(adc_t line, adc_res_t res)
Sample a value from the given ADC line.
uint_fast8_t adc_t
Define default ADC type identifier.
Definition adc.h:72
adc_res_t
Possible ADC resolution settings.
Definition adc.h:93
SAUL battery voltage configuration values.
Definition bat_voltage.h:33
const char * name
name of the device connected to this pin
Definition bat_voltage.h:34
adc_res_t res
ADC resolution.
Definition bat_voltage.h:37
int8_t phydat_scale
Phydat scale of the resulting voltage.
Definition bat_voltage.h:35
adc_t line
ADC line to initialize and expose.
Definition bat_voltage.h:36