mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-23 21:57:33 -04:00
[sw] updated UART init function call (added no-parity configuration; all examples + bootloader still use 8N1 uart configuration)
This commit is contained in:
parent
cf2aac9452
commit
81e7bbad53
13 changed files with 29 additions and 28 deletions
|
@ -6,7 +6,7 @@
|
|||
// # ********************************************************************************************* #
|
||||
// # Boot from (internal) instruction memory, UART or SPI Flash. #
|
||||
// # #
|
||||
// # UART configuration: 8 data bits, no parity bit, 1 stop bit, 19200 baud #
|
||||
// # UART configuration: 8 data bits, NO parity bit, 1 stop bit, 19200 baud (19200-8N1) #
|
||||
// # Boot Flash: 8-bit SPI, 24-bit addresses (like Micron N25Q032A) @ neorv32.spi_csn_o(0) #
|
||||
// # neorv32.gpio_o(0) is used as high-active status LED (can be disabled via #STATUS_LED_EN). #
|
||||
// # #
|
||||
|
@ -220,8 +220,8 @@ int main(void) {
|
|||
neorv32_gpio_port_set(1 << STATUS_LED);
|
||||
}
|
||||
|
||||
// init UART (no interrupts)
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART (no parity bit, no interrupts)
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0, 0);
|
||||
|
||||
// Configure machine system timer interrupt for ~2Hz
|
||||
neorv32_mtime_set_timecmp(neorv32_mtime_get_time() + (clock_speed/4));
|
||||
|
|
|
@ -73,8 +73,8 @@ void blink_led_c(void);
|
|||
**************************************************************************/
|
||||
int main() {
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// check if GPIO unit is implemented at all
|
||||
if (neorv32_gpio_available() == 0) {
|
||||
|
|
|
@ -145,7 +145,7 @@ portable_init(core_portable *p, int *argc, char *argv[])
|
|||
/* NEORV32-specific */
|
||||
neorv32_cpu_dint(); // no interrupt, thanks
|
||||
neorv32_rte_setup(); // capture all exceptions and give debug information
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0); // setup UART
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0); // init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
|
||||
|
||||
// Disable coremark compilation by default
|
||||
|
|
|
@ -131,8 +131,8 @@ int main() {
|
|||
} cpu_systime;
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// Disable cpu_test compilation by default
|
||||
#ifndef RUN_CPUTEST
|
||||
|
|
|
@ -127,8 +127,8 @@ static void prvSetupHardware( void )
|
|||
// clear GPIO.out port
|
||||
neorv32_gpio_port_set(0);
|
||||
|
||||
// configure UART for default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -228,7 +228,8 @@ void SystemIrqHandler( uint32_t mcause )
|
|||
#include <neorv32.h>
|
||||
int main() {
|
||||
|
||||
neorv32_uart_setup(19200, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
neorv32_uart_print("ERROR! FreeRTOS has not been compiled. Use >>make USER_FLAGS+=-DRUN_FREERTOS_DEMO clean_all exe<< to compile it.\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -72,8 +72,8 @@ int main() {
|
|||
// setup run-time environment for interrupts and exceptions
|
||||
neorv32_rte_setup();
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
|
||||
// check if GPIO unit is implemented at all
|
||||
|
|
|
@ -73,8 +73,8 @@ int main() {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// say hello
|
||||
neorv32_uart_print("PWM demo program\n");
|
||||
|
|
|
@ -79,8 +79,8 @@ int main(void) {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// intro
|
||||
neorv32_uart_printf("\n--- TRNG Demo ---\n\n");
|
||||
|
|
|
@ -83,8 +83,8 @@ int main() {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// intro
|
||||
neorv32_uart_printf("\n--- TWI Bus Explorer ---\n\n");
|
||||
|
|
|
@ -76,8 +76,8 @@ int main() {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// simple text output via UART (strings only)
|
||||
neorv32_uart_print("\nWatchdog system reset demo program\n\n");
|
||||
|
|
|
@ -97,8 +97,8 @@ int main(void) {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -61,13 +61,13 @@
|
|||
**************************************************************************/
|
||||
int main() {
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
|
||||
// capture all exceptions and give debug info via UART
|
||||
// this is not required, but keeps us safe
|
||||
neorv32_rte_setup();
|
||||
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// print project logo via UART
|
||||
neorv32_rte_print_logo();
|
||||
|
||||
|
|
|
@ -82,8 +82,8 @@ int main() {
|
|||
neorv32_rte_setup();
|
||||
|
||||
|
||||
// init UART at default baud rate, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0, 0);
|
||||
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
||||
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
||||
|
||||
// intro
|
||||
neorv32_uart_printf("\n--- Hex Viewer ---\n\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue