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

PIO + DMA frame capture engine. 更多...

#include <stddef.h>
#include <stdint.h>
pio_capture.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  pio_capture_pins_t

函数

int pio_capture_init (const pio_capture_pins_t *pins)
 Claim a PIO state machine and DMA channel, load the capture program.
void pio_capture_deinit (void)
int pio_capture_frame (uint8_t *buf, size_t len, uint32_t timeout_ms)
 Capture exactly len bytes (one frame) into buf, blocking.
int pio_capture_frame_variable (uint8_t *buf, size_t capacity, size_t *out_len, uint32_t timeout_ms)
 Capture one variable-length frame (JPEG) into buf.

详细描述

PIO + DMA frame capture engine.

The PIO program is assembled at runtime with pio_encode_*(), so all pins come from camera_config_t - there is no .pio file and no pioasm build step (which also keeps the library Arduino-IDE friendly).

函数说明

◆ pio_capture_deinit()

void pio_capture_deinit ( void )

Release PIO state machine and DMA channel.

◆ pio_capture_frame()

int pio_capture_frame ( uint8_t * buf,
size_t len,
uint32_t timeout_ms )

Capture exactly len bytes (one frame) into buf, blocking.

Waits for the next VSYNC rising edge, then captures while HREF is high, clocked by PCLK, until len bytes are in the buffer.

参数
timeout_msabort and return PICO timeout error after this long
返回
0 on success, negative on timeout/error

◆ pio_capture_frame_variable()

int pio_capture_frame_variable ( uint8_t * buf,
size_t capacity,
size_t * out_len,
uint32_t timeout_ms )

Capture one variable-length frame (JPEG) into buf.

Uses the continuous capture program: streams from a VSYNC rising edge until VSYNC falls again (frame end), then trims the buffer at the JPEG EOI marker (0xFFD9).

参数
bufdestination buffer
capacitybuffer capacity in bytes; a frame larger than this is truncated
out_lenreceives the actual frame length in bytes
timeout_msabort and return error after this long
返回
0 on success, negative on timeout/error

◆ pio_capture_init()

int pio_capture_init ( const pio_capture_pins_t * pins)

Claim a PIO state machine and DMA channel, load the capture program.

返回
0 on success
English version