periph_cpu.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Engineering-Spirit
3  * SPDX-FileCopyrightText: 2016 OTA keys S.A.
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
27 #if defined (ADC3)
28 #define ADC_DEVS (3U)
29 #else
30 #define ADC_DEVS (2U)
31 #endif
32 
33 #ifndef DOXYGEN
34 
39 #define STM32_BOOTLOADER_ADDR (0x1FFF0000)
40 
44 #define STM32_OPTION_BYTES ((uint32_t*) 0x1FFFC000)
45 #define GET_RDP(x) ((x & 0xFF00) >> 8)
46 
51 #define HAVE_ADC_RES_T
52 typedef enum {
53  ADC_RES_6BIT = (ADC_CR1_RES),
54  ADC_RES_8BIT = (ADC_CR1_RES_1),
55  ADC_RES_10BIT = (ADC_CR1_RES_0),
56  ADC_RES_12BIT = (0x00),
57  ADC_RES_14BIT = (0xfe),
58  ADC_RES_16BIT = (0xff)
59 } adc_res_t;
66 #define VBAT_ADC_RES ADC_RES_12BIT
67 #define VBAT_ADC_MAX 4095
70 #endif /* ndef DOXYGEN */
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
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