42 #ifndef _STDIO_SERIAL_H_ 43 #define _STDIO_SERIAL_H_ 62 #if (XMEGA || MEGA_RF) && defined(__GNUC__) 63 extern int _write (
char c,
int *f);
64 extern int _read (
int *f);
71 extern int (*
ptr_put)(
void volatile*, char);
74 extern void (*
ptr_get)(
void volatile*,
char*);
87 # if (XMEGA || MEGA_RF) 94 # error Unsupported chip type 97 # if defined(__GNUC__) 98 # if (XMEGA || MEGA_RF) 100 fdevopen((
int (*)(
char, FILE*))(_write),(
int (*)(FILE*))(_read));
105 setbuf(stdout,
NULL);
119 #endif // _STDIO_SERIAL_H_ static void stdio_serial_init(volatile void *usart, const usart_serial_options_t *opt)
Initializes the stdio in Serial Mode.
Usart hardware registers.
static int usart_serial_putchar(usart_if p_usart, const uint8_t c)
Sends a character with the USART.
Commonly used includes, types and macros.
volatile void *volatile stdio_base
Pointer to the base of the USART module instance to use for stdio.
void(* ptr_get)(void volatile *, char *)
Pointer to the external low level read function.
static void usart_serial_getchar(usart_if p_usart, uint8_t *data)
Waits until a character is received, and returns it.
static void usart_serial_init(usart_if p_usart, usart_serial_options_t *opt)
Initializes the Usart in master mode.
int(* ptr_put)(void volatile *, char)
Pointer to the external low level write function.