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 enum {
34  PORT_A = 0,
35  PORT_B = 1,
36  PORT_C = 2,
37  PORT_D = 3,
38  PORT_E = 4,
39  PORT_F = 6,
40  PORT_G = 7,
41  PORT_H = 5,
42 };
43 
47 typedef struct {
48  gpio_t pin;
49  uint8_t chan;
50 } dac_conf_t;
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;
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_t scl
scl pin number
gpio_af_t
Available MUX values for configuring a pin's alternate function.
uint8_t er_irqn
error IRQ
gpio_mode_t pin_mode
with or without pull resistor
ADC resolution: 10 bit.
I2C_TypeDef * dev
i2c device
ADC resolution: 8 bit.
ADC resolution: 6 bit.
CPU specific DAC configuration.
gpio_t sda
sda pin number
uint8_t ev_irqn
event IRQ
gpio_af_t af
I2C alternate function value.
CPU specific ADC configuration.