program for conv1, universal converter before including conv2 code
Fork of _8_CONV_1_SLAVE by
main.h@6:b9578f756c9c, 2015-12-17 (annotated)
- Committer:
- marcus255
- Date:
- Thu Dec 17 18:33:21 2015 +0000
- Revision:
- 6:b9578f756c9c
- Parent:
- 5:d622f8a4a016
Address discovering functionality added and works fine
Who changed what in which revision?
User | Revision | Line number | New 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 | 4:9e2adff677ac | 6 | #define RTC_ADDR 0xD0 |
marcus255 | 0:ab0f6f4ef7ac | 7 | #define RECBUFSIZE 64 |
marcus255 | 0:ab0f6f4ef7ac | 8 | #define UART_CONFIRMATION_CHAR 0x33 |
marcus255 | 0:ab0f6f4ef7ac | 9 | #define DATA_TO_WRITE_CHAR 0xCC |
marcus255 | 0:ab0f6f4ef7ac | 10 | #define DATA_TO_READ_CHAR 0x99 |
marcus255 | 0:ab0f6f4ef7ac | 11 | #define UART_NON_CONFIRMATION_CHAR 0xAA |
marcus255 | 0:ab0f6f4ef7ac | 12 | #define END_OF_TRANSMISSION 0x66 |
marcus255 | 0:ab0f6f4ef7ac | 13 | #define UART_CHAR_INCOMING 0x44 |
marcus255 | 5:d622f8a4a016 | 14 | #define SET_CONV2_FUNCT 0x22 |
marcus255 | 0:ab0f6f4ef7ac | 15 | |
marcus255 | 0:ab0f6f4ef7ac | 16 | I2CSlave slave(PTB4, PTB3); |
marcus255 | 0:ab0f6f4ef7ac | 17 | Serial device(USBTX, USBRX); |
marcus255 | 0:ab0f6f4ef7ac | 18 | InterruptIn SDA_interrupt(PTB7); |
marcus255 | 6:b9578f756c9c | 19 | InterruptIn SCL_interrupt(PTA12); |
marcus255 | 0:ab0f6f4ef7ac | 20 | DigitalIn SDA_state(PTB6); |
marcus255 | 0:ab0f6f4ef7ac | 21 | |
marcus255 | 1:455088a984b0 | 22 | //char msg[] = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm"; |
marcus255 | 0:ab0f6f4ef7ac | 23 | char buffer; |
marcus255 | 0:ab0f6f4ef7ac | 24 | int count; |
marcus255 | 0:ab0f6f4ef7ac | 25 | |
marcus255 | 0:ab0f6f4ef7ac | 26 | void i2cStart(void); |
marcus255 | 0:ab0f6f4ef7ac | 27 | void init(void); |
marcus255 | 5:d622f8a4a016 | 28 | void init_I2C(char, int); |
marcus255 | 6:b9578f756c9c | 29 | void on_SCL_rising_slope_interrupt(void); |
marcus255 | 0:ab0f6f4ef7ac | 30 | |
marcus255 | 0:ab0f6f4ef7ac | 31 | #endif |