program for conv1, universal converter before including conv2 code

Dependencies:   mbed-src

Fork of _8_CONV_1_SLAVE by Marek Trojan

Committer:
marcus255
Date:
Tue Dec 01 22:15:52 2015 +0000
Revision:
0:ab0f6f4ef7ac
Child:
1:455088a984b0
writing ok, reading in progress

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcus255 0:ab0f6f4ef7ac 1 #ifndef MAIN_H
marcus255 0:ab0f6f4ef7ac 2 #define MAIN_H
marcus255 0:ab0f6f4ef7ac 3
marcus255 0:ab0f6f4ef7ac 4 #include <mbed.h>
marcus255 0:ab0f6f4ef7ac 5 #define SLAVE_ADDR 0xA0
marcus255 0:ab0f6f4ef7ac 6 #define RECBUFSIZE 64
marcus255 0:ab0f6f4ef7ac 7 #define UART_CONFIRMATION_CHAR 0x33
marcus255 0:ab0f6f4ef7ac 8 #define DATA_TO_WRITE_CHAR 0xCC
marcus255 0:ab0f6f4ef7ac 9 #define DATA_TO_READ_CHAR 0x99
marcus255 0:ab0f6f4ef7ac 10 #define UART_NON_CONFIRMATION_CHAR 0xAA
marcus255 0:ab0f6f4ef7ac 11 #define END_OF_TRANSMISSION 0x66
marcus255 0:ab0f6f4ef7ac 12 #define UART_CHAR_INCOMING 0x44
marcus255 0:ab0f6f4ef7ac 13
marcus255 0:ab0f6f4ef7ac 14 I2CSlave slave(PTB4, PTB3);
marcus255 0:ab0f6f4ef7ac 15 Serial device(USBTX, USBRX);
marcus255 0:ab0f6f4ef7ac 16 InterruptIn SDA_interrupt(PTB7);
marcus255 0:ab0f6f4ef7ac 17 DigitalIn SDA_state(PTB6);
marcus255 0:ab0f6f4ef7ac 18
marcus255 0:ab0f6f4ef7ac 19 char msg[] = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm";
marcus255 0:ab0f6f4ef7ac 20 char buffer;
marcus255 0:ab0f6f4ef7ac 21 int count;
marcus255 0:ab0f6f4ef7ac 22
marcus255 0:ab0f6f4ef7ac 23 void i2cStart(void);
marcus255 0:ab0f6f4ef7ac 24 void init(void);
marcus255 0:ab0f6f4ef7ac 25
marcus255 0:ab0f6f4ef7ac 26 #endif