aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-04 17:46:19 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-04 17:46:19 +0000
commit59014aa2be0488eba89c6ec0fb1934aa43aeb224 (patch)
treede9518cb36b5ccbc4a582bc14a8c30470b091359 /os/hal/include
parentdbac0ef26b2977c9862ec6ddc22f10dac76b3239 (diff)
downloadChibiOS-59014aa2be0488eba89c6ec0fb1934aa43aeb224.tar.gz
ChibiOS-59014aa2be0488eba89c6ec0fb1934aa43aeb224.tar.bz2
ChibiOS-59014aa2be0488eba89c6ec0fb1934aa43aeb224.zip
I2C. Tested on tmp75, mma8451, max1236.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3553 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/i2c.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h
index cf4d47713..18e93119e 100644
--- a/os/hal/include/i2c.h
+++ b/os/hal/include/i2c.h
@@ -66,6 +66,13 @@
#define I2C_USE_MUTUAL_EXCLUSION TRUE
#endif
+/**
+ * @brief Enables the mutual exclusion APIs on the I2C bus.
+ */
+#if !defined(I2C_USE_WAIT) || defined(__DOXYGEN__)
+#define I2C_USE_WAIT TRUE
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -87,7 +94,6 @@ typedef enum {
I2C_READY = 2, /**< Ready. */
I2C_ACTIVE_TRANSMIT = 3, /**< Transmitting. */
I2C_ACTIVE_RECEIVE = 4, /**< Receiving. */
- I2C_ACTIVE_TRANSCEIVE = 5, /**< Receiving after transmit. */
} i2cstate_t;
#include "i2c_lld.h"
@@ -116,11 +122,6 @@ typedef void (*i2cerrorcallback_t)(I2CDriver *i2cp,
const I2CSlaveConfig *i2cscfg);
/**
- * @brief I2C transmission data block size.
- */
-typedef uint8_t i2cblock_t;
-
-/**
* @brief Structure representing an I2C slave configuration.
* @details Each slave device has its own config structure with input and
* output buffers for temporally storing data.
@@ -252,11 +253,11 @@ extern "C" {
void i2cStart(I2CDriver *i2cp, const I2CConfig *config);
void i2cStop(I2CDriver *i2cp);
void i2cMasterTransmit(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg,
- uint16_t slave_addr,
+ uint8_t slave_addr,
uint8_t *txbuf, size_t txbytes,
uint8_t *rxbuf, size_t rxbytes);
void i2cMasterReceive(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg,
- uint16_t slave_addr, uint8_t *rxbuf, size_t rxbytes);
+ uint8_t slave_addr, uint8_t *rxbuf, size_t rxbytes);
void i2cMasterStart(I2CDriver *i2cp);
void i2cMasterStop(I2CDriver *i2cp);
void i2cAddFlagsI(I2CDriver *i2cp, i2cflags_t mask);