![]() |
NMSIS-Core
Version 1.0.0-HummingBird
NMSIS-Core support for HummingBird RISC-V processor-based devices
|
Functions for system and clock setup available in system_<device>.c. More...
Modules | |
Interrupt and Exception Handling | |
Functions for interrupt, exception handle available in system_<device>.c. | |
Functions | |
void | SystemCoreClockUpdate (void) |
Function to update the variable SystemCoreClock. More... | |
void | SystemInit (void) |
Function to Initialize the system. More... | |
void | SystemBannerPrint (void) |
Banner Print for HummingBird SDK. More... | |
int32_t | Core_Register_IRQ (uint32_t irqn, void *handler) |
Register a riscv core interrupt and register the handler. More... | |
int32_t | PLIC_Register_IRQ (uint32_t source, uint8_t priority, void *handler) |
Register a specific plic interrupt and register the handler. More... | |
Variables | |
uint32_t | SystemCoreClock = SYSTEM_CLOCK |
Variable to hold the system core clock value. More... | |
Functions for system and clock setup available in system_<device>.c.
HummingBird provides a template file system_Device.c that must be adapted by the silicon vendor to match their actual device. As a minimum requirement, this file must provide:
The file configures the device and, typically, initializes the oscillator (PLL) that is part of the microcontroller device. This file might export other functions or variables that provide a more flexible configuration of the microcontroller system.
And this file also provided common interrupt, exception exception handling framework template, Silicon vendor can customize these template code as they want.
SystemCoreClock
. This variable might be used throughout the whole system initialization and runtime to calculate frequency/time related values. Thus one must assure that the variable always reflects the actual system clock speed.SystemCoreClock
during low level initializaton (i.e. SystemInit()
) might get overwritten by C libray startup code and/or .bss section initialization. Thus its highly recommended to call SystemCoreClockUpdate at the beginning of the user main()
routine. int32_t Core_Register_IRQ | ( | uint32_t | irqn, |
void * | handler | ||
) |
Register a riscv core interrupt and register the handler.
This function set interrupt handler for core interrupt
[in] | irqn | interrupt number |
[in] | handler | interrupt handler, if NULL, handler will not be installed |
Definition at line 399 of file system_hbird.c.
References __enable_sw_irq(), __enable_timer_irq(), Interrupt_Register_CoreIRQ(), SysTimer_IRQn, and SysTimerSW_IRQn.
int32_t PLIC_Register_IRQ | ( | uint32_t | source, |
uint8_t | priority, | ||
void * | handler | ||
) |
Register a specific plic interrupt and register the handler.
This function set priority and handler for plic interrupt
[in] | source | interrupt source |
[in] | priority | interrupt priority |
[in] | handler | interrupt handler, if NULL, handler will not be installed |
Definition at line 435 of file system_hbird.c.
References __enable_ext_irq(), Interrupt_Register_ExtIRQ(), PLIC_EnableInterrupt(), and PLIC_SetPriority().
void SystemBannerPrint | ( | void | ) |
Banner Print for HummingBird SDK.
Definition at line 378 of file system_hbird.c.
References SystemCoreClock.
void SystemCoreClockUpdate | ( | void | ) |
Function to update the variable SystemCoreClock.
Updates the variable SystemCoreClock and must be called whenever the core clock is changed during program execution. The function evaluates the clock register settings and calculates the current core clock.
Definition at line 101 of file system_hbird.c.
References SystemCoreClock.
void SystemInit | ( | void | ) |
Function to Initialize the system.
Initializes the microcontroller system. Typically, this function configures the oscillator (PLL) that is part of the microcontroller device. For systems with a variable clock speed, it updates the variable SystemCoreClock. SystemInit is called from the file startup_device.
Definition at line 119 of file system_hbird.c.
References SystemCoreClock.
uint32_t SystemCoreClock = SYSTEM_CLOCK |
Variable to hold the system core clock value.
Holds the system core clock, which is the system clock frequency supplied to the SysTick timer and the processor core clock. This variable can be used by debuggers to query the frequency of the debug timer or to configure the trace clock speed.
Definition at line 88 of file system_hbird.c.
Referenced by SystemBannerPrint(), SystemCoreClockUpdate(), and SystemInit().