42static const char*
s_tag =
"CANFD";
57typedef enum : uint32_t {
135 uint32_t word = masked;
292 for (uint8_t i = 0U; i < count; i++) {
326 for (uint8_t i = 0U; i < count; i++) {
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
CANFD Lite driver (bit-timing, TX, RX, error state).
@ k_ra8_canfd_afl_rule_capacity
One 16-entry AFL page (page 0).
static uint32_t internal_afl_id_word(const ra8_canfd_afl_rule_t *rule)
Assemble the CFDGAFLID word: accept ID plus IDE / RTR flags.
static uint32_t internal_afl_p1_word(const ra8_canfd_afl_rule_t *rule)
Assemble the CFDGAFLP1 word: route a match into RX FIFO target_rx.
static uint32_t internal_afl_mask_word(const ra8_canfd_afl_rule_t *rule)
Assemble the CFDGAFLM word: ID mask plus IDE / RTR compare-enables.
static void internal_afl_set_rule_count(volatile r_canfd_t *reg, uint8_t count)
Set CFDGAFLCFG0.RNC0 to count so the AFL consults count rules.
static void internal_afl_write_slot(volatile r_canfd_t *reg, uint8_t slot, const ra8_canfd_afl_rule_t *rule)
Write one CFDGAFL slot (ID / M / P0 / P1) from a rule.
ra8_err_t ra8_canfd_set_accept_filter(uint8_t channel, const ra8_canfd_afl_rule_t *rules, uint8_t count)
Program the channel Acceptance-Filter-List from a rule array.
static ra8_err_t internal_afl_validate_all(const ra8_canfd_afl_rule_t *rules, uint8_t count)
Validate every rule in rules before any register is touched.
static ra8_err_t internal_afl_validate_rule(const ra8_canfd_afl_rule_t *rule)
Range-check one ra8_canfd_afl_rule_t against the protocol limits.
ra8_canfd_afl_local_t
Local constants owned by the AFL list-config path.
@ k_ra8_canfd_afl_page0
AFLPN page index used by this API.
CANFD controller register layout for the Renesas RA8D2.
@ k_ra8_gaflp1_bit_gaflfdp0
Route to RX FIFO 0.
@ k_ra8_canfd_rx_fifo_count
CFDRFCC / CFDRFSTS array length.
@ k_ra8_canfd_id_std_mask
11-bit standard ID.
@ k_ra8_canfd_id_rtr
RTR: remote frame.
@ k_ra8_canfd_id_ext_mask
29-bit extended ID.
@ k_ra8_canfd_id_ide
IDE: extended flag.
@ k_ra8_gaflectr_mask_aflpn
RA8 gaflectr mask aflpn.
@ k_ra8_gaflectr_bit_afldae
RA8 gaflectr bit afldae.
static volatile r_canfd_t * ra8_canfd(uint8_t channel)
Get pointer to CANFD instance N (0..1).
@ k_ra8_gaflcfg0_mask_rnc0
RNC0 field is 5 bits.
@ k_ra8_gaflcfg0_shift_rnc0
Position of RNC0[4:0].
@ k_ra8_gaflm_bit_gaflidem
IDE-compare mask bit.
@ k_ra8_gaflm_bit_gaflrtrm
RTR-compare mask bit.
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_err_invalid_arg
Invalid function argument.
@ 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.
volatile uint32_t P1
+0x00C GAFLFDP.
volatile uint32_t M
+0x004 GAFLIDM + GAFLIFL1 + GAFLRTRM + IDEM.
volatile uint32_t P0
+0x008 GAFLDLC + GAFLIFL0 + GAFLRMDP + ...
volatile uint32_t ID
+0x000 GAFLID + GAFLLB + GAFLRTR + GAFLIDE.
volatile uint32_t CFDGAFLECTR
CFDGAFLECTR register (offset 0x028).
r_canfd_cfdgafl_t CFDGAFL[k_ra8_canfd_afl_page_size]
CFDGAFL register (offset 0x120 (0x100)).
volatile uint32_t CFDGAFLCFG0
CFDGAFLCFG0 register (offset 0x02C).
One Acceptance-Filter-List (AFL) rule: hardware ID/mask match plus an RX-FIFO routing target.
uint32_t id
Right-aligned accept ID (11- or 29-bit).
uint8_t target_rx
Destination RX FIFO index (0..1).
uint32_t mask
ID bit mask: 1 = must match, 0 = don't care.
bool extended
true = 29-bit extended ID, false = 11-bit std.
bool rtr
true = match remote frames, false = data frames.