Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2105 - 1
#ifndef _UART_H
2
 #define _UART_H
3
 
4
//addresses
5
#define FC_address      1  //(b)
6
#define NC_address      2  //(c)
7
#define MK3MAG_address  3  //(d)
8
#define BL_CTRL_address 5  //(f)
9
 
10
//Command IDs
11
#define SERIAL_CHANNELS         'y'
12
#define EXTERNAL_CONTROL        'b'
13
 
14
//Serial Addresses
15
#define SERIAL_COMPUTER         "/dev/ttyUSB0"
16
#define SERIAL_KOPTER           "/dev/ttyUSB1"
17
#define SERIAL_FLOW             "/dev/ttyACM0"
18
#define SERIAL_GPS                      "/dev/ttyAMA0"
19
#define ADDRESS                 0x42
20
 
21
//Filestream
22
#define TO_KOPTER               2
23
#define TO_COMPUTER             1
24
#define TO_FLOW                 3
25
 
26
//struct js_event e;
27
 
28
extern void create_serial_frame(u8 address, u8 cmdID, u16 cmdLength, serial_data_struct* pdata_package_create);
29
extern void collect_serial_frame(serial_data_struct* pdata_package_collect);
30
extern void receive_data_from_computer(serial_data_struct* pdata_package_receive_computer, u8 sendThrough);
31
extern void receive_data_from_kopter(serial_data_struct* pdata_package_receive_kopter);
32
extern void transmit_data(int uart_filestream, serial_data_struct* pdata_package_transmit);
33
 
34
extern void receive_data_from_flow(serial_data_struct* pdata_package_flow);
35
extern void receive_data_from_gps(serial_data_struct* pdata_package_gps);
36
extern void transmit_data_to_qt(serial_data_struct* pdata_package_transmit_flow);
37
extern void receive_data_from_qt(serial_data_struct* pdata_package_qt);
38
extern void transmit_data_to_flow(serial_data_struct* pdata_package_transmit_qt);
39
extern void i2c_init();
40
 
41
 
42
extern void uart_init();
43
 
44
 
45
#endif //_UART_H