cfg_i2c_default.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Eistec AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
19 #ifndef CFG_I2C_DEFAULT_H
20 #define CFG_I2C_DEFAULT_H
21 
22 #include "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
33 static const i2c_conf_t i2c_config[] = {
34  {
35  .i2c = I2C1,
36  .scl_pin = GPIO_PIN(PORT_C, 2),
37  .sda_pin = GPIO_PIN(PORT_C, 3),
38  .freq = CLOCK_CORECLOCK,
39  .speed = I2C_SPEED_FAST,
40  .irqn = I2C1_IRQn,
41  .scl_pcr = (PORT_PCR_MUX(3)),
42  .sda_pcr = (PORT_PCR_MUX(3)),
43  },
44 };
45 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
46 #define I2C_0_ISR (isr_i2c1)
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* CFG_I2C_DEFAULT_H */
#define CLOCK_CORECLOCK
Clock configuration.
Definition: periph_cpu.h:31
@ PORT_C
port C
Definition: periph_cpu.h:49
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:46
static const i2c_conf_t i2c_config[]
Default I2C device configuration.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:279
I2C configuration structure.
Definition: periph_cpu.h:299
I2C_Type * i2c
Pointer to hardware module registers.
Definition: periph_cpu.h:459