35typedef enum : uint8_t {
ra8_err_t ra8_acmphs_channel_enable(uint8_t channel)
Enable a single ACMPHS channel.
ra8_err_t ra8_acmphs_set_inputs(uint8_t channel, uint8_t ivpsel, uint8_t ivrefsel)
Change the input selection of one channel at runtime.
void ra8_acmphs_dispatch(uint8_t channel)
Dispatch an ACMPHS edge event – fire the registered callback.
ra8_err_t ra8_acmphs_channel_init(uint8_t channel, const ra8_acmphs_cfg_t *cfg)
Initialise one channel with a full config descriptor.
ra8_err_t ra8_acmphs_channel_deinit(uint8_t channel)
Tear down one channel (disable + clear CMPCTL).
ra8_err_t ra8_acmphs_read_output(uint8_t channel, ra8_level_t *out)
Read the live output of a channel.
ra8_err_t ra8_acmphs_exit_stop(uint8_t channel)
Exit MSTP-gated stop for one channel.
ra8_err_t ra8_acmphs_enter_stop(uint8_t channel)
Put one channel into MSTP-gated stop.
ra8_err_t ra8_acmphs_get_status(uint8_t channel, uint8_t *out_mask)
Read CMPCTL enable / edge bits.
ra8_err_t ra8_acmphs_clear_status(uint8_t channel)
Clear CMPCTL (disable + edge mode off) for one channel.
ra8_err_t ra8_acmphs_init(void)
Legacy init – reset every channel to its power-on state.
ra8_err_t ra8_acmphs_attach_handler(ra8_acmphs_event_fn_t fn, void *ctx)
Attach an ACMPHS event callback (shared across all channels).
void(* ra8_acmphs_event_fn_t)(void *ctx, uint8_t channel)
ACMPHS edge event callback.
ra8_acmphs_edge_t
Edge detection mode (CMPCTL.CEG).
@ k_ra8_acmphs_edge_rise
Rising edge.
@ k_ra8_acmphs_edge_fall
Falling edge.
@ k_ra8_acmphs_edge_none
Polling only, no edge trigger.
@ k_ra8_acmphs_edge_both
Either edge.
High-Speed Analog Comparator (ACMPHS) register layout for the RA8D2.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Typed Port / Pin Constants for the RA8D2 IOPORT Module.
ra8_level_t
Digital output / input level.
Configuration descriptor for ra8_acmphs_channel_init.
uint8_t ivpsel
Plus-input select (CMPSEL0).
bool invert_out
True -> invert output.
ra8_acmphs_edge_t edge
Edge detect mode.
bool filter_en
True -> enable filter.
uint8_t ivrefsel
Minus-input select (CMPSEL1).