Line 81... |
Line 81... |
// capture all exceptions and give debug info via UART
|
// capture all exceptions and give debug info via UART
|
// this is not required, but keeps us safe
|
// this is not required, but keeps us safe
|
neorv32_rte_setup();
|
neorv32_rte_setup();
|
|
|
|
|
// init UART at default baud rate, no parity bits, no rx interrupt, no tx interrupt
|
// init UART at default baud rate, no parity bits
|
neorv32_uart_setup(BAUD_RATE, 0b00, 0, 0);
|
neorv32_uart_setup(BAUD_RATE, 0b00);
|
|
|
// check available hardware extensions and compare with compiler flags
|
// check available hardware extensions and compare with compiler flags
|
neorv32_rte_check_isa(0); // silent = 0 -> show message if isa mismatch
|
neorv32_rte_check_isa(0); // silent = 0 -> show message if isa mismatch
|
|
|
// intro
|
// intro
|
Line 102... |
Line 102... |
|
|
// info
|
// info
|
neorv32_uart_printf("This program allows to create TWI transfers by hand.\n"
|
neorv32_uart_printf("This program allows to create TWI transfers by hand.\n"
|
"Type 'help' to see the help menu.\n\n");
|
"Type 'help' to see the help menu.\n\n");
|
|
|
// configure TWI, second slowest clock, no IRQ, no clock-stretching
|
// configure TWI, second slowest clock, no clock-stretching
|
neorv32_twi_setup(CLK_PRSC_2048, 0, 0);
|
neorv32_twi_setup(CLK_PRSC_2048, 0);
|
|
|
// no active bus session yet
|
// no active bus session yet
|
bus_claimed = 0;
|
bus_claimed = 0;
|
|
|
// Main menu
|
// Main menu
|