stm32l1/include/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 #ifdef CPU_MODEL_STM32L151RBA
34 #define CPUID_ADDR (0x1ff80050)
35 #else
36 #define CPUID_ADDR (0x1ff800d0)
37 #endif
38 
42 enum {
43  PORT_A = 0,
44  PORT_B = 1,
45  PORT_C = 2,
46  PORT_D = 3,
47  PORT_E = 4,
48  PORT_F = 6,
49  PORT_G = 7,
50  PORT_H = 5,
51 };
52 
56 typedef struct {
57  gpio_t pin;
58  uint8_t chan;
59 } adc_conf_t;
60 
65 #define HAVE_ADC_RES_T
66 typedef enum {
67  ADC_RES_6BIT = (0x3 << 3),
68  ADC_RES_8BIT = (0x2 << 3),
69  ADC_RES_10BIT = (0x1 << 3),
70  ADC_RES_12BIT = (0x0 << 3),
71  ADC_RES_14BIT = (0xfe),
72  ADC_RES_16BIT = (0xff)
73 } adc_res_t;
79 typedef struct {
80  I2C_TypeDef *dev;
81  gpio_t scl;
82  gpio_t sda;
83  gpio_mode_t pin_mode;
84  gpio_af_t af;
85  uint8_t er_irqn;
86  uint8_t ev_irqn;
87 } i2c_conf_t;
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* PERIPH_CPU_H */
94 
I2C configuration options.
ADC resolution: 12 bit.
gpio_af_t
Available MUX values for configuring a pin&#39;s alternate function.
uint8_t er_irqn
error IRQ
ADC resolution: 10 bit.
gpio_t adc_conf_t
ADC configuration wrapper.
ADC resolution: 8 bit.
ADC resolution: 6 bit.