Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by
Diff: i2c.h
- Revision:
- 162:48fda0b8d573
- Parent:
- 161:a63672bf4423
- Child:
- 170:286ef9dad36a
--- a/i2c.h Thu Apr 14 04:14:21 2016 +0000
+++ b/i2c.h Thu Apr 14 04:34:58 2016 +0000
@@ -6,6 +6,7 @@
bool write_ack = false;
bool read_ack = false;
const int addr_pl = 0x20<<1; //PL address
+const int addr_bae = 0x20; ///bae address
uint8_t rcv_isr = 0;
int count = 0;
@@ -22,6 +23,47 @@
}
}
+void FCTN_I2C_READ(char *data,int length)
+{
+ CDMS_I2C_GPIO = 1;
+ //t_read.start();
+ read_ack = master.read(addr_bae|1,data,length);
+ //t_read.stop();
+
+ if(read_ack == 0)
+ printf("\n\rData received from BAE %s \n",data);
+ if (read_ack == 1)
+ {
+ printf("\n \r data not received \n");
+ }
+//if(read_ack == 1)
+//pc.printf("\n \r data not received \n");
+
+ CDMS_I2C_GPIO = 0;
+ //printf("\n\r %d \n",t.read_us());
+ //t.reset();
+}
+
+void FCTN_I2C_WRITE(char *data,uint8_t tc_len2)
+{
+ CDMS_I2C_GPIO = 1;
+ //t.start();
+ write_ack = master.write(addr_bae|0x00,data,tc_len2);
+ //t.stop();
+ //if(write_ack == 0)
+ //gPC.printf("\n\r data not sent \n");
+
+if (write_ack == 1)
+ {
+// led2 = 1;
+ gPC.printf("\n\r data not sent \n");
+// led2 = 0;
+ }
+ CDMS_I2C_GPIO = 0;
+ //gPC.printf("\n\r %d \n",t.read_us());
+ //t.reset();
+}
+
void isr_pyldtm()
{
