OpenModem/hardware/Serial.h

25 lines
473 B
C
Raw Normal View History

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