The friendly Operating System for the Internet of Things
uart_stdio.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef UART_STDIO_H
21 #define UART_STDIO_H
22 
23 /* Boards may override the default STDIO UART device */
24 #include <stdint.h>
25 #include "board.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifndef UART_STDIO_DEV
32 
35 #define UART_STDIO_DEV UART_DEV(0)
36 #endif
37 
38 #ifndef UART_STDIO_BAUDRATE
39 
42 #define UART_STDIO_BAUDRATE (115200)
43 #endif
44 
45 #ifndef UART_STDIO_RX_BUFSIZE
46 
49 #define UART_STDIO_RX_BUFSIZE (64)
50 #endif
51 
55 void uart_stdio_init(void);
56 
66 int uart_stdio_read(char* buffer, int len);
67 
77 int uart_stdio_write(const char* buffer, int len);
78 
85 void uart_stdio_rx_cb(void *arg, uint8_t data);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* UART_STDIO_H */
void uart_stdio_rx_cb(void *arg, uint8_t data)
internal callback for periph/uart drivers
void uart_stdio_init(void)
initialize the module
int uart_stdio_write(const char *buffer, int len)
write len bytes from buffer into uart
int uart_stdio_read(char *buffer, int len)
read len bytes from stdio uart into buffer