I2CRTOS Driver by Helmut Schmücker. Removed included mbed-rtos library to prevent multiple definition. Make sure to include mbed-rtos library in your program!
Fork of I2cRtosDriver by
i2cRtos_api.h@16:2c6432b37cce, 2014-05-17 (annotated)
- Committer:
- pHysiX
- Date:
- Sat May 17 11:56:46 2014 +0000
- Revision:
- 16:2c6432b37cce
- Parent:
- 14:352609d395c1
Modified to make 400kHz default
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
humlet | 14:352609d395c1 | 1 | |
humlet | 9:65aae53a34de | 2 | #ifndef MBED_I2CRTOS_API_H |
humlet | 9:65aae53a34de | 3 | #define MBED_I2CRTOS_API_H |
humlet | 9:65aae53a34de | 4 | |
humlet | 9:65aae53a34de | 5 | #include "i2c_api.h" |
humlet | 9:65aae53a34de | 6 | |
humlet | 9:65aae53a34de | 7 | #if DEVICE_I2C |
humlet | 9:65aae53a34de | 8 | |
humlet | 9:65aae53a34de | 9 | #ifdef __cplusplus |
humlet | 9:65aae53a34de | 10 | extern "C" { |
humlet | 9:65aae53a34de | 11 | #endif |
humlet | 9:65aae53a34de | 12 | void i2cRtos_init(i2c_t *obj, PinName sda, PinName scl); |
humlet | 9:65aae53a34de | 13 | |
humlet | 9:65aae53a34de | 14 | int i2cRtos_read(i2c_t *obj, int address, char *data, int length, int stop); |
humlet | 9:65aae53a34de | 15 | int i2cRtos_write(i2c_t *obj, int address, const char *data, int length, int stop); |
humlet | 9:65aae53a34de | 16 | int i2cRtos_byte_read(i2c_t *obj, int last); |
humlet | 9:65aae53a34de | 17 | int i2cRtos_byte_write(i2c_t *obj, int data); |
humlet | 13:530968937ccb | 18 | int i2cRtos_stop(i2c_t *obj); |
humlet | 9:65aae53a34de | 19 | |
humlet | 9:65aae53a34de | 20 | #if DEVICE_I2CSLAVE |
humlet | 9:65aae53a34de | 21 | int i2cRtos_slave_receive(i2c_t *obj, uint32_t tmOut); |
humlet | 9:65aae53a34de | 22 | int i2cRtos_slave_read(i2c_t *obj, char *data, int length); |
humlet | 9:65aae53a34de | 23 | int i2cRtos_slave_write(i2c_t *obj, const char *data, int length); |
humlet | 9:65aae53a34de | 24 | #endif |
humlet | 9:65aae53a34de | 25 | |
humlet | 9:65aae53a34de | 26 | #ifdef __cplusplus |
humlet | 9:65aae53a34de | 27 | } |
humlet | 9:65aae53a34de | 28 | #endif |
humlet | 9:65aae53a34de | 29 | |
humlet | 9:65aae53a34de | 30 | #endif |
humlet | 9:65aae53a34de | 31 | |
humlet | 9:65aae53a34de | 32 | #endif |