periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #ifndef DOXYGEN
26 
31 #if defined(CPU_LINE_STM32F030x4) || defined(CPU_LINE_STM32F030x6) || \
32  defined(CPU_LINE_STM32F030x8) || defined(CPU_LINE_STM32F031x6) || \
33  defined(CPU_LINE_STM32F051x8)
34 #define STM32_BOOTLOADER_ADDR (0x1FFFEC00)
35 #elif defined(CPU_LINE_STM32F072xB) || defined(CPU_LINE_STM32F070xB)
36 #define STM32_BOOTLOADER_ADDR (0x1FFFC800)
37 #elif defined(CPU_LINE_STM32F030xC) || defined(CPU_LINE_STM32F091xC)
38 #define STM32_BOOTLOADER_ADDR (0x1FFFD800)
39 #elif defined(CPU_LINE_STM32F042x6)
40 #define STM32_BOOTLOADER_ADDR (0x1FFFC400)
41 #endif
42 
46 #define STM32_OPTION_BYTES ((uint32_t*) 0x1FFFF800)
47 #define GET_RDP(x) (x & 0xFF)
48 
53 #define HAVE_ADC_RES_T
54 typedef enum {
55  ADC_RES_6BIT = (ADC_CFGR1_RES),
56  ADC_RES_8BIT = (ADC_CFGR1_RES_1),
57  ADC_RES_10BIT = (ADC_CFGR1_RES_0),
58  ADC_RES_12BIT = (0x00),
59  ADC_RES_14BIT = (0xfe),
60  ADC_RES_16BIT = (0xff)
61 } adc_res_t;
68 #define VBAT_ADC_RES ADC_RES_12BIT
69 #define VBAT_ADC_MAX 4095
72 #endif /* ndef DOXYGEN */
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
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