periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Engineering-Spirit
3  * Copyright (C) 2016 OTA keys S.A.
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
10 #pragma once
11 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 #if defined (ADC3)
31 #define ADC_DEVS (3U)
32 #else
33 #define ADC_DEVS (2U)
34 #endif
35 
36 #ifndef DOXYGEN
37 
42 #define STM32_BOOTLOADER_ADDR (0x1FFF0000)
43 
47 #define STM32_OPTION_BYTES ((uint32_t*) 0x1FFFC000)
48 #define GET_RDP(x) ((x & 0xFF00) >> 8)
49 
54 #define HAVE_ADC_RES_T
55 typedef enum {
56  ADC_RES_6BIT = (ADC_CR1_RES),
57  ADC_RES_8BIT = (ADC_CR1_RES_1),
58  ADC_RES_10BIT = (ADC_CR1_RES_0),
59  ADC_RES_12BIT = (0x00),
60  ADC_RES_14BIT = (0xfe),
61  ADC_RES_16BIT = (0xff)
62 } adc_res_t;
69 #define VBAT_ADC_RES ADC_RES_12BIT
70 #define VBAT_ADC_MAX 4095
73 #endif /* ndef DOXYGEN */
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
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