2014-12-02 17:10:06 -07:00
|
|
|
#ifndef SERIAL_H
|
|
|
|
#define SERIAL_H
|
|
|
|
|
|
|
|
#include "device.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <avr/io.h>
|
2019-01-08 12:56:58 -07:00
|
|
|
#include "util/FIFO.h"
|
2019-01-12 07:12:51 -07:00
|
|
|
#include "hardware/LED.h"
|
2014-12-02 17:10:06 -07:00
|
|
|
|
|
|
|
typedef struct Serial {
|
|
|
|
FILE uart0;
|
|
|
|
} Serial;
|
|
|
|
|
2019-01-08 12:56:58 -07:00
|
|
|
FIFOBuffer serialFIFO;
|
|
|
|
uint8_t serialBuf[CONFIG_SERIAL_BUFFER_SIZE];
|
|
|
|
|
2014-12-02 17:10:06 -07:00
|
|
|
void serial_init(Serial *serial);
|
|
|
|
bool serial_available(uint8_t index);
|
2018-04-24 06:38:48 -06:00
|
|
|
int uart0_putchar(char c, FILE *stream);
|
|
|
|
int uart0_getchar(FILE *stream);
|
2014-12-02 17:10:06 -07:00
|
|
|
char uart0_getchar_nowait(void);
|
|
|
|
|
|
|
|
#endif
|