Loading...
Searching...
No Matches
periph_cpu.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Freie Universität Berlin
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 (0x1FF00000)
29
33/* Will be defined in a future commit */
34
38#if defined(ADC4)
39# define ADC_DEVS (4U)
40#elif defined(ADC3)
41# define ADC_DEVS (3U)
42#elif defined(ADC2)
43# define ADC_DEVS (2U)
44#elif defined(ADC1)
45# define ADC_DEVS (1U)
46#endif
50#define ADC_T_ADCVREG_STUP_US (10)
51
56#define HAVE_ADC_RES_T
57typedef enum {
58 ADC_RES_6BIT = (0x01),
59 ADC_RES_8BIT = (0x07 << ADC_CFGR_RES_Pos),
60 ADC_RES_10BIT = (0x03 << ADC_CFGR_RES_Pos),
61 ADC_RES_12BIT = (0x06 << ADC_CFGR_RES_Pos),
62 ADC_RES_14BIT = (0x05 << ADC_CFGR_RES_Pos),
63 ADC_RES_16BIT = (0x00 << ADC_CFGR_RES_Pos)
64} adc_res_t;
66
71#define VBAT_ADC_RES ADC_RES_12BIT
72#define VBAT_ADC_MAX 4095
74
75#endif /* ndef DOXYGEN */
76
77#ifdef __cplusplus
78}
79#endif
80
adc_res_t
Possible ADC resolution settings.
Definition adc.h:92
@ ADC_RES_16BIT
ADC resolution: 16 bit.
Definition adc.h:98
@ ADC_RES_8BIT
ADC resolution: 8 bit.
Definition adc.h:94
@ ADC_RES_14BIT
ADC resolution: 14 bit.
Definition adc.h:97
@ ADC_RES_6BIT
ADC resolution: 6 bit.
Definition adc.h:93
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition adc.h:95
@ ADC_RES_12BIT
ADC resolution: 12 bit.
Definition adc.h:96