NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
legacy.h
Go to the documentation of this file.
1// #################################################################################################
2// # << NEORV32: legacy.h - Backwards compatibility wrappers and functions >> #
3// # ********************************************************************************************* #
4// # BSD 3-Clause License #
5// # #
6// # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
7// # #
8// # Redistribution and use in source and binary forms, with or without modification, are #
9// # permitted provided that the following conditions are met: #
10// # #
11// # 1. Redistributions of source code must retain the above copyright notice, this list of #
12// # conditions and the following disclaimer. #
13// # #
14// # 2. Redistributions in binary form must reproduce the above copyright notice, this list of #
15// # conditions and the following disclaimer in the documentation and/or other materials #
16// # provided with the distribution. #
17// # #
18// # 3. Neither the name of the copyright holder nor the names of its contributors may be used to #
19// # endorse or promote products derived from this software without specific prior written #
20// # permission. #
21// # #
22// # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS #
23// # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF #
24// # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE #
25// # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
26// # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
27// # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED #
28// # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
29// # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED #
30// # OF THE POSSIBILITY OF SUCH DAMAGE. #
31// # ********************************************************************************************* #
32// # The NEORV32 Processor - https://github.com/stnolting/neorv32 (c) Stephan Nolting #
33// #################################################################################################
34
35
36/**********************************************************************/
43#ifndef neorv32_legacy_h
44#define neorv32_legacy_h
45
46
47// ================================================================================================
48// UART0 & UART1
49// ================================================================================================
50
51/**********************************************************************/
55#define neorv32_uart0_available() neorv32_uart_available(NEORV32_UART0)
56#define neorv32_uart0_get_rx_fifo_depth() neorv32_uart_get_rx_fifo_depth(NEORV32_UART0)
57#define neorv32_uart0_get_tx_fifo_depth() neorv32_uart_get_tx_fifo_depth(NEORV32_UART0)
58#define neorv32_uart0_setup(baudrate, irq_mask) neorv32_uart_setup(NEORV32_UART0, baudrate, irq_mask)
59#define neorv32_uart0_disable() neorv32_uart_disable(NEORV32_UART0)
60#define neorv32_uart0_enable() neorv32_uart_enable(NEORV32_UART0)
61#define neorv32_uart0_rtscts_disable() neorv32_uart_rtscts_disable(NEORV32_UART0)
62#define neorv32_uart0_rtscts_enable() neorv32_uart_rtscts_enable(NEORV32_UART0)
63#define neorv32_uart0_putc(c) neorv32_uart_putc(NEORV32_UART0, c)
64#define neorv32_uart0_tx_busy() neorv32_uart_tx_busy(NEORV32_UART0)
65#define neorv32_uart0_getc() neorv32_uart_getc(NEORV32_UART0)
66#define neorv32_uart0_char_received() neorv32_uart_char_received(NEORV32_UART0)
67#define neorv32_uart0_char_received_get() neorv32_uart_char_received_get(NEORV32_UART0)
68#define neorv32_uart0_puts(s) neorv32_uart_puts(NEORV32_UART0, s)
69#define neorv32_uart0_printf(...) neorv32_uart_printf(NEORV32_UART0, __VA_ARGS__)
70#define neorv32_uart0_scan(buffer, max_size, echo) neorv32_uart_scan(NEORV32_UART0, buffer, max_size, echo)
73/**********************************************************************/
77#define neorv32_uart1_available() neorv32_uart_available(NEORV32_UART1)
78#define neorv32_uart1_get_rx_fifo_depth() neorv32_uart_get_rx_fifo_depth(NEORV32_UART1)
79#define neorv32_uart1_get_tx_fifo_depth() neorv32_uart_get_tx_fifo_depth(NEORV32_UART1)
80#define neorv32_uart1_setup(baudrate, irq_mask) neorv32_uart_setup(NEORV32_UART1, baudrate, irq_mask)
81#define neorv32_uart1_disable() neorv32_uart_disable(NEORV32_UART1)
82#define neorv32_uart1_enable() neorv32_uart_enable(NEORV32_UART1)
83#define neorv32_uart1_rtscts_disable() neorv32_uart_rtscts_disable(NEORV32_UART1)
84#define neorv32_uart1_rtscts_enable() neorv32_uart_rtscts_enable(NEORV32_UART1)
85#define neorv32_uart1_putc(c) neorv32_uart_putc(NEORV32_UART1, c)
86#define neorv32_uart1_tx_busy() neorv32_uart_tx_busy(NEORV32_UART1)
87#define neorv32_uart1_getc() neorv32_uart_getc(NEORV32_UART1)
88#define neorv32_uart1_char_received() neorv32_uart_char_received(NEORV32_UART1)
89#define neorv32_uart1_char_received_get() neorv32_uart_char_received_get(NEORV32_UART1)
90#define neorv32_uart1_puts(s) neorv32_uart_puts(NEORV32_UART1, s)
91#define neorv32_uart1_printf(...) neorv32_uart_printf(NEORV32_UART1, __VA_ARGS__)
92#define neorv32_uart1_scan(buffer, max_size, echo) neorv32_uart_scan(NEORV32_UART1, buffer, max_size, echo)
95/**********************************************************************/
101inline void __attribute__((deprecated("Use 'neorv32_uart0_puts()' instead."))) neorv32_uart0_print(const char *s) {
102 neorv32_uart0_puts(s);
103}
104
105/**********************************************************************/
111inline void __attribute__((deprecated("Use 'neorv32_uart0_puts()' instead."))) neorv32_uart1_print(const char *s) {
112 neorv32_uart1_puts(s);
113}
114
115
116// ================================================================================================
117// Custom Functions Unit (CFU)
118// ================================================================================================
119
120/**********************************************************************/
126#define neorv32_cfu_cmd0(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 0, rs1, rs2)
128#define neorv32_cfu_cmd1(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 1, rs1, rs2)
130#define neorv32_cfu_cmd2(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 2, rs1, rs2)
132#define neorv32_cfu_cmd3(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 3, rs1, rs2)
134#define neorv32_cfu_cmd4(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 4, rs1, rs2)
136#define neorv32_cfu_cmd5(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 5, rs1, rs2)
138#define neorv32_cfu_cmd6(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 6, rs1, rs2)
140#define neorv32_cfu_cmd7(funct7, rs1, rs2) neorv32_cfu_r3_instr(funct7, 7, rs1, rs2)
144#endif // neorv32_legacy_h
void neorv32_uart1_print(const char *s)
Definition legacy.h:111
void neorv32_uart0_print(const char *s)
Definition legacy.h:101