program for conv1, universal converter before including conv2 code
Fork of _8_CONV_1_SLAVE by
Diff: main.h
- Revision:
- 9:58c110e686f0
- Parent:
- 8:47ae8b74cd43
- Child:
- 10:7eaae60dc9e4
--- a/main.h Fri Dec 18 00:01:28 2015 +0000 +++ b/main.h Fri Dec 25 21:33:52 2015 +0000 @@ -1,16 +1,22 @@ +/* +* Project: I2C to UART converter +* File: main.h +* Author: Marek Trojan +*/ + #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 SET_CONV2_FUNCT 0x22 +#define UART_CONFIRMATION_CHAR 0x33 +#define UART_CHAR_INCOMING 0x44 +#define END_OF_TRANSMISSION 0x66 +#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 +#define DATA_TO_WRITE_CHAR 0xCC +#define I2C_FREQUENCY_STANDARD 100000 /* Hz */ I2CSlave slave(PTB4, PTB3); I2C i2c(PTB4, PTB3);