Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
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
25
extern
"C"
{
26
#endif
27
35
int16_t
saul_bat_voltage_convert
(int32_t
adc_sample
);
36
40
static
const
saul_bat_voltage_params_t
saul_bat_voltage_params
[] =
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 */
bat_voltage.h
Parameter definitions for mapping battery voltage to SAUL.
saul_bat_voltage_params
static const saul_bat_voltage_params_t saul_bat_voltage_params[]
Battery voltage configuration.
Definition
bat_voltage_params.h:40
saul_bat_voltage_convert
int16_t saul_bat_voltage_convert(int32_t adc_sample)
Conversion function to convert ADC sample to battery voltage.
adc_sample
int32_t adc_sample(adc_t line, adc_res_t res)
Sample a value from the given ADC line.
ADC_LINE
#define ADC_LINE(x)
Default ADC line access macro.
Definition
adc.h:86
ADC_RES_10BIT
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition
adc.h:96
saul_bat_voltage_params_t
SAUL battery voltage configuration values.
Definition
bat_voltage.h:33
saul_bat_voltage_params_t::name
const char * name
name of the device connected to this pin
Definition
bat_voltage.h:34
Generated on Sun Dec 22 2024 10:22:27 by
1.9.8