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 
9 #pragma once
10 
21 #include "periph_cpu.h"
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
32 static const i2c_conf_t i2c_config[] = {
33  {
34  .i2c = I2C1,
35  .scl_pin = GPIO_PIN(PORT_C, 2),
36  .sda_pin = GPIO_PIN(PORT_C, 3),
37  .freq = CLOCK_CORECLOCK,
38  .speed = I2C_SPEED_FAST,
39  .irqn = I2C1_IRQn,
40  .scl_pcr = (PORT_PCR_MUX(3)),
41  .sda_pcr = (PORT_PCR_MUX(3)),
42  },
43 };
44 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
45 #define I2C_0_ISR (isr_i2c1)
48 #ifdef __cplusplus
49 }
50 #endif
51 
#define CLOCK_CORECLOCK
Clock configuration.
Definition: periph_cpu.h:31
@ PORT_C
port C
Definition: periph_cpu.h:48
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:45
static const i2c_conf_t i2c_config[]
Default I2C device configuration.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:278
I2C configuration structure.
Definition: periph_cpu.h:298
I2C_Type * i2c
Pointer to hardware module registers.
Definition: periph_cpu.h:458