program for conv1, universal converter before including conv2 code

Dependencies:   mbed-src

Fork of _8_CONV_1_SLAVE by Marek Trojan

main.h

Committer:
marcus255
Date:
2015-12-18
Revision:
8:47ae8b74cd43
Parent:
7:e86480c767ea
Child:
9:58c110e686f0

File content as of revision 8:47ae8b74cd43:

#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);
I2C i2c(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;
int transmission;

void on_SDA_falling_slope_interrupt(void);
void on_SCL_rising_slope_interrupt(void);
void onUartChar(void);

void init_conv1(int, char);
void init_conv2(int);
void init_conv(void);

#endif