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

GC0308 sensor driver. More...

#include "gc0308.h"
#include "pico/stdlib.h"
#include "../driver/sccb.h"
#include "gc0308_regs.h"
#include "gc0308_settings.h"
Include dependency graph for gc0308.cpp:

Macros

#define H8(v)
#define L8(v)

Functions

int gc0308_detect (sensor_t *sensor)
 Probe the bus for a GC0308. On success fills sensor->id.
int gc0308_init_sensor (sensor_t *sensor)
 Fill sensor_t function pointers and write the default register set.

Detailed Description

GC0308 sensor driver.

Register tables and control logic adapted from esp32-camera's gc0308.c (Apache-2.0). The GC0308 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.

Framesize scaling uses the subsample strategy (esp32-camera's Kconfig default, CONFIG_GC_SENSOR_SUBSAMPLE_MODE): keep the widest field of view and pick the coarsest subsample ratio that still covers the requested window.

Macro Definition Documentation

◆ H8

#define H8 ( v)
Value:
((v)>>8)

◆ L8

#define L8 ( v)
Value:
((v)&0xff)

Function Documentation

◆ gc0308_detect()

int gc0308_detect ( sensor_t * sensor)

Probe the bus for a GC0308. On success fills sensor->id.

Returns
0 if detected

◆ gc0308_init_sensor()

int gc0308_init_sensor ( sensor_t * sensor)

Fill sensor_t function pointers and write the default register set.

Returns
0 on success
中文文档