ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_elc.h
Go to the documentation of this file.
1
45
46#pragma once
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#include <stdint.h>
53
54#include "ra8_elc_regs.h"
55#include "ra8_err.h"
56
61typedef enum : uint8_t {
65
83[[nodiscard]] ra8_err_t ra8_elc_init(void);
84
97[[nodiscard]] ra8_err_t ra8_elc_deinit(void);
98
116[[nodiscard]] ra8_err_t ra8_elc_link(uint8_t elsr_index, ra8_elc_event_t event);
117
133[[nodiscard]] ra8_err_t ra8_elc_unlink(uint8_t elsr_index);
134
165[[nodiscard]] ra8_err_t ra8_elc_software_trigger(uint8_t event_index);
166
179[[nodiscard]] ra8_err_t ra8_elc_is_enabled(bool* out_enabled);
180
181#ifdef __cplusplus
182}
183#endif
ra8_err_t ra8_elc_unlink(uint8_t elsr_index)
Clear one ELSR slot so it stops routing any event.
Definition ra8_elc.c:137
ra8_err_t ra8_elc_deinit(void)
Disable the ELC globally (ELCR.ELCON = 0) and stop the module.
Definition ra8_elc.c:120
ra8_err_t ra8_elc_link(uint8_t elsr_index, ra8_elc_event_t event)
Route an ELC event to an ELSR slot so the destination peripheral triggers on it.
Definition ra8_elc.c:127
ra8_err_t ra8_elc_is_enabled(bool *out_enabled)
Read ELCR.ELCON to verify the global enable state.
Definition ra8_elc.c:164
ra8_err_t ra8_elc_init(void)
Reset the ELC register block and enable the controller.
Definition ra8_elc.c:91
ra8_elc_dim_t
ELC register-array dimensions.
Definition ra8_elc.h:61
@ k_ra8_elc_segr_count
ELSEGR0..ELSEGR3 (FSP R_ELC_Type).
Definition ra8_elc.h:63
@ k_ra8_elc_elsr_count
ELSR0..ELSR52 (FSP R_ELC_Type).
Definition ra8_elc.h:62
ra8_err_t ra8_elc_software_trigger(uint8_t event_index)
Fire a software event via one of the ELSEGRn registers.
Definition ra8_elc.c:147
Event Link Controller (ELC) register layout for the Renesas RA8D2.
ra8_elc_event_t
Partial list of ELC events (populate as drivers need them).
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