ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_wdt_supervisor.h
Go to the documentation of this file.
1
62
63#pragma once
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69#include <stdint.h>
70
71#include "ra8_err.h"
72
86
96typedef enum : uint8_t {
99
125typedef struct {
126 void* stack;
128 uint32_t priority;
131
144typedef uint32_t (*ra8_wdt_sup_now_fn_t)(void);
145
155typedef void (*ra8_wdt_sup_refresh_fn_t)(void);
156
203[[nodiscard]] ra8_err_t ra8_wdt_supervisor_init(const ra8_wdt_sup_cfg_t* cfg);
204
223[[nodiscard]] ra8_err_t ra8_wdt_supervisor_deinit(void);
224
258[[nodiscard]] ra8_err_t
259ra8_wdt_supervisor_register_thread(const char* name, uint32_t deadline_ms, uint8_t* out_handle);
260
287[[nodiscard]] ra8_err_t ra8_wdt_supervisor_checkin(uint8_t handle);
288
318[[nodiscard]] ra8_err_t ra8_wdt_supervisor_start(void);
319
345[[nodiscard]] ra8_err_t ra8_wdt_supervisor_tick(bool* out_did_refresh);
346
364
383
403
404#ifdef __cplusplus
405}
406#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_wdt_supervisor_deinit(void)
Reset the supervisor to its uninitialized state (test helper).
ra8_err_t ra8_wdt_supervisor_tick(bool *out_did_refresh)
Run one supervisor tick synchronously (test / introspection hook).
ra8_err_t ra8_wdt_supervisor_set_now_hook(ra8_wdt_sup_now_fn_t now)
Override the monotonic-time hook (test injection point).
ra8_err_t ra8_wdt_supervisor_register_thread(const char *name, uint32_t deadline_ms, uint8_t *out_handle)
Register a worker thread with the supervisor.
uint32_t(* ra8_wdt_sup_now_fn_t)(void)
Hook used by tests to inject monotonic-time readings.
ra8_err_t ra8_wdt_supervisor_checkin(uint8_t handle)
Record a thread check-in, resetting its deadline window.
ra8_err_t ra8_wdt_supervisor_init(const ra8_wdt_sup_cfg_t *cfg)
Initialise the supervisor registry and runtime hooks.
ra8_wdt_sup_handle_t
Opaque handle returned by ra8_wdt_supervisor_register_thread.
@ k_ra8_wdt_sup_handle_invalid
Invalid / unregistered handle.
uint8_t ra8_wdt_supervisor_thread_count(void)
Read the number of currently-registered worker threads.
void(* ra8_wdt_sup_refresh_fn_t)(void)
Hook used to call into ra8_wdt_refresh_deferred.
ra8_err_t ra8_wdt_supervisor_set_refresh_hook(ra8_wdt_sup_refresh_fn_t refresh)
Override the WDT-refresh hook (test injection point).
ra8_err_t ra8_wdt_supervisor_start(void)
Spawn the supervisor thread.
ra8_wdt_sup_limits_t
Compile-time limits on the supervisor registry.
@ k_ra8_wdt_sup_max_threads
Max simultaneously registered threads.
@ k_ra8_wdt_sup_name_max
Max bytes (incl.
One-shot supervisor configuration block.
uint32_t stack_size_bytes
Size of stack in bytes (>= 512).
uint32_t refresh_period_ms
Tick period of the supervisor's loop.
uint32_t priority
ThreadX priority for the supervisor thread.
void * stack
Caller-owned byte region for the supervisor's stack.