PicoCamera 0.2.0
Camera library for RP2040 with an esp32-camera compatible API
GitHub
载入中...
搜索中...
未找到
sccb.h 文件参考

Shared SCCB (I2C) access layer. 更多...

#include <stdint.h>
sccb.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

函数

int sccb_init (int i2c_port, int pin_sda, int pin_scl, uint32_t freq_hz)
 Initialize the SCCB bus.
void sccb_deinit (void)
int sccb_write8 (uint8_t slave_addr, uint8_t reg, uint8_t value)
int sccb_read8 (uint8_t slave_addr, uint8_t reg, uint8_t *value)
int sccb_write16 (uint8_t slave_addr, uint16_t reg, uint8_t value)
int sccb_read16 (uint8_t slave_addr, uint16_t reg, uint8_t *value)
void sccb_write_list8 (uint8_t slave_addr, const uint8_t(*regs)[2])
void sccb_write_list16 (uint8_t slave_addr, const uint16_t(*regs)[2])

详细描述

Shared SCCB (I2C) access layer.

Sensors differ in register address width (OV2640: 8-bit, OV3660: 16-bit); both variants are provided here so sensor modules stay pure register logic.

函数说明

◆ sccb_deinit()

void sccb_deinit ( void )

Release the SCCB bus. A shared bus (pin_sda == -1) is left untouched.

◆ sccb_init()

int sccb_init ( int i2c_port,
int pin_sda,
int pin_scl,
uint32_t freq_hz )

Initialize the SCCB bus.

参数
i2c_portRP2040 I2C peripheral number: 0 or 1
pin_sdaSDA GPIO, or -1 to reuse an already initialized I2C bus (esp32-camera parity); the caller must have set up the bus beforehand and keeps owning it. Real pins are hard-muxed: SDA must be an even GPIO routing to the requested port, i.e. (pin / 2) % 2 == i2c_port
pin_sclSCL GPIO (ignored when pin_sda is -1)
freq_hzBus frequency (100000 is a safe default)
返回
0 on success

◆ sccb_write16()

int sccb_write16 ( uint8_t slave_addr,
uint16_t reg,
uint8_t value )

16-bit register address access (e.g. OV3660). Return 0 on success.

◆ sccb_write8()

int sccb_write8 ( uint8_t slave_addr,
uint8_t reg,
uint8_t value )

8-bit register address access (e.g. OV2640). Return 0 on success.

◆ sccb_write_list16()

void sccb_write_list16 ( uint8_t slave_addr,
const uint16_t(*) regs[2] )

Write a {reg, value} list terminated by reg == 0xFFFF (16-bit addresses). reg == 0xFFFE is a delay marker, value gives milliseconds.

◆ sccb_write_list8()

void sccb_write_list8 ( uint8_t slave_addr,
const uint8_t(*) regs[2] )

Write a {reg, value} list terminated by {0xFF, 0xFF} (8-bit addresses).

English version