32static const char*
s_tag =
"TX_SYST";
40 if ((cpuclk_hz == 0U) || (tick_hz == 0U)) {
45 const uint32_t ticks = cpuclk_hz / tick_hz;
52 const uint32_t reload = ticks - 1U;
66 uint32_t cpuclk_hz = 0U;
69 "CPUCLK0 query failed");
75 "SysTick reload computation failed");
static const char * s_tag
Logging / check tag.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_out_of_range
Sensor or peripheral output out of valid range.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info_val(tag, message, value)
RA8 log info val.
#define ra8_log_error(tag, message)
RA8 log error.
Cortex-M85 SysTick + DWT cycle-counter timebase primitive.
ra8_err_t ra8_systick_set_reload(uint32_t reload)
Re-arm SysTick with a new reload, leaving the control bits untouched.
RA8 <-> Eclipse ThreadX glue: SysTick kernel-tick retuning.
@ k_ra8_threadx_tick_hz
1 kHz -> 1 ms kernel tick.
@ k_ra8_systick_reload_max
Max SYST_RVR reload (24-bit).
ra8_err_t ra8_threadx_systick_reload_for(uint32_t cpuclk_hz, uint32_t tick_hz, uint32_t *out_reload)
Compute the SysTick reload for a given core clock + tick rate.
ra8_err_t ra8_threadx_systick_retune(void)
Reprogram SysTick.LOAD from the live CPUCLK0 rate.