aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-27 15:22:18 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-27 15:22:18 +0000
commit4f827c235aa25d0c0b45eca7ccd06ce2c1740a24 (patch)
tree776311d91c2d7743ad129d624d016391ede1c944 /os/hal/src
parente96e10761e38f07f884553c8ec6bcbaa06f42dd4 (diff)
downloadChibiOS-4f827c235aa25d0c0b45eca7ccd06ce2c1740a24.tar.gz
ChibiOS-4f827c235aa25d0c0b45eca7ccd06ce2c1740a24.tar.bz2
ChibiOS-4f827c235aa25d0c0b45eca7ccd06ce2c1740a24.zip
I2C. Code cleanups.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@2776 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/i2c.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c
index 04af9a6c2..7dede9f86 100644
--- a/os/hal/src/i2c.c
+++ b/os/hal/src/i2c.c
@@ -117,13 +117,34 @@ void i2cStop(I2CDriver *i2cp) {
}
/**
+ * @brief Generate (re)start on the bus.
+ *
+ * @param[in] i2cp pointer to the @p I2CDriver object
+ */
+void i2cMasterStart(I2CDriver *i2cp){
+
+ chDbgCheck((i2cp != NULL), "i2cMasterTransmit");
+
+ i2c_lld_master_start(i2cp);
+}
+
+/**
+ * @brief Generate stop on the bus.
+ *
+ * @param[in] i2cp pointer to the @p I2CDriver object
+ */
+void i2cMasterStop(I2CDriver *i2cp){
+
+ chDbgCheck((i2cp != NULL), "i2cMasterTransmit");
+
+ i2c_lld_master_stop(i2cp);
+}
+
+/**
* @brief Sends data ever the I2C bus.
*
* @param[in] i2cp pointer to the @p I2CDriver object
- * @param[in] slave_addr1 7-bit address of the slave
- * @param[in] slave_addr1 used in 10-bit address mode
- * @param[in] n number of words to send
- * @param[in] txbuf the pointer to the transmit buffer
+ * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object
*
*/
void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
@@ -134,19 +155,15 @@ void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
"i2cMasterTransmit(), #1",
"not active");
- i2c_lld_master_transmitI(i2cp, i2cscfg);
+ i2c_lld_master_transmit(i2cp, i2cscfg);
}
/**
* @brief Receives data from the I2C bus.
*
- * @param[in] i2cp pointer to the @p I2CDriver object
- * @param[in] slave_addr1 7-bit address of the slave
- * @param[in] slave_addr1 used in 10-bit address mode
- * @param[in] n number of words to receive
- * @param[out] rxbuf the pointer to the receive buffer
- *
+ * @param[in] i2cp pointer to the @p I2CDriver object
+ * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object
*/
void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
@@ -156,7 +173,7 @@ void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
"i2cMasterReceive(), #1",
"not active");
- i2c_lld_master_receiveI(i2cp, i2cscfg);
+ i2c_lld_master_receive(i2cp, i2cscfg);
}