program for conv1, universal converter before including conv2 code

Dependencies:   mbed-src

Fork of _8_CONV_1_SLAVE by Marek Trojan

Revision:
7:e86480c767ea
Parent:
4:9e2adff677ac
Child:
8:47ae8b74cd43
diff -r 9e2adff677ac -r e86480c767ea main.h
--- a/main.h	Wed Dec 16 19:42:44 2015 +0000
+++ b/main.h	Thu Dec 17 23:02:07 2015 +0000
@@ -2,8 +2,6 @@
 #define MAIN_H
 
 #include <mbed.h>
-#define SLAVE_ADDR 0xA0
-#define RTC_ADDR 0xD0
 #define RECBUFSIZE 64
 #define UART_CONFIRMATION_CHAR 0x33
 #define DATA_TO_WRITE_CHAR 0xCC
@@ -11,17 +9,26 @@
 #define UART_NON_CONFIRMATION_CHAR 0xAA
 #define END_OF_TRANSMISSION 0x66
 #define UART_CHAR_INCOMING 0x44
+#define SET_CONV2_FUNCT 0x22
+#define I2C_FREQUENCY 50000
 
 I2CSlave slave(PTB4, PTB3);
 Serial device(USBTX, USBRX);
 InterruptIn SDA_interrupt(PTB7);
+InterruptIn SCL_interrupt(PTA12);
 DigitalIn SDA_state(PTB6);
 
-//char msg[] = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm";
 char buffer;
 int count;
+volatile int discovered_address;
+volatile int clk_count;
+int frequency;
 
-void i2cStart(void);
-void init(void);
+void on_SDA_falling_slope_interrupt(void);
+void on_SCL_rising_slope_interrupt(void);
+
+void init_conv1(void);
+void init_conv2(void);
+void init_conv(void);
 
 #endif
\ No newline at end of file