Rev 2018 | Rev 2052 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2018 | Rev 2051 | ||
---|---|---|---|
1 | #ifndef _UART0_H |
1 | #ifndef _UART0_H |
2 | #define _UART0_H |
2 | #define _UART0_H |
3 | - | ||
4 | #define RXD_BUFFER_LEN 150 |
- | |
5 | // must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes |
3 | |
6 | #define TXD_BUFFER_LEN 150 |
4 | #define TXD_BUFFER_LEN 180 |
7 | #define RXD_BUFFER_LEN 150 |
5 | #define RXD_BUFFER_LEN 180 |
8 | 6 | ||
9 | #include <inttypes.h> |
7 | #include <inttypes.h> |
10 | 8 | ||
11 | //Baud rate of the USART |
9 | //Baud rate of the USART |
12 | #define USART0_BAUD 57600 |
10 | #define USART0_BAUD 57600 |
13 | 11 | ||
14 | extern void usart0_init(void); |
12 | extern void usart0_init(void); |
15 | extern void usart0_transmitTxData(void); |
13 | extern void usart0_transmitTxData(void); |
16 | extern void usart0_processRxData(void); |
14 | extern void usart0_processRxData(void); |
17 | extern int16_t uart_putchar(int8_t c); |
15 | extern int16_t uart_putchar(int8_t c); |
18 | 16 | ||
19 | // extern uint8_t remotePollDisplayLine; |
17 | // extern uint8_t remotePollDisplayLine; |
20 | 18 | ||
21 | extern uint8_t motorTestActive; |
19 | extern uint8_t motorTestActive; |
22 | extern uint8_t motorTest[16]; |
20 | extern uint8_t motorTest[16]; |
23 | 21 | ||
24 | typedef struct { |
22 | typedef struct { |
25 | uint8_t digital[2]; |
23 | uint8_t digital[2]; |
26 | uint16_t analog[32]; // debug values |
24 | uint16_t analog[32]; // debug values |
27 | }__attribute__((packed)) DebugOut_t; |
25 | }__attribute__((packed)) DebugOut_t; |
28 | 26 | ||
29 | extern DebugOut_t debugOut; |
27 | extern DebugOut_t debugOut; |
30 | 28 | ||
31 | typedef struct { |
29 | typedef struct { |
32 | int16_t anglePitch; // in 0.1 deg |
30 | int16_t anglePitch; // in 0.1 deg |
33 | int16_t angleRoll; // in 0.1 deg |
31 | int16_t angleRoll; // in 0.1 deg |
34 | int16_t heading; // in 0.1 deg |
32 | int16_t heading; // in 0.1 deg |
35 | uint8_t reserved[8]; |
33 | uint8_t reserved[8]; |
36 | }__attribute__((packed)) Data3D_t; |
34 | }__attribute__((packed)) Data3D_t; |
37 | 35 | ||
38 | #endif //_UART0_H |
36 | #endif //_UART0_H |
39 | 37 |