57typedef enum : uint8_t {
void(* ra8_cac_event_fn_t)(void *ctx, uint8_t status_mask)
CAC event callback.
ra8_err_t ra8_cac_init(uint16_t upper, uint16_t lower)
Programme CAC with upper + lower bounds on measured cycles.
ra8_err_t ra8_cac_exit_stop(void)
Exit MSTP-gated stop.
ra8_cac_status_mask_t
CASTR status-flag bit masks (HUM Ch 10.2.5 "CASTR" p 424).
@ k_ra8_cac_status_ferrf
Frequency error (CASTR bit 0).
@ k_ra8_cac_status_none
RA8 cac status none.
@ k_ra8_cac_status_mendf
Measurement end (CASTR bit 1).
@ k_ra8_cac_status_ovff
Counter overflow (CASTR bit 2).
ra8_err_t ra8_cac_deinit(void)
Tear down the CAC (disable + MSTP release).
ra8_err_t ra8_cac_clear_status(uint8_t mask)
Clear the CASTR flag bits via CAICR.
void ra8_cac_dispatch(void)
Dispatch CAC events – snapshot + fire callback.
ra8_err_t ra8_cac_attach_handler(ra8_cac_event_fn_t fn, void *ctx)
Attach a callback for CAC events.
ra8_err_t ra8_cac_measure(uint16_t *out_count)
Kick off a CAC measurement and wait for completion.
ra8_err_t ra8_cac_get_status(uint8_t *out_mask)
Read the CASTR flag bits.
ra8_err_t ra8_cac_enter_stop(void)
Put CAC into MSTP-gated stop.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.