Hardware Local Interruptor (CLINT) HW driver header file.
More...
#include <stdint.h>
Go to the source code of this file.
Hardware Local Interruptor (CLINT) HW driver header file.
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ NEORV32_CLINT
◆ neorv32_clint_available()
int neorv32_clint_available |
( |
void | | ) |
|
Check if CLINT module was synthesized.
- Returns
- 0 if CLINT was not synthesized, 1 if CLINT is available.
◆ neorv32_clint_msi_clr()
void neorv32_clint_msi_clr |
( |
int | hart | ) |
|
Clear machine software interrupt.
- Parameters
-
[in] | hart | Hart index (0..4095). |
◆ neorv32_clint_msi_get()
uint32_t neorv32_clint_msi_get |
( |
int | hart | ) |
|
Get machine software interrupt register.
- Parameters
-
[in] | hart | Hart index (0..4095). |
◆ neorv32_clint_msi_set()
void neorv32_clint_msi_set |
( |
int | hart | ) |
|
Trigger machine software interrupt.
- Parameters
-
[in] | hart | Hart index (0..4095). |
◆ neorv32_clint_mtimecmp_get()
uint64_t neorv32_clint_mtimecmp_get |
( |
void | | ) |
|
Get MTIMER compare time register (MTIMECMP).
- Note
- This functions uses MHARTID to automatically select the according hart's MTIMECMP register.
- Returns
- Current MTIMECMP value.
◆ neorv32_clint_mtimecmp_set()
void neorv32_clint_mtimecmp_set |
( |
uint64_t | timecmp | ) |
|
Set MTIMER compare time register (MTIMECMP) for generating interrupts.
- Note
- This functions uses MHARTID to automatically select the according hart's MTIMECMP register.
- Parameters
-
[in] | timecmp | System time for interrupt (uint64_t). |
◆ neorv32_clint_time_get()
uint64_t neorv32_clint_time_get |
( |
void | | ) |
|
Get current system time.
- Note
- The CLINT MTIMER increments with the primary processor clock.
- Returns
- Current system time (uint64_t).
◆ neorv32_clint_time_set()
void neorv32_clint_time_set |
( |
uint64_t | time | ) |
|
Set current CLINT system time.
- Note
- The CLINT MTIMER increments with the primary processor clock.
- Parameters
-
[in] | time | New system time (uint64_t). |
◆ neorv32_clint_unixtime_get()
uint64_t neorv32_clint_unixtime_get |
( |
void | | ) |
|
Get Unix time from MTIMER.
- Returns
- Unix time since 00:00:00 UTC, January 1st, 1970 in seconds.
◆ neorv32_clint_unixtime_set()
void neorv32_clint_unixtime_set |
( |
uint64_t | unixtime | ) |
|
Set MTIMER to Unix time.
- Parameters
-
[in] | unixtime | Unix time since 00:00:00 UTC, January 1st, 1970 in seconds. |