forked from multiwii/multiwii-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Serial.h
29 lines (26 loc) · 781 Bytes
/
Serial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef SERIAL_H_
#define SERIAL_H_
#if defined(MEGA)
#define UART_NUMBER 4
#elif defined(PROMICRO)
#define UART_NUMBER 2
#else
#define UART_NUMBER 1
#endif
#if defined(GPS_SERIAL)
#define RX_BUFFER_SIZE 256 // 256 RX buffer is needed for GPS communication (64 or 128 was too short)
#else
#define RX_BUFFER_SIZE 64
#endif
#define TX_BUFFER_SIZE 128
void SerialOpen(uint8_t port, uint32_t baud);
uint8_t SerialRead(uint8_t port);
void SerialWrite(uint8_t port,uint8_t c);
uint8_t SerialAvailable(uint8_t port);
void SerialEnd(uint8_t port);
uint8_t SerialPeek(uint8_t port);
bool SerialTXfree(uint8_t port);
uint8_t SerialUsedTXBuff(uint8_t port);
void SerialSerialize(uint8_t port,uint8_t a);
void UartSendData(uint8_t port);
#endif /* SERIAL_H_ */