Skip to content
This repository was archived by the owner on Jun 15, 2020. It is now read-only.

Commit b80af72

Browse files
Oitzuigrr
authored andcommitted
Making pins and frequency configureable.
1 parent cf7ad3e commit b80af72

File tree

3 files changed

+72
-18
lines changed

3 files changed

+72
-18
lines changed

components/camera/Kconfig.projbuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ config OV2640_SUPPORT
1616
default y
1717
help
1818
Enable this option if you want to use the OV2640.
19-
Disable this option off to safe memory.
19+
Disable this option to safe memory.
2020

2121
config OV7725_SUPPORT
2222
bool "OV7725 Support"
2323
default y
2424
help
2525
Enable this option if you want to use the OV7725.
26-
Disable this option off to safe memory.
26+
Disable this option to safe memory.
2727

2828
endmenu

main/Kconfig.projbuild

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,59 @@ config WIFI_PASSWORD
1111
default ""
1212
help
1313
Password for your network.
14+
15+
config XCLK_FREQ
16+
int "XCLK Frequency"
17+
default "20000000"
18+
help
19+
The XCLK Frequency in Herz.
20+
21+
menu "Pin Configuration"
22+
config D0
23+
int "D0"
24+
default "4"
25+
config D1
26+
int "D1"
27+
default "5"
28+
config D2
29+
int "D2"
30+
default "18"
31+
config D3
32+
int "D3"
33+
default "19"
34+
config D4
35+
int "D4"
36+
default "36"
37+
config D5
38+
int "D5"
39+
default "39"
40+
config D6
41+
int "D6"
42+
default "34"
43+
config D7
44+
int "D7"
45+
default "35"
46+
config XCLK
47+
int "XCLK"
48+
default "21"
49+
config PCLK
50+
int "PCLK"
51+
default "22"
52+
config VSYNC
53+
int "VSYNC"
54+
default "25"
55+
config HREF
56+
int "HREF"
57+
default "23"
58+
config SDA
59+
int "SDA"
60+
default "26"
61+
config SCL
62+
int "SCL"
63+
default "27"
64+
config RESET
65+
int "RESET"
66+
default "2"
67+
endmenu
1468

1569
endmenu

main/app_main.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -218,22 +218,22 @@ void app_main()
218218
camera_config_t config = {
219219
.ledc_channel = LEDC_CHANNEL_0,
220220
.ledc_timer = LEDC_TIMER_0,
221-
.pin_d0 = 4,
222-
.pin_d1 = 5,
223-
.pin_d2 = 18,
224-
.pin_d3 = 19,
225-
.pin_d4 = 36,
226-
.pin_d5 = 39,
227-
.pin_d6 = 34,
228-
.pin_d7 = 35,
229-
.pin_xclk = 21,
230-
.pin_pclk = 22,
231-
.pin_vsync = 25,
232-
.pin_href = 23,
233-
.pin_sscb_sda = 26,
234-
.pin_sscb_scl = 27,
235-
.pin_reset = 2,
236-
.xclk_freq_hz = 10000000,
221+
.pin_d0 = CONFIG_D0,
222+
.pin_d1 = CONFIG_D1,
223+
.pin_d2 = CONFIG_D2,
224+
.pin_d3 = CONFIG_D3,
225+
.pin_d4 = CONFIG_D4,
226+
.pin_d5 = CONFIG_D5,
227+
.pin_d6 = CONFIG_D6,
228+
.pin_d7 = CONFIG_D7,
229+
.pin_xclk = CONFIG_XCLK,
230+
.pin_pclk = CONFIG_PCLK,
231+
.pin_vsync = CONFIG_VSYNC,
232+
.pin_href = CONFIG_HREF,
233+
.pin_sscb_sda = CONFIG_SDA,
234+
.pin_sscb_scl = CONFIG_SCL,
235+
.pin_reset = CONFIG_RESET,
236+
.xclk_freq_hz = CONFIG_XCLK_FREQ,
237237
};
238238

239239
camera_model_t camera_model;

0 commit comments

Comments
 (0)