ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_ov5640.h
Go to the documentation of this file.
1
18
19#pragma once
20
21#include <stdint.h>
22
23#include "ra8_err.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
30typedef enum : uint16_t {
33
38
44
51
52typedef ra8_err_t (*ra8_ov5640_read_fn_t)(void* ctx,
53 uint8_t address,
54 uint16_t reg,
55 uint8_t* out_value);
56typedef ra8_err_t (*ra8_ov5640_write_fn_t)(void* ctx, uint8_t address, uint16_t reg, uint8_t value);
57typedef void (*ra8_ov5640_delay_fn_t)(void* ctx, uint32_t milliseconds);
58
66
68typedef struct {
70 uint8_t address;
73
87
103[[nodiscard]] ra8_err_t ra8_ov5640_init(ra8_ov5640_t* dev, const ra8_ov5640_bus_t* bus);
104
122[[nodiscard]] ra8_err_t ra8_ov5640_probe(ra8_ov5640_t* dev, uint16_t* out_id);
123
143
167 uint8_t quant_scale);
168
189 ra8_ov5640_jpeg_status_t* out_status);
190
207[[nodiscard]] ra8_err_t ra8_ov5640_stream_set(ra8_ov5640_t* dev, bool enabled);
208
227[[nodiscard]] ra8_err_t ra8_ov5640_read_reg(ra8_ov5640_t* dev, uint16_t reg, uint8_t* out_value);
228
247[[nodiscard]] ra8_err_t ra8_ov5640_write_reg(ra8_ov5640_t* dev, uint16_t reg, uint8_t value);
248
249#ifdef __cplusplus
250}
251#endif
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
ra8_err_t ra8_ov5640_read_reg(ra8_ov5640_t *dev, uint16_t reg, uint8_t *out_value)
Read one sensor register through the bound transport.
Definition ra8_ov5640.c:500
ra8_ov5640_id_t
OV5640 identity and SCCB address constants.
Definition ra8_ov5640.h:30
@ k_ra8_ov5640_chip_id
Expected combined chip identifier.
Definition ra8_ov5640.h:31
ra8_err_t ra8_ov5640_write_reg(ra8_ov5640_t *dev, uint16_t reg, uint8_t value)
Write one sensor register through the bound transport.
Definition ra8_ov5640.c:511
ra8_err_t(* ra8_ov5640_read_fn_t)(void *ctx, uint8_t address, uint16_t reg, uint8_t *out_value)
Definition ra8_ov5640.h:52
ra8_err_t ra8_ov5640_stream_set(ra8_ov5640_t *dev, bool enabled)
Enter software standby or resume sensor streaming.
Definition ra8_ov5640.c:971
ra8_err_t ra8_ov5640_configure(ra8_ov5640_t *dev, ra8_ov5640_mode_t mode)
Software-reset and program one validated output mode.
Definition ra8_ov5640.c:801
ra8_err_t ra8_ov5640_jpeg_status_get(ra8_ov5640_t *dev, ra8_ov5640_jpeg_status_t *out_status)
Snapshot sensor JPEG length, overflow, and routing controls.
Definition ra8_ov5640.c:936
ra8_err_t ra8_ov5640_probe(ra8_ov5640_t *dev, uint16_t *out_id)
Probe both legal SCCB addresses and verify chip ID 0x5640.
Definition ra8_ov5640.c:612
ra8_ov5640_mode_t
Sensor output modes with validated register tables.
Definition ra8_ov5640.h:40
@ k_ra8_ov5640_mode_vga_jpeg
Sensor-encoded VGA JPEG stream.
Definition ra8_ov5640.h:42
@ k_ra8_ov5640_mode_vga_uyvy
Packed VGA UYVY DVP stream.
Definition ra8_ov5640.h:41
ra8_err_t ra8_ov5640_init(ra8_ov5640_t *dev, const ra8_ov5640_bus_t *bus)
Bind a caller-supplied SCCB transport without touching the sensor.
Definition ra8_ov5640.c:484
ra8_err_t ra8_ov5640_set_jpeg_quantization_scale(ra8_ov5640_t *dev, uint8_t quant_scale)
Set the sensor JPEG encoder's raw quantization scale.
Definition ra8_ov5640.c:833
ra8_ov5640_jpeg_quant_scale_t
Raw OV5640 JPEG quantization-scale bounds and documented presets.
Definition ra8_ov5640.h:46
@ k_ra8_ov5640_jpeg_quant_scale_max
Lowest-quality raw scale.
Definition ra8_ov5640.h:49
@ k_ra8_ov5640_jpeg_quant_scale_default
Vendor reset-scale value.
Definition ra8_ov5640.h:48
@ k_ra8_ov5640_jpeg_quant_scale_min
Highest-quality raw scale.
Definition ra8_ov5640.h:47
void(* ra8_ov5640_delay_fn_t)(void *ctx, uint32_t milliseconds)
Definition ra8_ov5640.h:57
ra8_err_t(* ra8_ov5640_write_fn_t)(void *ctx, uint8_t address, uint16_t reg, uint8_t value)
Definition ra8_ov5640.h:56
ra8_ov5640_addr_t
Definition ra8_ov5640.h:34
@ k_ra8_ov5640_addr_primary
Default seven-bit SCCB address.
Definition ra8_ov5640.h:35
@ k_ra8_ov5640_addr_secondary
Alternate seven-bit SCCB address.
Definition ra8_ov5640.h:36
Injected SCCB and time services.
Definition ra8_ov5640.h:60
ra8_ov5640_write_fn_t write_reg
Injected single-register write.
Definition ra8_ov5640.h:62
ra8_ov5640_delay_fn_t delay_ms
Injected millisecond delay.
Definition ra8_ov5640.h:63
void * ctx
Caller-owned transport context.
Definition ra8_ov5640.h:64
ra8_ov5640_read_fn_t read_reg
Injected single-register read.
Definition ra8_ov5640.h:61
Snapshot of the OV5640 JPEG pipeline and its most recent frame.
Definition ra8_ov5640.h:75
uint16_t compression_height
Mode-2 compressed-output height.
Definition ra8_ov5640.h:78
uint8_t vfifo_ctrl00
Raw VFIFO mode-2 height control.
Definition ra8_ov5640.h:80
uint16_t compression_width
Mode-2 compressed-output width.
Definition ra8_ov5640.h:77
bool header_output
JPEG header generation is enabled.
Definition ra8_ov5640.h:84
bool compression_enabled
Timing pipeline selects JPEG output.
Definition ra8_ov5640.h:85
bool fifo_overflow
JPEG output FIFO overflow indicator.
Definition ra8_ov5640.h:82
uint8_t jpeg_ctrl01
Raw JPEG CTRL01 pacing controls.
Definition ra8_ov5640.h:79
bool input_is_yuv422
JPEG input format selects YUV422.
Definition ra8_ov5640.h:83
uint32_t encoded_bytes
Sensor-reported JPEG payload length.
Definition ra8_ov5640.h:76
uint8_t href_minimum_blanking
Raw JPEG HREF blanking control.
Definition ra8_ov5640.h:81
Caller-owned sensor instance; supports multiple independent parts.
Definition ra8_ov5640.h:68
uint8_t address
Selected seven-bit SCCB address.
Definition ra8_ov5640.h:70
bool initialized
Successful binding marker.
Definition ra8_ov5640.h:71
ra8_ov5640_bus_t bus
Copied transport callbacks.
Definition ra8_ov5640.h:69