stm32l4/include/periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
20 #ifndef PERIPH_CPU_H
21 #define PERIPH_CPU_H
22 
23 #include "periph_cpu_common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define CPUID_ADDR (0x1fff7590)
33 
37 enum {
38  PORT_A = 0,
39  PORT_B = 1,
40  PORT_C = 2,
41  PORT_D = 3,
42  PORT_E = 4,
43  PORT_F = 5,
44  PORT_G = 6,
45  PORT_H = 7,
46 };
47 
51 #if defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG)
52 #define ADC_DEVS (3U)
53 #elif defined(CPU_MODEL_STM32L452RE) || defined(CPU_MODEL_STM32L432KC)
54 #define ADC_DEVS (1U)
55 #endif
56 
57 #if defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) || \
58  defined(CPU_MODEL_STM32L452RE) || defined(CPU_MODEL_STM32L432KC)
59 
62 #define ADC_T_ADCVREG_STUP_US (20)
63 #endif
64 
65 #ifndef DOXYGEN
66 
70 #define HAVE_ADC_RES_T
71 typedef enum {
72  ADC_RES_6BIT = (ADC_CFGR_RES),
73  ADC_RES_8BIT = (ADC_CFGR_RES_1),
74  ADC_RES_10BIT = (ADC_CFGR_RES_0),
75  ADC_RES_12BIT = (0x0),
76  ADC_RES_14BIT = (0x1),
77  ADC_RES_16BIT = (0x2)
78 } adc_res_t;
80 #endif /* ndef DOXYGEN */
81 
85 typedef struct {
86  gpio_t pin;
87  uint8_t dev;
88  uint8_t chan;
89 } adc_conf_t;
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* PERIPH_CPU_H */
96 
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