Loading...
Searching...
No Matches
bat_voltage_params.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 BAT_VOLTAGE_PARAMS_H
20#define BAT_VOLTAGE_PARAMS_H
21
22#include "saul/bat_voltage.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
36
41{
42 {
43 .name = "BAT",
44 .phydat_scale = -3,
45 .line = ADC_LINE(5),
46 .res = ADC_RES_10BIT,
47 .convert = saul_bat_voltage_convert,
48 },
49};
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* BAT_VOLTAGE_PARAMS_H */
Parameter definitions for mapping battery voltage to SAUL.
static const saul_bat_voltage_params_t saul_bat_voltage_params[]
Battery voltage configuration.
int16_t saul_bat_voltage_convert(int32_t adc_sample)
Conversion function to convert ADC sample to battery voltage.
int32_t adc_sample(adc_t line, adc_res_t res)
Sample a value from the given ADC line.
#define ADC_LINE(x)
Default ADC line access macro.
Definition adc.h:86
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition adc.h:96
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