PicoCamera 0.2.0
Camera library for RP2040 with an esp32-camera compatible API
GitHub
Loading...
Searching...
No Matches
ov7670.cpp File Reference

OV7670 sensor driver. More...

#include "ov7670.h"
#include "pico/stdlib.h"
#include "../driver/sccb.h"
#include "ov7670_regs.h"
Include dependency graph for ov7670.cpp:

Functions

int ov7670_detect (sensor_t *sensor)
 Probe the bus for an OV7670. On success fills sensor->id.
int ov7670_init_sensor (sensor_t *sensor)
 Fill sensor_t function pointers and write the default register set.

Detailed Description

OV7670 sensor driver.

Register tables and control logic adapted from esp32-camera's ov7670.c (OpenMV, MIT license). The OV7670 has no JPEG encoder, so set_pixformat(PIXFORMAT_JPEG) always fails; the core also rejects it up front via camera_sensor_info_t.support_jpeg.

Timing notes:

  • The default table targets "30 fps @ 12 MHz XCLK" (CLKRC=0, PLL x4). With this library's 10 MHz XCLK the frame rate scales to ~25 fps.
  • COM10 selects VSYNC active during frame data (VSYNC_NEG) and a free-running PCLK, matching what the PIO capture engine expects.

Function Documentation

◆ ov7670_detect()

int ov7670_detect ( sensor_t * sensor)

Probe the bus for an OV7670. On success fills sensor->id.

Returns
0 if detected

◆ ov7670_init_sensor()

int ov7670_init_sensor ( sensor_t * sensor)

Fill sensor_t function pointers and write the default register set.

Returns
0 on success
中文文档