21#ifndef PERIPH_CPU_I2C_H
22#define PERIPH_CPU_I2C_H
38#define PERIPH_I2C_NEED_READ_REG
40#define PERIPH_I2C_NEED_WRITE_REG
42#define PERIPH_I2C_NEED_READ_REGS
43#if defined(CPU_FAM_STM32F1) || defined(CPU_FAM_STM32F2) || \
44 defined(CPU_FAM_STM32L1) || defined(CPU_FAM_STM32F4) || \
45 defined(CPU_FAM_STM32MP1)
47#define PERIPH_I2C_NEED_WRITE_REGS
56#define HAVE_I2C_SPEED_T
58#if defined(CPU_FAM_STM32F1) || defined(CPU_FAM_STM32F2) || \
59 defined(CPU_FAM_STM32F4) || defined(CPU_FAM_STM32L1) || \
60 defined(CPU_FAM_STM32MP1)
65#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || \
66 defined(CPU_FAM_STM32F7) || defined(CPU_FAM_STM32L0) || \
67 defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32WB) || \
68 defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32G0) || \
69 defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32U5) || \
70 defined(CPU_FAM_STM32WL) || defined(CPU_FAM_STM32C0)
85#ifndef CPU_FAM_STM32F1
91#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || \
92 defined(CPU_FAM_STM32F7) || defined(CPU_FAM_STM32G0) || \
93 defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32L4) || \
94 defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32WB) || \
95 defined(CPU_FAM_STM32U5) || defined(CPU_FAM_STM32WL) || \
96 defined(CPU_FAM_STM32C0)
99#if defined(CPU_FAM_STM32F1) || defined(CPU_FAM_STM32F2) || \
100 defined(CPU_FAM_STM32F4) || defined(CPU_FAM_STM32L1) || \
101 defined(CPU_FAM_STM32MP1)
107#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || \
108 defined(CPU_FAM_STM32F7) || defined(CPU_FAM_STM32L0) || \
109 defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32L5) || \
110 defined(CPU_FAM_STM32G0) || defined(CPU_FAM_STM32G4) || \
111 defined(CPU_FAM_STM32U5) || defined(CPU_FAM_STM32WB) || \
112 defined(CPU_FAM_STM32WL) || defined(CPU_FAM_STM32C0)
137static const i2c_timing_param_t timing_params[] = {
165#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || \
166 defined(CPU_FAM_STM32F7) || defined(CPU_FAM_STM32G0) || \
167 defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32L0) || \
168 defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32L5) || \
169 defined(CPU_FAM_STM32U5) || defined(CPU_FAM_STM32WB) || \
170 defined(CPU_FAM_STM32WL) || defined(CPU_FAM_STM32C0)
175#define PERIPH_I2C_MAX_BYTES_PER_FRAME (256U)
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
@ I2C_SPEED_FAST_PLUS
fast plus mode: ~1000 kbit/s
@ I2C_SPEED_LOW
low speed mode: ~10 kbit/s
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
GPIO CPU definitions for the STM32 family.
gpio_af_t
Override alternative GPIO mode options.
I2C configuration structure.
gpio_af_t scl_af
scl pin alternate function value
gpio_af_t sda_af
sda pin alternate function value
uint32_t rcc_mask
bit in clock enable register
uint8_t irqn
I2C event interrupt number.