Modified version of the official mbed-src lib. Provides some tiny but rather intrusive addons in the i2c-api.h for the mbed-RtosI2cDriver lib.
Fork of mbed-src by
Diff: capi/i2c_api.h
- Revision:
- 9:49923059ddc8
- Parent:
- 8:28ed2abfeb85
diff -r 28ed2abfeb85 -r 49923059ddc8 capi/i2c_api.h --- a/capi/i2c_api.h Sat Apr 20 11:43:20 2013 +0000 +++ b/capi/i2c_api.h Tue Apr 30 19:12:46 2013 +0000 @@ -17,7 +17,7 @@ #define MBED_I2C_API_H #define I2C_ISR_DRV_SIG (1<<7) /* rtos signal sent by i2c isr */ - +#include "cmsis_os.h" #include "device.h" #if DEVICE_I2C @@ -25,7 +25,8 @@ #ifdef __cplusplus extern "C" { #endif - +extern osSemaphoreId i2cIsrDrvSem_1; +extern osSemaphoreId i2cIsrDrvSem_2; typedef struct i2c_s i2c_t; void i2c_init (i2c_t *obj, PinName sda, PinName scl); @@ -41,7 +42,7 @@ #if DEVICE_I2CSLAVE void i2c_slave_mode (i2c_t *obj, int enable_slave); int i2c_slave_receive(i2c_t *obj); -int i2c_slave_receive_rtos(i2c_t *obj, uint32_t tmout); +int i2c_slave_receive_rtos(i2c_t *obj, uint32_t tmOut); int i2c_slave_read (i2c_t *obj, char *data, int length); int i2c_slave_write (i2c_t *obj, const char *data, int length); void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask);