Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions camera_framework/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
menu "ov2640 camera"

config SENSOR_USING_OV2640
bool "Enable OV2640 Camera Module"
default y
help
Enable this option to use OV2640 as the camera sensor module.

menu "DVP configuration"
depends on SENSOR_USING_OV2640

config OV2640_DVP_PINGPONG_POOL_SIZE
int "DVP PingPong Buffer Pool Size (compile-time ceiling)"
default 10240
range 1024 65536
help
Size of the statically allocated ping-pong buffer pool.
This is the hard upper limit for dvp_set_pingpong_size() at runtime;
you can never exceed this value without recompiling.
For SF32LB56X with OV2640_DVP_PINGPONG_USE_SECTION enabled, this
value must match DVP_PINGPONG_SIZE in custom_mem_map.h
(default: 640*8*2 = 10240). For SF32LB52X (normal BSS) set it
to the largest size you will ever need at runtime.

config OV2640_DVP_PINGPONG_BUFFER_SIZE
int "DVP PingPong Buffer Initial Size"
default 8192
range 1024 65536
help
Initial active ping-pong buffer size passed to the DMA on dvp_init().
Must not exceed OV2640_DVP_PINGPONG_POOL_SIZE.
Can be changed freely at runtime via dvp_set_pingpong_size() without
recompiling, as long as the new value stays within POOL_SIZE.

config OV2640_DVP_PINGPONG_USE_SECTION
bool "Place DVP ping-pong buffer in a dedicated linker section (.dvp_pingpong)"
default n
help
When enabled, dvp_pingpong_buffer is placed in the ".dvp_pingpong" section.
The board link script must define a matching memory region (e.g. DVP_SRAM)
that maps this section to the correct SRAM address.
Enable for SF32LB56X boards that carve out dedicated SRAM for DVP.
Leave disabled for SF32LB52X (buffer lands in normal .bss).

config OV2640_DVP_DATA_PIN_BASE
int "DVP Data Pin Base Numbers"
default 0
help
DO NOT MODIFY! Only for internal use to specify the base pin number for DVP data pins (D0-D7) of the OV2640 camera module.
config OV2640_DVP_PCLK_PIN
int "DVP PCLK Pin Number (PAx index)"
default 41
help
PAx pin index for the DVP pixel clock (PCLK) input.
The driver muxes this pin to GPTIM1_ETR automatically.
SF32LB52X default: 41 (PA41). SF32LB56X default: 77 (PA77).

config OV2640_DVP_HSYNC_PIN
int "DVP HSYNC Pin Number (PAx index)"
default 43
help
PAx pin index for the DVP horizontal sync (HSYNC/HREF) input.
The driver muxes this pin to GPTIM1_CH1 automatically.
SF32LB52X default: 43 (PA43). SF32LB56X default: 78 (PA78).

config OV2640_DVP_VSYNC_PIN
int "DVP VSYNC Pin Number (PAx index)"
default 42
help
Specify the PAx pin index connected to the DVP VSYNC signal of the OV2640 camera module.
This pin is used for GPIO interrupt.
SF32LB52X default: 42 (PA42). SF32LB56X: adjust to your board layout.

endmenu

menu "SCCB configuration"
depends on SENSOR_USING_OV2640

config OV2640_SCCB_I2C_BUS_NAME
string "SCCB I2C Bus Name"
default "i2c1"
help
Specify the I2C bus name used for SCCB communication with the OV2640 camera module.

config OV2640_SCCB_TIMEOUT_MS
int "SCCB Timeout (ms)"
default 1000
help
Specify the timeout value in milliseconds for SCCB I2C communication.

config OV2640_SCCB_MAX_HZ
int "SCCB I2C Max Frequency (Hz)"
default 100000
range 10000 400000
help
Specify the maximum I2C bus frequency in Hz for SCCB communication.
Default is 100kHz (100000 Hz).

endmenu

menu "Camera configuration"
depends on SENSOR_USING_OV2640

config OV2640_CAMERA_READ_TIMEOUT_MS
int "Camera Read Timeout (ms)"
default 1000
range 100 10000
help
Specify the timeout value in milliseconds for camera read operations.
Default is 10000ms (10 second).

config OV2640_DVP_XCLK_PIN
int "XCLK Output Pin Number"
default -1
help
Specify the pin number for XCLK (external clock) output.
Set to -1 to disable XCLK output (use external clock source).
NOTE: User must configure this pin as GPTIM2_CH1 in main.c before opening the camera device.
Example: HAL_PIN_Set(PAD_PA00 + 44, GPTIM2_CH1, PIN_NOPULL, 1);

choice
prompt "XCLK Output Frequency"
default OV2640_DVP_XCLK_FREQ_12M
depends on OV2640_DVP_XCLK_PIN != -1
help
Select the XCLK output frequency for the OV2640 camera module.
GPTIM2 runs at 24MHz, so only 6MHz and 12MHz can be generated.

config OV2640_DVP_XCLK_FREQ_6M
bool "6 MHz"
help
Generate 6MHz XCLK (24MHz / 4).

config OV2640_DVP_XCLK_FREQ_12M
bool "12 MHz"
help
Generate 12MHz XCLK (24MHz / 2).
endchoice

config OV2640_DVP_XCLK_FREQ
int
default 6000000 if OV2640_DVP_XCLK_FREQ_6M
default 12000000 if OV2640_DVP_XCLK_FREQ_12M
default 0

endmenu

endmenu
Loading