38static const char*
s_tag =
"IWDT";
55typedef enum : uint16_t {
148 reg->
IWDTSR = (uint16_t)(reg->
IWDTSR & (uint16_t)~mask);
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_ISR_SAFE
The function is callable from interrupt context.
Validation and Error-Checking Macros for ra8-firmware.
#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_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.
void ra8_iwdt_dispatch(void)
Dispatch an IWDT NMI event – snapshot status + fire callback.
ra8_iwdt_mask_t
Combined IWDTSR flag mask (UNDFF | REFEF).
@ k_ra8_iwdt_status_all
RA8 iwdt status all.
ra8_err_t ra8_iwdt_init(void)
Prepare the IWDT driver layer.
static ra8_iwdt_state_t s_iwdt_state
ra8_err_t ra8_iwdt_attach_handler(ra8_iwdt_event_fn_t fn, void *ctx)
Attach a handler for the IWDT NMI event.
ra8_err_t ra8_iwdt_get_status(uint16_t *out_mask)
Read the IWDTSR status bits (UNDFF / REFEF only).
ra8_err_t ra8_iwdt_get_counter(uint16_t *out_counter)
Read the live 14-bit IWDT down-counter (CNTVAL).
void ra8_iwdt_refresh_deferred(void)
Refresh the IWDT counter.
ra8_err_t ra8_iwdt_clear_status(void)
Clear the underflow / refresh-error flags via IWDTSR write.
Independent Watchdog driver header.
@ k_ra8_iwdt_status_refresh
IWDTSR.REFEF bit 15.
@ k_ra8_iwdt_status_underflow
IWDTSR.UNDFF bit 14.
void(* ra8_iwdt_event_fn_t)(void *ctx, uint16_t status_mask)
IWDT NMI underflow event callback.
Independent Watchdog Timer (IWDT) register layout for the RA8D2.
static volatile r_iwdt_regs_t * ra8_iwdt(void)
Get pointer to the IWDT register block.
static void ra8_iwdt_refresh(void)
Refresh the IWDT counter using the two-byte unlock sequence.
@ k_ra8_iwdt_sr_cnt_mask
CNTVAL[13:0] mask.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info(tag, message)
RA8 log info.
Memory-mapped layout of the IWDT block.
volatile uint16_t IWDTSR
+0x04 Status register.
Driver-wide runtime state.
ra8_iwdt_event_fn_t fn
Fn.