nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
battery_def.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7/* This configuration file is included only once from battery level measuring module
8 * and holds information about battery characteristic.
9 */
10
11/* This structure enforces the header file is included only once in the build.
12 * Violating this requirement triggers a multiple definition error at link time.
13 */
15
16#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_AIN3
17#define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1
18#define BATTERY_MEAS_VOLTAGE_GAIN 1
19
20/* Converting measured battery voltage[mV] to State of Charge[%].
21 * First element corresponds to CONFIG_DESKTOP_BATTERY_MIN_LEVEL.
22 * Each element is CONFIG_DESKTOP_VOLTAGE_TO_SOC_DELTA higher than previous.
23 * Defined separately for every configuration.
24 */
25static const uint8_t battery_voltage_to_soc[] = {
260, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
272, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
284, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 13, 13, 14, 15, 16,
2918, 19, 22, 25, 28, 32, 36, 40, 44, 47, 51, 53, 56, 58, 60, 62, 64, 66, 67, 69,
3071, 72, 74, 76, 77, 79, 81, 82, 84, 85, 85, 86, 86, 86, 87, 88, 88, 89, 90, 91,
3191, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100
32};
static const uint8_t battery_voltage_to_soc[]
Definition: battery_def.h:25
const struct @48 battery_def_include_once