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

GC2145 sensor driver. More...

#include "gc2145.h"
#include "pico/stdlib.h"
#include "../driver/sccb.h"
#include "gc2145_regs.h"
#include "gc2145_settings.h"
Include dependency graph for gc2145.cpp:

Macros

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

Functions

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

Detailed Description

GC2145 sensor driver.

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

◆ gc2145_detect()

int gc2145_detect ( sensor_t * sensor)

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

Returns
0 if detected

◆ gc2145_init_sensor()

int gc2145_init_sensor ( sensor_t * sensor)

Fill sensor_t function pointers and write the default register set.

Returns
0 on success
中文文档