Core Local Interrupt Timer API Calls

clint_setCmp()

Usage void clint_setCmp(u32 p, u64 cmp, u32 hart_id)
Include driver/clint.h
Parameters [IN] p CLINT base address
[IN] cmp timer compare register
[IN] hart_id HART ID, 0 to 3
Description Set a timer value to trigger an interrupt when the value is reached.

clint_getTime()

Usage u64 clint_getTime(u32 p)
Include driver/clint.h
Parameters [IN] p CLINT base address
Returns [OUT] Current core timer value
Description Gets the timer value.

clint_uDelay()

Usage u64 clint_uDelay(u32 usec, u32 hz, u32 reg)
Include driver/clint.h
Parameters [IN] usec microseconds
[IN] hz core frequency
[IN] reg CLINT base address
Description Delay for certain duration in microsecond with CLINT.
Example
#define bsp_uDelay(usec);
clint_uDelay(usec, SYSTEM_CLINT_HZ, SYSTEM_CLINT_CTRL);