From 172d694cf7ba582635ac38454bad0f0fdaa14773 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 16 Jan 2021 01:25:21 +0100 Subject: interrupt: Generate interrupts from platform spec. --- i2c/i2c.cpp | 10 +++++----- i2c/i2c.h | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'i2c') diff --git a/i2c/i2c.cpp b/i2c/i2c.cpp index 36ce972..3039e47 100644 --- a/i2c/i2c.cpp +++ b/i2c/i2c.cpp @@ -4,12 +4,12 @@ #include #if defined(STM32F1) -I2C_t I2C1(0x40005400, 36000000, Interrupt::I2C1_EV, Interrupt::I2C1_ER); -I2C_t I2C2(0x40005800, 36000000, Interrupt::I2C2_EV, Interrupt::I2C2_ER); +I2C_t I2C1(0x40005400, 36000000); +I2C_t I2C2(0x40005800, 36000000); #elif defined(STM32F4) -I2C_t I2C1(0x40005400, 42000000, Interrupt::I2C1_EV, Interrupt::I2C1_ER); -I2C_t I2C2(0x40005800, 42000000, Interrupt::I2C2_EV, Interrupt::I2C2_ER); -//I2C_t I2C3(0x40005c00, 42000000, Interrupt::I2C3_EV, Interrupt::I2C3_ER); +I2C_t I2C1(0x40005400, 42000000); +I2C_t I2C2(0x40005800, 42000000); +//I2C_t I2C3(0x40005c00, 42000000); #endif #if defined(STM32F1) || defined(STM32F4) diff --git a/i2c/i2c.h b/i2c/i2c.h index ed72aa3..a2fde32 100644 --- a/i2c/i2c.h +++ b/i2c/i2c.h @@ -29,10 +29,8 @@ class I2C_t { public: I2C_reg_t& reg; const uint32_t clk; - Interrupt::IRQ irq_ev_n; - Interrupt::IRQ irq_er_n; - I2C_t(uint32_t reg_addr, uint32_t bus_clk, Interrupt::IRQ ev_n, Interrupt::IRQ er_n) : reg(*(I2C_reg_t*)reg_addr), clk(bus_clk), irq_ev_n(ev_n), irq_er_n(er_n) { + I2C_t(uint32_t reg_addr, uint32_t bus_clk) : reg(*(I2C_reg_t*)reg_addr), clk(bus_clk) { reading = writing = 0; } -- cgit v1.2.3