From 0894a1e7664504312a9cdfc826eef89030aaaa1b Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 5 Aug 2020 02:52:42 +0200 Subject: new directory sructure for fe310 fw --- code/fe310/bsp/include/sifive/devices/uart.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 code/fe310/bsp/include/sifive/devices/uart.h (limited to 'code/fe310/bsp/include/sifive/devices/uart.h') diff --git a/code/fe310/bsp/include/sifive/devices/uart.h b/code/fe310/bsp/include/sifive/devices/uart.h new file mode 100644 index 0000000..71bea6f --- /dev/null +++ b/code/fe310/bsp/include/sifive/devices/uart.h @@ -0,0 +1,27 @@ +// See LICENSE for license details. + +#ifndef _SIFIVE_UART_H +#define _SIFIVE_UART_H + +/* Register offsets */ +#define UART_REG_TXFIFO 0x00 +#define UART_REG_RXFIFO 0x04 +#define UART_REG_TXCTRL 0x08 +#define UART_REG_RXCTRL 0x0c +#define UART_REG_IE 0x10 +#define UART_REG_IP 0x14 +#define UART_REG_DIV 0x18 + +/* TXCTRL register */ +#define UART_TXEN 0x1 +#define UART_TXWM(x) (((x) & 0xffff) << 16) + +/* RXCTRL register */ +#define UART_RXEN 0x1 +#define UART_RXWM(x) (((x) & 0xffff) << 16) + +/* IP register */ +#define UART_IP_TXWM 0x1 +#define UART_IP_RXWM 0x2 + +#endif /* _SIFIVE_UART_H */ -- cgit v1.2.3