36static const char*
s_tag =
"DOC";
59 reg->
DOCR = (uint8_t)mode;
90 volatile uint16_t* dodsr0 = (
volatile uint16_t*)®->
DODSR0;
91 volatile uint16_t* dodir = (
volatile uint16_t*)®->
DODIR;
154 if (lower >= upper) {
164 volatile uint16_t* dodsr0 = (
volatile uint16_t*)®->
DODSR0;
165 volatile uint16_t* dodsr1 = (
volatile uint16_t*)®->
DODSR1;
205 volatile uint16_t* dodir = (
volatile uint16_t*)®->
DODIR;
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).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
static void internal_ra8_doc_set_mode_16(ra8_docr_oms_t mode)
Write mode into DOCR.OMS[1:0], clearing DOBW for 16-bit ops.
ra8_err_t ra8_doc_add16(uint16_t a, uint16_t b, uint16_t *out_sum)
Perform a 16-bit hardware add.
static uint16_t internal_ra8_doc_run_16(uint16_t seed, uint16_t operand)
Run the 16-bit DOC operation sequence and return the result.
ra8_err_t ra8_doc_sub16(uint16_t a, uint16_t b, uint16_t *out_diff)
Perform a 16-bit hardware subtract.
ra8_err_t ra8_doc_window_compare(uint16_t value, bool *out_flag)
Implementation of ra8_doc_window_compare() – writes DODIR, reads DOPCF.
ra8_err_t ra8_doc_set_window(uint16_t lower, uint16_t upper, ra8_doc_window_polarity_t polarity)
Implementation of ra8_doc_set_window() – programs DOCR/DODSR0/DODSR1.
ra8_err_t ra8_doc_init(void)
Reset the DOC control register to its reset state.
Data Operation Circuit (DOC) driver header.
ra8_doc_window_polarity_t
Window-comparison polarity for ra8_doc_set_window().
@ k_ra8_doc_window_outside
Flag when DODIR < DODSR0 or DODSR1 < DODIR.
Data Operation Circuit (DOC) register layout for the Renesas RA8D2.
@ k_ra8_doc_mask_dopcf
Data-operation circuit flag.
ra8_docr_oms_t
Operation-mode codes written to DOCR.OMS[1:0] (HUM 57.2.1 p 3519).
@ k_ra8_doc_mode_add
Add of DODIR into DODSR0.
@ k_ra8_doc_mode_subtract
Subtract of DODIR from DODSR0.
static volatile r_doc_regs_t * ra8_doc(void)
Get a pointer to the DOC register block.
@ k_ra8_doc_bit_dcsel
Detection condition select bit 0.
@ k_ra8_doc_mask_oms
OMS[1:0] field mask.
@ k_ra8_doc_mask_dcsel
DCSEL[2:0] field mask in DOCR (bits 6:4).
@ k_ra8_doc_mask_dopcfcl
Write 1 to clear DOPCF.
@ k_ra8_doc_dcsel_inside
Set DOPCF when DODSR0 < DODIR < DODSR1 (inside window).
@ k_ra8_doc_dcsel_outside
Set DOPCF when DODIR < DODSR0 or DODSR1 < DODIR (outside).
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ 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.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info(tag, message)
RA8 log info.
#define ra8_log_error(tag, message)
RA8 log error.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
@ k_ra8_mstp_doc
MSTPC13 DOC.
DOC_B register window (HUM Ch 57.2 p 3519-3522).
volatile uint32_t DODSR1
+0x14 Upper window threshold.
volatile uint32_t DODIR
+0x0C Data input (access at DOBW width).
volatile uint8_t DOSR
+0x04 Status flag (DOPCF).
volatile uint8_t DOSCR
+0x08 Status clear (DOPCFCL, write-only).
volatile uint32_t DODSR0
+0x10 Reference / running result.
volatile uint8_t DOCR
+0x00 Control (mode, width, DCSEL).