program for conv1, universal converter before including conv2 code
Fork of _8_CONV_1_SLAVE by
main.h
- Committer:
- marcus255
- Date:
- 2015-12-17
- Revision:
- 7:e86480c767ea
- Parent:
- 4:9e2adff677ac
- Child:
- 8:47ae8b74cd43
File content as of revision 7:e86480c767ea:
#ifndef MAIN_H #define MAIN_H #include <mbed.h> #define RECBUFSIZE 64 #define UART_CONFIRMATION_CHAR 0x33 #define DATA_TO_WRITE_CHAR 0xCC #define DATA_TO_READ_CHAR 0x99 #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 buffer; int count; volatile int discovered_address; volatile int clk_count; int frequency; 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