|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
EK-RA8D2 J35 camera clock, routing, reset, and SCCB adapter. More...
#include <stdint.h>#include "ra8_board_ek_ra8d2.h"#include "ra8_cgc.h"#include "ra8_check.h"#include "ra8_gpt.h"#include "ra8_i2c.h"#include "ra8_port_utils.h"#include "ra8_time.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_board_camera_protocol_t : uint8_t { k_camera_reg_address_bytes = 2U , k_camera_write_bytes = 3U , k_camera_high_byte_shift = 8U , k_camera_xclk_gpt_channel = 12U , k_camera_sw46_output = 0xDFU , k_camera_sw46_mask = 0x20U } |
| enum | ra8_board_camera_delay_t : uint32_t { k_camera_reset_low_ms = 20U , k_camera_reset_high_ms = 20U } |
| enum | ra8_board_camera_limit_t : uint32_t { k_camera_gpt_period_max = 0xFFFFU } |
Functions | |
| ra8_err_t | ra8_board_camera_xclk_start (uint32_t frequency_hz) |
| Start the J35 camera sensor input clock (XCLK) on P501/GTIOC12A. | |
| ra8_err_t | ra8_board_camera_select_parallel (void) |
| Drive only SW4-6 ON through U15, selecting J35 parallel DVP. | |
| ra8_err_t | ra8_board_camera_route_parallel_pins (void) |
| Route J35 D[7:0], VSYNC, HSYNC and PCLK to the CEU peripheral. | |
| ra8_err_t | ra8_board_camera_reset (void) |
| Pulse the J35 camera reset input and leave the sensor released. | |
| ra8_err_t | ra8_board_camera_sccb_read_reg (void *ctx, uint8_t address, uint16_t reg, uint8_t *out_value) |
| Read one 16-bit-addressed SCCB register on the J35 camera bus. | |
| ra8_err_t | ra8_board_camera_sccb_write_reg (void *ctx, uint8_t address, uint16_t reg, uint8_t value) |
| Write one 16-bit-addressed SCCB register on the J35 camera bus. | |
| void | ra8_board_camera_delay_ms (void *ctx, uint32_t milliseconds) |
| Millisecond delay adapter for transport-independent camera drivers. | |
Variables | |
| static const ra8_port_pin_t | s_camera_parallel_pins [] |
EK-RA8D2 J35 camera clock, routing, reset, and SCCB adapter.
Owns only board-specific GPT, U15, pin-mux, reset, and RIIC wiring; sensor protocol and capture policy remain in reusable libraries.
Definition in file ra8_board_ek_ra8d2_camera.c.
| enum ra8_board_camera_delay_t : uint32_t |
| Enumerator | |
|---|---|
| k_camera_reset_low_ms | Reset assertion interval. |
| k_camera_reset_high_ms | Reset release interval. |
Definition at line 35 of file ra8_board_ek_ra8d2_camera.c.
| enum ra8_board_camera_limit_t : uint32_t |
| Enumerator | |
|---|---|
| k_camera_gpt_period_max | Maximum GPT period register value. |
Definition at line 40 of file ra8_board_ek_ra8d2_camera.c.
| enum ra8_board_camera_protocol_t : uint8_t |
Definition at line 26 of file ra8_board_ek_ra8d2_camera.c.
| void ra8_board_camera_delay_ms | ( | void * | ctx, |
| uint32_t | milliseconds ) |
Millisecond delay adapter for transport-independent camera drivers.
Ignores ctx and delegates the bounded delay to ra8_delay_ms.
| [in] | ctx | Unused transport context; may be nullptr. |
| [in] | milliseconds | Delay duration. |
milliseconds is acceptable to the platform delay service. Definition at line 179 of file ra8_board_ek_ra8d2_camera.c.
References ra8_delay_ms().
Referenced by cam_sensor_bind(), internal_c6_cam_sensor_bind(), and sensor_bind().
|
nodiscard |
Pulse the J35 camera reset input and leave the sensor released.
Claims P709 as an output, holds reset low, then releases it high.
| k_ra8_ok | P709 was driven low, then high. |
| other | Forwarded GPIO initialization/write error. |
Definition at line 128 of file ra8_board_ek_ra8d2_camera.c.
References k_camera_reset_high_ms, k_camera_reset_low_ms, k_ra8_board_cam_rst, k_ra8_level_high, k_ra8_level_low, k_ra8_ok, ra8_delay_ms(), ra8_gpio_output_init(), and ra8_gpio_write().
Referenced by c6_cam_camera_init(), cam_run(), and internal_bring_up_sensor().
|
nodiscard |
Route J35 D[7:0], VSYNC, HSYNC and PCLK to the CEU peripheral.
Claims and muxes the eleven parallel-camera pads in board order.
| k_ra8_ok | Every parallel-camera pin was routed. |
| other | First propagated PFS routing error. |
Definition at line 113 of file ra8_board_ek_ra8d2_camera.c.
References k_ra8_ok, k_ra8_psel_ceu, ra8_pfs_route_peripheral(), and s_camera_parallel_pins.
Referenced by c6_cam_camera_init(), cam_prepare_capture(), and internal_bring_up_capture_pipeline().
|
nodiscard |
Read one 16-bit-addressed SCCB register on the J35 camera bus.
Signature intentionally matches the transport callback used by ra8_ov5640; the BSP remains independent of that optional sensor library.
| [in] | ctx | Unused transport context; may be nullptr. |
| [in] | address | 7-bit SCCB target address. |
| [in] | reg | 16-bit sensor register address. |
| [out] | out_value | Register value on success. |
| k_ra8_ok | One register byte was read. |
| k_ra8_err_null_ptr | out_value was nullptr. |
| other | Propagated RIIC transfer error. |
out_value contains the addressed register byte. Definition at line 146 of file ra8_board_ek_ra8d2_camera.c.
References k_camera_high_byte_shift, k_camera_reg_address_bytes, k_ra8_board_camera_i2c_channel, RA8_CHECK_NULL_PTR, and ra8_i2c_transfer().
Referenced by cam_sensor_bind(), internal_c6_cam_sensor_bind(), and sensor_sccb_read().
|
nodiscard |
Write one 16-bit-addressed SCCB register on the J35 camera bus.
| [in] | ctx | Unused transport context; may be nullptr. |
| [in] | address | 7-bit SCCB target address. |
| [in] | reg | 16-bit sensor register address. |
| [in] | value | Register value to write. |
| k_ra8_ok | The complete address and value payload was written. |
| other | Propagated RIIC write error. |
Definition at line 163 of file ra8_board_ek_ra8d2_camera.c.
References k_camera_high_byte_shift, k_camera_write_bytes, k_ra8_board_camera_i2c_channel, and ra8_i2c_write().
Referenced by cam_sensor_bind(), internal_c6_cam_sensor_bind(), and sensor_sccb_write().
|
nodiscard |
Drive only SW4-6 ON through U15, selecting J35 parallel DVP.
Applies a masked U15 override without changing unrelated switches.
| k_ra8_ok | U15 selected the parallel-camera path. |
| other | Propagated expander or RIIC error. |
Definition at line 106 of file ra8_board_ek_ra8d2_camera.c.
References k_camera_sw46_mask, k_camera_sw46_output, and ra8_board_io_expander_apply_sw4_mask().
Referenced by c6_cam_camera_init(), cam_bringup(), and internal_bring_up_sensor().
|
nodiscard |
Start the J35 camera sensor input clock (XCLK) on P501/GTIOC12A.
Configures GPT12 saw-PWM from PCLKD and routes its A output to P501.
| [in] | frequency_hz | Requested non-zero camera input-clock frequency. |
| k_ra8_ok | GPT12 is running and P501 is routed. |
| k_ra8_err_invalid_arg | The requested divisor is not representable. |
| other | Propagated clock, GPT, or pin-routing error. |
Definition at line 59 of file ra8_board_ek_ra8d2_camera.c.
References k_camera_gpt_period_max, k_camera_xclk_gpt_channel, k_ra8_board_cam_xclk, k_ra8_clock_id_pclkd, k_ra8_err_invalid_arg, k_ra8_gpt_disable_none, k_ra8_gpt_mode_saw_pwm, k_ra8_gpt_pin_a, k_ra8_gpt_pol_active_high, k_ra8_gpt_ps_div_1, k_ra8_gpt_stop_low, k_ra8_ok, k_ra8_pfs_dscr_high_speed_high, k_ra8_psel_gpt0, ra8_cgc_get_clock_hz(), ra8_gpt_init(), ra8_gpt_pwm_pin_configure(), ra8_pfs_route_peripheral(), and ra8_pfs_set_drive_strength().
Referenced by c6_cam_camera_init(), cam_bringup(), and internal_bring_up_sensor().
|
static |
Definition at line 44 of file ra8_board_ek_ra8d2_camera.c.
Referenced by ra8_board_camera_route_parallel_pins().