stm32f4/include/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 
19 #ifndef PERIPH_CPU_H
20 #define PERIPH_CPU_H
21 
22 #include "periph_cpu_common.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define CPUID_ADDR (0x1fff7a10)
32 
36 enum {
37  PORT_A = 0,
38  PORT_B = 1,
39  PORT_C = 2,
40  PORT_D = 3,
41  PORT_E = 4,
42  PORT_F = 5,
43  PORT_G = 6,
44  PORT_H = 7,
45  PORT_I = 8
46 };
47 
51 #if defined(CPU_MODEL_STM32F401RE) || defined(CPU_MODEL_STM32F410RB) \
52  || defined(CPU_MODEL_STM32F411RE) || defined(CPU_MODEL_STM32F412ZG) \
53  || defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
54  || defined(CPU_MODEL_STM32F413MG) || defined(CPU_MODEL_STM32F413VG) \
55  || defined(CPU_MODEL_STM32F413ZG) || defined(CPU_MODEL_STM32F413CH) \
56  || defined(CPU_MODEL_STM32F413RH) || defined(CPU_MODEL_STM32F413MH) \
57  || defined(CPU_MODEL_STM32F413VH) || defined(CPU_MODEL_STM32F413ZH) \
58  || defined(CPU_MODEL_STM32F423CH) || defined(CPU_MODEL_STM32F423RH) \
59  || defined(CPU_MODEL_STM32F423MH) || defined(CPU_MODEL_STM32F423VH) \
60  || defined(CPU_MODEL_STM32F423ZH)
61 #define ADC_DEVS (1U)
62 #elif defined(CPU_MODEL_STM32F407VG) || defined(CPU_MODEL_STM32F415RG) \
63  || defined(CPU_MODEL_STM32F429ZI) || defined(CPU_MODEL_STM32F437VG) \
64  || defined(CPU_MODEL_STM32F446RE) || defined(CPU_MODEL_STM32F446ZE)
65 #define ADC_DEVS (3U)
66 #endif
67 
68 #ifndef DOXYGEN
69 
73 #define HAVE_ADC_RES_T
74 typedef enum {
75  ADC_RES_6BIT = 0x03000000,
76  ADC_RES_8BIT = 0x02000000,
77  ADC_RES_10BIT = 0x01000000,
78  ADC_RES_12BIT = 0x00000000,
79  ADC_RES_14BIT = 1,
80  ADC_RES_16BIT = 2
81 } adc_res_t;
83 #endif /* ndef DOXYGEN */
84 
88 typedef struct {
89  gpio_t pin;
90  uint8_t dev;
91  uint8_t chan;
92 } adc_conf_t;
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* PERIPH_CPU_H */
99 
ADC resolution: 12 bit.
not supported by hardware
ADC resolution: 10 bit.
gpio_t adc_conf_t
ADC configuration wrapper.
not supported by hardware
not supported by hardware
not supported by hardware