-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSART.h
42 lines (35 loc) · 810 Bytes
/
USART.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
30
31
32
33
34
35
36
37
38
39
40
41
42
/*! @file USART.h
*
* @brief Serial Communication via USART.
*
* This contains the functions for serial communication via the Universal
* Synchronous Asynchronous Receiver Transmitter.
*
* @author Andrew.P
* @date 02-08-2016
*/
#ifndef USART_H
#define USART_H
#ifdef __cplusplus
extern "C" {
#endif
#include "types.h"
/*! @brief Sets up the USART interface before first use.
*
* @return BOOL - true if the USART was successfully initialized.
*/
bool USART_Init(void);
/*! @brief Get a character from the RCREG.
*
* @return data - Byte from the RCREG
*/
uint8_t USART_InChar(void);
/*! @brief Attempt to transmit a character through TXREG.
*
* @param data The byte to be transmitted.
*/
void USART_OutChar(const uint8_t data);
#ifdef __cplusplus
}
#endif
#endif /* USART_H */