![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
vr1.1
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of CDMS_RTOS_v1_1 by
Diff: i2c.cpp
- Revision:
- 12:cb3ee1ac3638
- Parent:
- 8:607ae92fa6af
- Child:
- 15:2c8629da6ec9
--- a/i2c.cpp Mon Jul 06 06:25:14 2015 +0000 +++ b/i2c.cpp Mon Jul 06 10:31:29 2015 +0000 @@ -14,7 +14,7 @@ Timer t; -void FCTN_I2C_READ(char *data, int length ) +int FCTN_I2C_READ(char *data, int length ) { bool read_ack = true; irpt_2_slv = 0; @@ -31,9 +31,10 @@ irpt_2_slv = 1; printf("\r\n\r %d \r\n",t.read_us()); t.reset(); + return read_ack; } -void FCTN_I2C_WRITE(char *data,int length) +int FCTN_I2C_WRITE(char *data,int length) { bool write_ack = true; irpt_2_slv = 0; @@ -50,10 +51,11 @@ irpt_2_slv = 1; printf("\r\n\r %d \r\n",t.read_us()); t.reset(); + return write_ack; } bool check = 1; -void FCTN_MASTER_I2C(char i2c_data_type , char* i2c_data) +int FCTN_MASTER_I2C(char i2c_data_type , char* i2c_data) { FCTN_I2C_WRITE(&i2c_data_type,1); wait_ms(10); @@ -73,5 +75,6 @@ default: printf("\r\n\r invalid command \r\n"); + return 25; } } \ No newline at end of file