X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fi2c_stm32.c;h=9fd53f0128e1ea249ad28101842a9ff4517267aa;hb=8e6b1e394127c3e1635dffd1aa424b4971ef8a4f;hp=24c3e185a437067d27db742ce5938cd1b329ae3e;hpb=b1fde66b00840e9fb6738774e1e9bcd0b3065b1d;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/i2c_stm32.c b/bertos/cpu/cortex-m3/drv/i2c_stm32.c index 24c3e185..9fd53f01 100644 --- a/bertos/cpu/cortex-m3/drv/i2c_stm32.c +++ b/bertos/cpu/cortex-m3/drv/i2c_stm32.c @@ -237,7 +237,7 @@ static void i2c_stm32_start(struct I2c *i2c, uint16_t slave_addr) start_r(i2c, slave_addr); } -static void i2c_stm32_put(I2c *i2c, const uint8_t data) +static void i2c_stm32_putc(I2c *i2c, const uint8_t data) { i2c->hw->base->DR = data; @@ -251,7 +251,7 @@ static void i2c_stm32_put(I2c *i2c, const uint8_t data) } } -static uint8_t i2c_stm32_get(I2c *i2c) +static uint8_t i2c_stm32_getc(I2c *i2c) { if (i2c->hw->cached) { @@ -297,13 +297,13 @@ static uint8_t i2c_stm32_get(I2c *i2c) static const I2cVT i2c_stm32_vt = { .start = i2c_stm32_start, - .get = i2c_stm32_get, - .put = i2c_stm32_put, - .send = i2c_swSend, - .recv = i2c_swRecv, + .getc = i2c_stm32_getc, + .putc = i2c_stm32_putc, + .write = i2c_genericWrite, + .read = i2c_genericRead, }; -struct I2cHardware i2c_stm32_hw[] = +static struct I2cHardware i2c_stm32_hw[] = { { /* I2C1 */ .base = (struct stm32_i2c *)I2C1_BASE, @@ -317,8 +317,6 @@ struct I2cHardware i2c_stm32_hw[] = }, }; -MOD_DEFINE(i2c); - /** * Initialize I2C module. */ @@ -352,6 +350,4 @@ void i2c_hw_init(I2c *i2c, int dev, uint32_t clock) i2c->hw->base->TRISE |= (CR2_FREQ_36MHZ + 1); i2c->hw->base->CR1 |= CR1_PE_SET; - - MOD_INIT(i2c); }