Loading...
Searching...
No Matches
periph_cpu.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Technische Universität Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef DOXYGEN
23
28#define STM32_BOOTLOADER_ADDR (0x0BF8F000)
29
33#if defined(ADC4)
34# define ADC_DEVS (4U)
35#elif defined(ADC3)
36# define ADC_DEVS (3U)
37#elif defined(ADC2)
38# define ADC_DEVS (2U)
39#elif defined(ADC1)
40# define ADC_DEVS (1U)
41#endif
42
46#define ADC_T_ADCVREG_STUP_US (20U)
47
51#define ADC_CFGR_RES ADC_CFGR1_RES_Msk
52
56#define ADC_CONF_CHAN_MAX (19U)
57
64#define HAVE_ADC_RES_T
65typedef enum {
66 ADC_RES_6BIT = (ADC_CFGR1_RES),
67 ADC_RES_8BIT = (ADC_CFGR1_RES_1),
68 ADC_RES_10BIT = (ADC_CFGR1_RES_0),
69 ADC_RES_12BIT = (0x00),
70 ADC_RES_14BIT = (0xfe),
71 ADC_RES_16BIT = (0xff)
72} adc_res_t;
74
79#define VBAT_ADC_RES ADC_RES_12BIT
80#define VBAT_ADC_MAX 4095
82
83#endif /* DOXYGEN */
84
85#ifdef __cplusplus
86}
87#endif
88
adc_res_t
Possible ADC resolution settings.
Definition adc.h:89
@ ADC_RES_16BIT
ADC resolution: 16 bit.
Definition adc.h:95
@ ADC_RES_8BIT
ADC resolution: 8 bit.
Definition adc.h:91
@ ADC_RES_14BIT
ADC resolution: 14 bit.
Definition adc.h:94
@ ADC_RES_6BIT
ADC resolution: 6 bit.
Definition adc.h:90
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition adc.h:92
@ ADC_RES_12BIT
ADC resolution: 12 bit.
Definition adc.h:93