forked from multiwii/multiwii-firmware
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Serial.h
27 lines (23 loc) · 762 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
#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
#define RX_BUFFER_SIZE 256 // 256 RX buffer is needed for GPS communication (64 or 128 was too short)
#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);
void SerialWrite16(uint8_t port, int16_t val);
#endif /* SERIAL_H_ */