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 } adc_conf_t;
51 
56 #define HAVE_ADC_RES_T
57 typedef enum {
58  ADC_RES_6BIT = (0x3 << 3),
59  ADC_RES_8BIT = (0x2 << 3),
60  ADC_RES_10BIT = (0x1 << 3),
61  ADC_RES_12BIT = (0x0 << 3),
62  ADC_RES_14BIT = (0xfe),
63  ADC_RES_16BIT = (0xff)
64 } adc_res_t;
70 typedef struct {
71  I2C_TypeDef *dev;
72  gpio_t scl;
73  gpio_t sda;
74  gpio_mode_t pin_mode;
75  gpio_af_t af;
76  uint8_t er_irqn;
77  uint8_t ev_irqn;
78 } i2c_conf_t;
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* PERIPH_CPU_H */
85 
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.