|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Capture Engine Unit (CEU) register layout for the RA8D2. More...
Go to the source code of this file.
Functions | |
| static volatile uint32_t * | ra8_ceu_reg32 (ra8_ceu_off_t offset) |
| Pointer to a 32-bit register inside the CEU window. | |
| static volatile uint32_t * | ra8_ceu_reg32_plane (ra8_ceu_off_t offset, ra8_ceu_plane_off_t plane) |
| Pointer to a 32-bit register on a specific CEU plane. | |
Capture Engine Unit (CEU) register layout for the RA8D2.
The CEU drives the parallel camera input path (VIO_D[15:0], VIO_VD, VIO_HD, VIO_CLK, VIO_FLD) and DMAs captured frames into SRAM/SDRAM. On the EK-RA8D2 board this is the path used by the on-board OV5640 5MP CMOS sensor.
Most CEU registers exist in three planes:
Per HUM Ch 60.2 Table 60.4 "Register configuration of CEU" p 3629, the offset registers (CAMOR, CAPWR), filter registers (CFLCR, CFSZR), destination width (CDWDR), every address register (CDAYR/CDACR/CDBYR/CDBCR/CBDSR), the low-pass and data output controls (CLFCR, CDOCR), and the bundle 2 address group (CDAYR2/CDACR2/CDBYR2/CDBCR2) all expose the three-plane window. Single-plane registers – CAPSR, CAPCR, CAMCR, CMCYR, CAIFR, CRCNTR, CRCMPR, CFWCR, CEIER, CETCR, CSTSR, CDSSR – only have a Plane A address and ignore the +0x1000 / +0x2000 offsets.
| Offset | Name | R/W | Purpose |
|---|---|---|---|
| 0x0000 | CAPSR | R/W | Capture start (CE) / software reset (CPKIL) |
| 0x0004 | CAPCR | R/W | Capture control (continuous, burst mode) |
| 0x0008 | CAMCR | R/W | Camera interface control |
| 0x000C | CMCYR | R/W | Camera interface cycle (HCYL / VCYL) |
| 0x0010 | CAMOR | R/W | Camera offset (HOFST / VOFST) [3-plane] |
| 0x0014 | CAPWR | R/W | Camera capture width (HWDTH / VWDTH) |
| 0x0018 | CAIFR | R/W | Camera interface input format |
| 0x0028 | CRCNTR | R/W | Register control (plane-swap) |
| 0x002C | CRCMPR | R/W | Register forcible control |
| 0x0030 | CFLCR | R/W | Capture filter control (scale-down factor) |
| 0x0034 | CFSZR | R/W | Capture filter size clip |
| 0x0038 | CDWDR | R/W | Capture destination width |
| 0x003C | CDAYR | R/W | Capture data Y address (top-field / frame) |
| 0x0040 | CDACR | R/W | Capture data C address |
| 0x0044 | CDBYR | R/W | Capture data Y bottom-field |
| 0x0048 | CDBCR | R/W | Capture data C bottom-field |
| 0x004C | CBDSR | R/W | Capture bundle destination size |
| 0x005C | CFWCR | R/W | Firewall operation control |
| 0x0060 | CLFCR | R/W | Low-pass filter control |
| 0x0064 | CDOCR | R/W | Data output control (byte swap, format) |
| 0x0070 | CEIER | R/W | Event interrupt enable |
| 0x0074 | CETCR | R/W | Event flag clear (write-0-to-clear) |
| 0x007C | CSTSR | R | Status (CPTON: capture in progress) |
| 0x0084 | CDSSR | R/W | Data size status |
| 0x0090 | CDAYR2 | R/W | Bundle 2 Y address |
| 0x0094 | CDACR2 | R/W | Bundle 2 C address |
| 0x0098 | CDBYR2 | R/W | Bundle 2 Y bottom-field |
| 0x009C | CDBCR2 | R/W | Bundle 2 C bottom-field |
The base address itself is already declared in ra8_glcdc_regs.h (k_ra8_ceu_base_addr in the ra8_display_addr_t enum), so this header pulls that header in rather than redeclaring the constant.
Definition in file ra8_ceu_regs.h.
| enum ra8_ceu_align_t : uint32_t |
Capture buffer alignment requirement.
The CDAYR / CDACR / CDBYR / CDBCR address registers require their lower 3 bits to be zero (8-byte alignment) per HUM Ch 60.2.13 "CDAYR" / 60.2.14 "CDACR" / 60.2.15 "CDBYR" / 60.2.16 "CDBCR" p 3656-3658.
| Enumerator | |
|---|---|
| k_ra8_ceu_buffer_align_bytes | RA8 CEU buffer align bytes. |
Definition at line 640 of file ra8_ceu_regs.h.
| enum ra8_ceu_burst_align_t : uint32_t |
CBDSR write-granularity alignment.
HUM Ch 60.2.17 p 3660 says CBDSR writes ignore the lower 3 bits.
| Enumerator | |
|---|---|
| k_ra8_ceu_bundle_align_mask | RA8 CEU bundle align mask. |
Definition at line 651 of file ra8_ceu_regs.h.
| enum ra8_ceu_caifr_mask_t : uint32_t |
CAIFR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_caifr_mask_fci | FCI[1:0] mask. |
| k_ra8_ceu_caifr_mask_cim | CIM mask. |
| k_ra8_ceu_caifr_mask_ifs | IFS mask. |
Definition at line 334 of file ra8_ceu_regs.h.
| enum ra8_ceu_caifr_shift_t : uint8_t |
CAIFR (offset 0x0018) field shifts.
HUM Ch 60.2.7 "CAIFR : Camera Interface Input Format Register" p 3647 splits the register into:
| Enumerator | |
|---|---|
| k_ra8_ceu_caifr_shift_fci | FCI[1:0] @ [1:0]. |
| k_ra8_ceu_caifr_shift_cim | CIM @ bit 4. |
| k_ra8_ceu_caifr_shift_ifs | IFS @ bit 8. |
Definition at line 324 of file ra8_ceu_regs.h.
| enum ra8_ceu_camcr_mask_t : uint32_t |
CAMCR field masks.
Definition at line 227 of file ra8_ceu_regs.h.
| enum ra8_ceu_camcr_shift_t : uint8_t |
CAMCR (offset 0x0008) field shifts.
Per HUM Ch 60.2.3 "CAMCR : Camera Interface Control Register" p 3636-3641 the layout is:
Definition at line 210 of file ra8_ceu_regs.h.
| enum ra8_ceu_camor_mask_t : uint32_t |
CAMOR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_camor_mask_hofst | HOFST @ [12:0]. |
| k_ra8_ceu_camor_mask_vofst | VOFST @ [27:16]. |
Definition at line 283 of file ra8_ceu_regs.h.
| enum ra8_ceu_camor_shift_t : uint8_t |
CAMOR (offset 0x0010) field shifts.
HUM Ch 60.2.5 "CAMOR : Camera Interface Offset Register" p 3642 splits the register into:
| Enumerator | |
|---|---|
| k_ra8_ceu_camor_shift_hofst | HOFST[12:0] @ [12:0]. |
| k_ra8_ceu_camor_shift_vofst | VOFST[11:0] @ [27:16]. |
Definition at line 274 of file ra8_ceu_regs.h.
| enum ra8_ceu_capcr_mask_t : uint32_t |
CAPCR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_capcr_mask_ctncp | CTNCP: continuous mode. |
| k_ra8_ceu_capcr_mask_mtcm | MTCM[1:0] burst-size sel. |
| k_ra8_ceu_capcr_mask_fdrp | FDRP[7:0] frame-drop cnt. |
Definition at line 186 of file ra8_ceu_regs.h.
| enum ra8_ceu_capcr_shift_t : uint8_t |
CAPCR (offset 0x0004) field shifts.
Per HUM Ch 60.2.2 "CAPCR : Capture Control Register" p 3634-3635 the layout is:
| Enumerator | |
|---|---|
| k_ra8_ceu_capcr_shift_ctncp | CTNCP @ bit 16. |
| k_ra8_ceu_capcr_shift_mtcm | MTCM[1:0] @ [21:20]. |
| k_ra8_ceu_capcr_shift_fdrp | FDRP[7:0] @ [31:24]. |
Definition at line 176 of file ra8_ceu_regs.h.
| enum ra8_ceu_capsr_bit_t : uint8_t |
CAPSR (offset 0x0000) bit positions.
Per HUM Ch 60.2.1 "CAPSR : Capture Start Register" p 3630-3631:
| Enumerator | |
|---|---|
| k_ra8_ceu_capsr_bit_ce | CE @ bit 0. |
| k_ra8_ceu_capsr_bit_cpkil | CPKIL @ bit 16. |
Definition at line 151 of file ra8_ceu_regs.h.
| enum ra8_ceu_capsr_mask_t : uint32_t |
CAPSR bit masks (full 32-bit register).
| Enumerator | |
|---|---|
| k_ra8_ceu_capsr_mask_ce | CE: capture-enable bit. |
| k_ra8_ceu_capsr_mask_cpkil | CPKIL: software reset bit. |
Definition at line 160 of file ra8_ceu_regs.h.
| enum ra8_ceu_capwr_mask_t : uint32_t |
CAPWR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_capwr_mask_hwdth | RA8 CEU capwr mask hwdth. |
| k_ra8_ceu_capwr_mask_vwdth | RA8 CEU capwr mask vwdth. |
Definition at line 307 of file ra8_ceu_regs.h.
| enum ra8_ceu_capwr_shift_t : uint8_t |
CAPWR (offset 0x0014) field shifts.
HUM Ch 60.2.6 "CAPWR : Camera Interface Width Register" p 3646 splits the register into:
| Enumerator | |
|---|---|
| k_ra8_ceu_capwr_shift_hwdth | HWDTH[12:0] @ [12:0]. |
| k_ra8_ceu_capwr_shift_vwdth | VWDTH[11:0] @ [27:16]. |
Definition at line 298 of file ra8_ceu_regs.h.
| enum ra8_ceu_cbdsr_mask_t : uint32_t |
CBDSR (offset 0x004C) bit masks.
HUM Ch 60.2.17 "CBDSR : Capture Bundle Destination Size Register" p 3660. Number of lines (image / sync fetch) or bytes (data-enable fetch) for each bundle write. Writes to bits [2:0] are ignored (8-line / 32-byte alignment).
| Enumerator | |
|---|---|
| k_ra8_ceu_cbdsr_mask_cbvs | CBVS[22:0] bundle size. |
Definition at line 445 of file ra8_ceu_regs.h.
| enum ra8_ceu_cdocr_mask_t : uint32_t |
CDOCR field masks.
Definition at line 513 of file ra8_ceu_regs.h.
| enum ra8_ceu_cdocr_shift_t : uint8_t |
CDOCR (offset 0x0064) field shifts.
HUM Ch 60.2.20 "CDOCR : Capture Data Output Control Register" p 3662-3663:
Definition at line 501 of file ra8_ceu_regs.h.
| enum ra8_ceu_cdssr_mask_t : uint32_t |
CDSSR (offset 0x0084) bit mask.
HUM Ch 60.2.24 "CDSSR : Capture Data Size Register" p 3674. The full 32 bits hold the byte count written by the most recent data-enable-fetch capture. In bundle-write mode the value is the tail count after the last bundle boundary; if the boundary coincides with the capture-end the register reads 0.
| Enumerator | |
|---|---|
| k_ra8_ceu_cdssr_mask_cdss | CDSS[31:0] data byte count. |
Definition at line 626 of file ra8_ceu_regs.h.
| enum ra8_ceu_cdwdr_mask_t : uint32_t |
CDWDR (offset 0x0038) bit masks.
HUM Ch 60.2.12 "CDWDR : Capture Destination Width Register" p 3654. Holds the destination horizontal stride in 4-byte units.
| Enumerator | |
|---|---|
| k_ra8_ceu_cdwdr_mask_chdw | CHDW[12:0] stride. |
Definition at line 431 of file ra8_ceu_regs.h.
| enum ra8_ceu_cetcr_mask_t : uint32_t |
CETCR (offset 0x0074) event flag bit positions.
HUM Ch 60.2.22 "CETCR : Capture Event Flag Clear Register" p 3664-3667. CEIER uses identical bit positions to gate which events raise the CEU IRQ. Writing 0 to any CETCR bit clears it (write-0-to-clear); writing 1 leaves it asserted.
Every documented event in HUM Table 60.10 / Figure 60.45 is enumerated here so the dispatcher can fan out the full mask:
| Bit | Mnemonic | Description |
|---|---|---|
| 0 | CPE | One-frame capture end |
| 1 | CFE | One-field capture end |
| 4 | IGRW | Illegal register write during capture |
| 8 | HD | Horizontal sync detect |
| 9 | VD | Vertical sync detect |
| 12 | CPBE1 | Bundle write end on CDAYR / CDACR |
| 13 | CPBE2 | Bundle write end on CDAYR2 / CDACR2 |
| 14 | CPBE3 | Bundle write end on CDBYR / CDBCR |
| 15 | CPBE4 | Bundle write end on CDBYR2 / CDBCR2 |
| 16 | CDTOF | CRAM overflow |
| 17 | IGHS | HD-line-count mismatch vs CMCYR |
| 18 | IGVS | VD-line-count mismatch vs CMCYR |
| 20 | VBP | Invalid VD condition |
| 23 | FWF | Firewall address fault |
| 24 | NHD | HD expected but absent |
| 25 | NVD | VD expected but absent |
Definition at line 571 of file ra8_ceu_regs.h.
| enum ra8_ceu_cflcr_mask_t : uint32_t |
CFLCR field masks.
Definition at line 393 of file ra8_ceu_regs.h.
| enum ra8_ceu_cflcr_shift_t : uint8_t |
CFLCR (offset 0x0030) field shifts.
HUM Ch 60.2.10 "CFLCR : Capture Filter Control Register" p 3650. Scale-down factor encoded as fixed-point fraction.fmant:
Definition at line 382 of file ra8_ceu_regs.h.
| enum ra8_ceu_cfszr_mask_t : uint32_t |
CFSZR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_cfszr_mask_hfclp | RA8 CEU cfszr mask hfclp. |
| k_ra8_ceu_cfszr_mask_vfclp | RA8 CEU cfszr mask vfclp. |
Definition at line 418 of file ra8_ceu_regs.h.
| enum ra8_ceu_cfszr_shift_t : uint8_t |
CFSZR (offset 0x0034) field shifts.
HUM Ch 60.2.11 "CFSZR : Capture Filter Size Clip Register" p 3651:
| Enumerator | |
|---|---|
| k_ra8_ceu_cfszr_shift_hfclp | RA8 CEU cfszr shift hfclp. |
| k_ra8_ceu_cfszr_shift_vfclp | RA8 CEU cfszr shift vfclp. |
Definition at line 409 of file ra8_ceu_regs.h.
| enum ra8_ceu_cfwcr_mask_t : uint32_t |
CFWCR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_cfwcr_mask_fwe | FWE: enable. |
| k_ra8_ceu_cfwcr_mask_fwv | FWV[26:0] @ [31:5]. |
Definition at line 470 of file ra8_ceu_regs.h.
| enum ra8_ceu_cfwcr_shift_t : uint8_t |
CFWCR (offset 0x005C) field shifts.
HUM Ch 60.2.18 "CFWCR : Firewall Operation Control Register" p 3661. Programs a TrustZone-style window of legal write addresses for data-enable fetch:
| Enumerator | |
|---|---|
| k_ra8_ceu_cfwcr_shift_fwe | RA8 CEU cfwcr shift fwe. |
| k_ra8_ceu_cfwcr_shift_fwv | RA8 CEU cfwcr shift fwv. |
Definition at line 461 of file ra8_ceu_regs.h.
| enum ra8_ceu_clfcr_mask_t : uint32_t |
CLFCR (offset 0x0060) bit masks.
HUM Ch 60.2.19 "CLFCR : Capture Low-Pass Filter Control Register" p 3662. Single-bit enable for the input low-pass filter ahead of the scale-down stage.
| Enumerator | |
|---|---|
| k_ra8_ceu_clfcr_mask_lpf | LPF: enable LPF. |
Definition at line 484 of file ra8_ceu_regs.h.
| enum ra8_ceu_cmcyr_mask_t : uint32_t |
CMCYR field masks.
| Enumerator | |
|---|---|
| k_ra8_ceu_cmcyr_mask_hcyl | HCYL[13:0] @ [13:0]. |
| k_ra8_ceu_cmcyr_mask_vcyl | VCYL[13:0] @ [29:16]. |
Definition at line 259 of file ra8_ceu_regs.h.
| enum ra8_ceu_cmcyr_shift_t : uint8_t |
CMCYR (offset 0x000C) field shifts.
HUM Ch 60.2.4 "CMCYR : Camera Interface Cycle Register" p 3641 splits the register into:
| Enumerator | |
|---|---|
| k_ra8_ceu_cmcyr_shift_hcyl | HCYL[13:0] @ [13:0]. |
| k_ra8_ceu_cmcyr_shift_vcyl | VCYL[13:0] @ [29:16]. |
Definition at line 250 of file ra8_ceu_regs.h.
| enum ra8_ceu_crcmpr_mask_t : uint32_t |
CRCMPR (offset 0x002C) bit masks.
HUM Ch 60.2.9 "CRCMPR : CEU Register Forcible Control Register" p 3649. Bit 0 (RA) forces an immediate plane swap regardless of VD timing.
| Enumerator | |
|---|---|
| k_ra8_ceu_crcmpr_mask_ra | RA: force plane swap. |
Definition at line 366 of file ra8_ceu_regs.h.
| enum ra8_ceu_crcntr_mask_t : uint32_t |
CRCNTR (offset 0x0028) bit masks.
HUM Ch 60.2.8 "CRCNTR : CEU Register Control Register" p 3649 lays out the plane-swap control:
| Enumerator | |
|---|---|
| k_ra8_ceu_crcntr_mask_rc | RC: enable Plane A. |
| k_ra8_ceu_crcntr_mask_rs | RS: enable Plane B. |
| k_ra8_ceu_crcntr_mask_rvs | RVS: VD-sync update. |
Definition at line 351 of file ra8_ceu_regs.h.
| enum ra8_ceu_cstsr_mask_t : uint32_t |
CSTSR (offset 0x007C) status bit masks.
HUM Ch 60.2.23 "CSTSR : Capture Status Register" p 3672. CSTSR is read-only:
| Enumerator | |
|---|---|
| k_ra8_ceu_cstsr_mask_cpton | CPTON: capture running. |
| k_ra8_ceu_cstsr_mask_cpfld | CPFLD: current field. |
| k_ra8_ceu_cstsr_mask_crst | CRST: reset in flight. |
Definition at line 533 of file ra8_ceu_regs.h.
| enum ra8_ceu_evt_mask_group_t : uint32_t |
Convenience groupings of CETCR events for callbacks.
Hand-curated unions of ra8_ceu_cetcr_mask_t values that callers tend to enable as a set. k_ra8_ceu_evt_mask_all_errors covers every fault condition the HUM lists; k_ra8_ceu_evt_mask_all is the universal mask used by ra8_ceu_clear_status callers that want to ack every pending flag.
Definition at line 601 of file ra8_ceu_regs.h.
| enum ra8_ceu_firewall_align_t : uint32_t |
CFWCR.FWV alignment.
Per HUM Ch 60.2.18 p 3661 the firewall value is the upper 27 bits of an address; the lower 5 bits are forced to 0x1F. This mask is used by ra8_ceu_firewall_set to compose the value.
| Enumerator | |
|---|---|
| k_ra8_ceu_firewall_align_mask | RA8 CEU firewall align mask. |
Definition at line 664 of file ra8_ceu_regs.h.
| enum ra8_ceu_off_t : uint16_t |
Plane A register offsets inside the CEU window.
Verified byte-for-byte against HUM Ch 60.2 Table 60.4 "Register configuration of CEU" p 3629-3630. Mirror addresses for the Plane A view (used by this driver) follow the FSP convention of "+0x1000 -> Plane B, +0x2000 -> mirror" – see ra8_ceu_plane_off_t and ra8_ceu_reg32_plane.
Definition at line 111 of file ra8_ceu_regs.h.
| enum ra8_ceu_plane_off_t : uint16_t |
Plane stride between Plane A, Plane B, and the mirror view.
Per HUM Ch 60.2 Table 60.4 "Register configuration of CEU" p 3629-3630, only a subset of CEU registers expose the three-plane layout; for those that do, Plane B sits at base
| Enumerator | |
|---|---|
| k_ra8_ceu_plane_a_off | Plane A (active). |
| k_ra8_ceu_plane_b_off | Plane B (shadow). |
| k_ra8_ceu_plane_mirror_off | Mirror (inactive plane). |
Definition at line 94 of file ra8_ceu_regs.h.
|
inlinestatic |
Pointer to a 32-bit register inside the CEU window.
All CEU registers are 32 bits wide and accessed by 32-bit reads and writes (HUM Ch 60.2 Table 60.4 "Access size" column = 32).
| [in] | offset | One of the k_ra8_ceu_off_* enum values. |
Definition at line 692 of file ra8_ceu_regs.h.
References k_ra8_ceu_base_addr.
Referenced by internal_arm_capture(), internal_program_addresses(), internal_wait_idle(), priv_ra8_ceu_program_destination(), priv_ra8_ceu_program_format(), priv_ra8_ceu_program_geometry(), ra8_ceu_bundle_size_set(), ra8_ceu_byte_swap_set(), ra8_ceu_capture_disarm(), ra8_ceu_capture_mode_set(), ra8_ceu_capture_start(), ra8_ceu_clear_status(), ra8_ceu_data_size_get(), ra8_ceu_deinit(), ra8_ceu_dispatch(), ra8_ceu_enter_stop(), ra8_ceu_firewall_set(), ra8_ceu_frame_drop_set(), ra8_ceu_get_status(), ra8_ceu_init(), ra8_ceu_interrupts_set(), ra8_ceu_low_pass_set(), ra8_ceu_plane_b_program(), ra8_ceu_plane_swap_force(), ra8_ceu_reset(), and ra8_ceu_status_snapshot().
|
inlinestatic |
Pointer to a 32-bit register on a specific CEU plane.
Most CEU registers expose a 3-plane layout per HUM Ch 60.2 Table 60.4 p 3629-3630. This helper composes k_ra8_ceu_base_addr + plane + offset so callers can read/write the Plane B view (+0x1000) or the mirror (+0x2000) without doing the arithmetic themselves.
| [in] | offset | Plane-A offset of the target register. |
| [in] | plane | Which plane to address. |
Definition at line 727 of file ra8_ceu_regs.h.
References k_ra8_ceu_base_addr.
Referenced by internal_plane_b_apply_overrides(), and internal_plane_b_mirror_from_a().