periph_cpu.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015-2016 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
25 #if defined(ADC4)
26 #define ADC_DEVS (4U)
27 #elif defined(ADC3)
28 #define ADC_DEVS (3U)
29 #elif defined(ADC2)
30 #define ADC_DEVS (2U)
31 #elif defined(ADC1)
32 #define ADC_DEVS (1U)
33 #endif
34 
38 #define ADC_T_ADCVREG_STUP_US (10)
39 
40 #ifndef DOXYGEN
41 
46 #define STM32_BOOTLOADER_ADDR (0x1FFFD800)
47 
51 #define STM32_OPTION_BYTES ((uint32_t*) 0x1FFFF800)
52 #define GET_RDP(x) (x & 0xFF)
53 
58 #define HAVE_ADC_RES_T
59 typedef enum {
60  ADC_RES_6BIT = (ADC_CFGR_RES),
61  ADC_RES_8BIT = (ADC_CFGR_RES_1),
62  ADC_RES_10BIT = (ADC_CFGR_RES_0),
63  ADC_RES_12BIT = (0x00),
64  ADC_RES_14BIT = (0xfe),
65  ADC_RES_16BIT = (0xff)
66 } adc_res_t;
73 #define VBAT_ADC_RES ADC_RES_12BIT
74 #define VBAT_ADC_MAX 4095
77 #endif /* ndef DOXYGEN */
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
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