Blame |
Last modification |
View Log
| RSS feed
#ifndef _UART_H
#define _UART_H
//addresses
#define FC_address 1 //(b)
#define NC_address 2 //(c)
#define MK3MAG_address 3 //(d)
#define BL_CTRL_address 5 //(f)
//Command IDs
#define SERIAL_CHANNELS 'y'
#define EXTERNAL_CONTROL 'b'
//Serial Addresses
#define SERIAL_COMPUTER "/dev/ttyUSB0"
#define SERIAL_KOPTER "/dev/ttyUSB1"
#define SERIAL_FLOW "/dev/ttyACM0"
#define SERIAL_GPS "/dev/ttyAMA0"
#define ADDRESS 0x42
//Filestream
#define TO_KOPTER 2
#define TO_COMPUTER 1
#define TO_FLOW 3
//struct js_event e;
extern void create_serial_frame(u8 address, u8 cmdID, u16 cmdLength, serial_data_struct* pdata_package_create);
extern void collect_serial_frame(serial_data_struct* pdata_package_collect);
extern void receive_data_from_computer(serial_data_struct* pdata_package_receive_computer, u8 sendThrough);
extern void receive_data_from_kopter(serial_data_struct* pdata_package_receive_kopter);
extern void transmit_data(int uart_filestream, serial_data_struct* pdata_package_transmit);
extern void receive_data_from_flow(serial_data_struct* pdata_package_flow);
extern void receive_data_from_gps(serial_data_struct* pdata_package_gps);
extern void transmit_data_to_qt(serial_data_struct* pdata_package_transmit_flow);
extern void receive_data_from_qt(serial_data_struct* pdata_package_qt);
extern void transmit_data_to_flow(serial_data_struct* pdata_package_transmit_qt);
extern void i2c_init();
extern void uart_init();
#endif //_UART_H