Loading...
Searching...
No Matches
cfg_i2c_default.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Eistec AB
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "periph_cpu.h"
19
20#ifdef __cplusplus
21extern "C"
22{
23#endif
24
29static const i2c_conf_t i2c_config[] = {
30 {
31 .i2c = I2C1,
32 .scl_pin = GPIO_PIN(PORT_C, 2),
33 .sda_pin = GPIO_PIN(PORT_C, 3),
34 .freq = CLOCK_CORECLOCK,
35 .speed = I2C_SPEED_FAST,
36 .irqn = I2C1_IRQn,
37 .scl_pcr = (PORT_PCR_MUX(3)),
38 .sda_pcr = (PORT_PCR_MUX(3)),
39 },
40};
41#define I2C_NUMOF ARRAY_SIZE(i2c_config)
42#define I2C_0_ISR (isr_i2c1)
44
45#ifdef __cplusplus
46}
47#endif
48
#define CLOCK_CORECLOCK
Clock configuration.
Definition periph_cpu.h:28
@ PORT_C
port C
Definition periph_cpu.h:45
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:42
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:275
I2C configuration structure.
Definition periph_cpu.h:295