periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Freie Universit├Ąt Berlin
3  * Copyright (C) 2015 Hamburg University of Applied Sciences
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 
21 #ifndef PERIPH_CPU_H
22 #define PERIPH_CPU_H
23 
24 #include "periph_cpu_common.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #if defined(CPU_MODEL_STM32L151RB_A) || defined(CPU_MODEL_STM32L151CB) || \
34  defined(CPU_MODEL_STM32L151CB_A)
35 #define CPUID_ADDR (0x1ff80050)
36 #else
37 #define CPUID_ADDR (0x1ff800d0)
38 #endif
39 
43 enum {
44  PORT_A = 0,
45  PORT_B = 1,
46  PORT_C = 2,
47  PORT_D = 3,
48  PORT_E = 4,
49  PORT_F = 6,
50  PORT_G = 7,
51  PORT_H = 5,
52 };
53 
57 typedef struct {
58  gpio_t pin;
59  uint8_t chan;
60 } adc_conf_t;
61 
62 #ifndef DOXYGEN
63 
67 #define HAVE_ADC_RES_T
68 typedef enum {
69  ADC_RES_6BIT = (ADC_CR1_RES_0 | ADC_CR1_RES_1),
70  ADC_RES_8BIT = (ADC_CR1_RES_1),
71  ADC_RES_10BIT = (ADC_CR1_RES_0),
72  ADC_RES_12BIT = (0x00),
73  ADC_RES_14BIT = (0xfe),
74  ADC_RES_16BIT = (0xff)
75 } adc_res_t;
77 #endif /* ndef DOXYGEN */
78 
83 #define EEPROM_START_ADDR (0x08080000)
84 #if defined(CPU_MODEL_STM32L152RE)
85 #define EEPROM_SIZE (16384UL) /* 16kB */
86 #elif defined(CPU_MODEL_STM32L151RC)
87 #define EEPROM_SIZE (8192U) /* 8kB */
88 #elif defined(CPU_MODEL_STM32L151CB) || defined(CPU_MODEL_STM32L151CB_A)
89 #define EEPROM_SIZE (4096U) /* 4kB */
90 #endif
91 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* PERIPH_CPU_H */
98 
port C
Definition: periph_cpu.h:38
ADC resolution: 12 bit.
Definition: adc.h:96
adc_res_t
Possible ADC resolution settings.
Definition: adc.h:92
port F
Definition: periph_cpu.h:41
ADC resolution: 14 bit.
Definition: adc.h:97
ADC resolution: 10 bit.
Definition: adc.h:95
port E
Definition: periph_cpu.h:40
gpio_t adc_conf_t
ADC configuration wrapper.
Definition: periph_cpu.h:313
port D
Definition: periph_cpu.h:39
ADC resolution: 16 bit.
Definition: adc.h:98
port A
Definition: periph_cpu.h:36
ADC resolution: 8 bit.
Definition: adc.h:94
ADC resolution: 6 bit.
Definition: adc.h:93
port G
Definition: periph_cpu.h:42
port H
Definition: periph_cpu.h:41
port B
Definition: periph_cpu.h:37