projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sam3n port: remove sneaked in commented code
[bertos.git]
/
bertos
/
cpu
/
cortex-m3
/
drv
/
i2c_lm3s.c
diff --git
a/bertos/cpu/cortex-m3/drv/i2c_lm3s.c
b/bertos/cpu/cortex-m3/drv/i2c_lm3s.c
index afc6a60b2947ee4ad8f74e73fd5c279b0dd16cd8..fd2f5905d4abe74a1ab802feda478b0806f35012 100644
(file)
--- a/
bertos/cpu/cortex-m3/drv/i2c_lm3s.c
+++ b/
bertos/cpu/cortex-m3/drv/i2c_lm3s.c
@@
-32,6
+32,8
@@
*
* \brief Driver for the LM3S I2C (implementation)
*
*
* \brief Driver for the LM3S I2C (implementation)
*
+ * \author Daniele Basile <asterix@develer.com>
+ *
*/
#include "cfg/cfg_i2c.h"
*/
#include "cfg/cfg_i2c.h"
@@
-43,7
+45,6
@@
#include <cfg/debug.h>
#include <cfg/macros.h> // BV()
#include <cfg/debug.h>
#include <cfg/macros.h> // BV()
-#include <cfg/module.h>
#include <cpu/detect.h>
#include <cpu/irq.h>
#include <cpu/detect.h>
#include <cpu/irq.h>
@@
-118,7
+119,7
@@
INLINE bool wait_addrAck(I2c *i2c, uint32_t mode_mask)
return true;
}
return true;
}
-static void i2c_lm3s_put(I2c *i2c, const uint8_t data)
+static void i2c_lm3s_put
c
(I2c *i2c, const uint8_t data)
{
HWREG(i2c->hw->base + I2C_O_MDR) = data;
{
HWREG(i2c->hw->base + I2C_O_MDR) = data;
@@
-151,7
+152,7
@@
static void i2c_lm3s_put(I2c *i2c, const uint8_t data)
}
}
}
}
-static uint8_t i2c_lm3s_get(I2c *i2c)
+static uint8_t i2c_lm3s_get
c
(I2c *i2c)
{
uint8_t data;
if (i2c->hw->first_xtranf)
{
uint8_t data;
if (i2c->hw->first_xtranf)
@@
-195,18
+196,16
@@
static uint8_t i2c_lm3s_get(I2c *i2c)
return data;
}
return data;
}
-MOD_DEFINE(i2c);
-
static const I2cVT i2c_lm3s_vt =
{
.start = i2c_lm3s_start,
static const I2cVT i2c_lm3s_vt =
{
.start = i2c_lm3s_start,
- .get
= i2c_lm3s_get
,
- .put
= i2c_lm3s_put
,
- .
send = i2c_swSend
,
- .re
cv = i2c_swRecv
,
+ .get
c = i2c_lm3s_getc
,
+ .put
c = i2c_lm3s_putc
,
+ .
write = i2c_genericWrite
,
+ .re
ad = i2c_genericRead
,
};
};
-struct I2cHardware i2c_lm3s_hw[] =
+st
atic st
ruct I2cHardware i2c_lm3s_hw[] =
{
{ /* I2C0 */
.base = I2C0_MASTER_BASE,
{
{ /* I2C0 */
.base = I2C0_MASTER_BASE,
@@
-254,6
+253,4
@@
void i2c_hw_init(I2c *i2c, int dev, uint32_t clock)
* to the desired clock, never greater.
*/
HWREG(i2c->hw->base + I2C_O_MTPR) = ((CPU_FREQ + (2 * 10 * clock) - 1) / (2 * 10 * clock)) - 1;
* to the desired clock, never greater.
*/
HWREG(i2c->hw->base + I2C_O_MTPR) = ((CPU_FREQ + (2 * 10 * clock) - 1) / (2 * 10 * clock)) - 1;
-
- MOD_INIT(i2c);
}
}