-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathses_uart.h
44 lines (29 loc) · 886 Bytes
/
ses_uart.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
43
44
#ifndef SES_UART_H_
#define SES_UART_H_
/*INCLUDES-------------------------------------------------------------------*/
#include <stdio.h>
#include <stdint.h>
/*EXTERNALS------------------------------------------------------------------*/
/**
* File descriptor for UART. You can use this in conjunction with fprintf.
* Example fprintf(uartout, "Hello World %d\n",2017);
*/
extern FILE* uartout;
/*PROTOTYPES-----------------------------------------------------------------*/
/**
* Initializes UART with given baud rate. By default, 8 databits and
* 1 stop bit are used.
* @param baudrate baudrate of uart (e.g. 57600)
*/
void uart_init(uint32_t baudrate);
/**
* Reads a character from UART.
* @return character
*/
uint8_t uart_getc();
/**
* Writes a character to UART.
* @param chr character to write
*/
void uart_putc(uint8_t chr);
#endif /* SES_UART_H_ */