projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Serial port support for ATMega1280 (contributed by Fabio Bizzi).
[bertos.git]
/
bertos
/
cpu
/
cortex-m3
/
drv
/
i2c_stm32.c
diff --git
a/bertos/cpu/cortex-m3/drv/i2c_stm32.c
b/bertos/cpu/cortex-m3/drv/i2c_stm32.c
index 24c3e185a437067d27db742ce5938cd1b329ae3e..9fd53f0128e1ea249ad28101842a9ff4517267aa 100644
(file)
--- 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);
}
start_r(i2c, slave_addr);
}
-static void i2c_stm32_put(I2c *i2c, const uint8_t data)
+static void i2c_stm32_put
c
(I2c *i2c, const uint8_t data)
{
i2c->hw->base->DR = 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_get
c
(I2c *i2c)
{
if (i2c->hw->cached)
{
{
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,
static const I2cVT i2c_stm32_vt =
{
.start = i2c_stm32_start,
- .get
= i2c_stm32_get
,
- .put
= i2c_stm32_put
,
- .
send = i2c_swSend
,
- .re
cv = i2c_swRecv
,
+ .get
c = i2c_stm32_getc
,
+ .put
c = i2c_stm32_putc
,
+ .
write = i2c_genericWrite
,
+ .re
ad = i2c_genericRead
,
};
};
-struct I2cHardware i2c_stm32_hw[] =
+st
atic st
ruct I2cHardware i2c_stm32_hw[] =
{
{ /* I2C1 */
.base = (struct stm32_i2c *)I2C1_BASE,
{
{ /* I2C1 */
.base = (struct stm32_i2c *)I2C1_BASE,
@@
-317,8
+317,6
@@
struct I2cHardware i2c_stm32_hw[] =
},
};
},
};
-MOD_DEFINE(i2c);
-
/**
* Initialize I2C module.
*/
/**
* 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;
i2c->hw->base->TRISE |= (CR2_FREQ_36MHZ + 1);
i2c->hw->base->CR1 |= CR1_PE_SET;
-
- MOD_INIT(i2c);
}
}