NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
main.c File Reference

Simple machine timer (MTIME) usage example. More...

#include <neorv32.h>

Macros

#define BAUD_RATE   19200
 

Functions

void mtime_irq_handler (void)
 
int main ()
 

Variables

const char weekdays [7][4] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}
 

Detailed Description

Simple machine timer (MTIME) usage example.

Author
Stephan Nolting

Function Documentation

◆ main()

int main ( void )

This program toggles an LED at GPIO.output(0) at 1Hz and also prints and updates the Unix time in human-readable format using the machine timer interrupt.

Note
This program requires the MTIME unit to be synthesized (and UART0 and GPIO).
Returns
Should not return.

◆ mtime_irq_handler()

void mtime_irq_handler ( void )

MTIME IRQ handler.

Warning
This function has to be of type "void xyz(void)" and must not use any interrupt attributes!