blob: 7a82e7698296da39d71e3ad77a39a12c814a4af0 [file] [log] [blame]
Brian Silvermandf49fe32013-12-11 14:21:37 -08001#ifndef CAPE_UART_BYTE_H_
2#define CAPE_UART_BYTE_H_
3
4#include <stdint.h>
5
6// uart_common_configure must be called before this.
7void uart_byte_configure(void);
8
9// Spins until 1 byte is received or some amount of time. The timeout is
Brian Silverman1b6fbd02013-12-12 18:08:47 -080010// timeout_count*(timeout_divider+1)/30MHz.
Brian Silvermandf49fe32013-12-11 14:21:37 -080011// The result is <0 for timeout or the received byte.
12int uart_byte_receive(uint16_t timeout_count, uint16_t timeout_divider);
13
14// Spins until 1 byte can be written out.
15void uart_byte_send(uint8_t value);
16
17#endif // CAPE_UART_BYTE_H_