| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef CAMERADEFINED
- #define CAMERADEFINED
- #if defined(CAMERA_MODEL_WROVER_KIT)
- #define PWDN_GPIO_NUM -1
- #define RESET_GPIO_NUM -1
- #define XCLK_GPIO_NUM 21
- #define SIOD_GPIO_NUM 26
- #define SIOC_GPIO_NUM 27
- #define Y9_GPIO_NUM 35
- #define Y8_GPIO_NUM 34
- #define Y7_GPIO_NUM 39
- #define Y6_GPIO_NUM 36
- #define Y5_GPIO_NUM 19
- #define Y4_GPIO_NUM 18
- #define Y3_GPIO_NUM 5
- #define Y2_GPIO_NUM 4
- #define VSYNC_GPIO_NUM 25
- #define HREF_GPIO_NUM 23
- #define PCLK_GPIO_NUM 22
- #elif defined(CAMERA_MODEL_M5STACK_PSRAM)
- #define PWDN_GPIO_NUM -1
- #define RESET_GPIO_NUM 15
- #define XCLK_GPIO_NUM 27
- #define SIOD_GPIO_NUM 25
- #define SIOC_GPIO_NUM 23
- #define Y9_GPIO_NUM 19
- #define Y8_GPIO_NUM 36
- #define Y7_GPIO_NUM 18
- #define Y6_GPIO_NUM 39
- #define Y5_GPIO_NUM 5
- #define Y4_GPIO_NUM 34
- #define Y3_GPIO_NUM 35
- #define Y2_GPIO_NUM 32
- #define VSYNC_GPIO_NUM 22
- #define HREF_GPIO_NUM 26
- #define PCLK_GPIO_NUM 21
- #elif defined(CAMERA_MODEL_AI_THINKER)
- #define PWDN_GPIO_NUM GPIO_NUM_32
- #define RESET_GPIO_NUM -1
- #define XCLK_GPIO_NUM GPIO_NUM_0
- #define SIOD_GPIO_NUM GPIO_NUM_26
- #define SIOC_GPIO_NUM GPIO_NUM_27
- #define Y9_GPIO_NUM GPIO_NUM_35
- #define Y8_GPIO_NUM GPIO_NUM_34
- #define Y7_GPIO_NUM GPIO_NUM_39
- #define Y6_GPIO_NUM GPIO_NUM_36
- #define Y5_GPIO_NUM GPIO_NUM_21
- #define Y4_GPIO_NUM GPIO_NUM_19
- #define Y3_GPIO_NUM GPIO_NUM_18
- #define Y2_GPIO_NUM GPIO_NUM_5
- #define VSYNC_GPIO_NUM GPIO_NUM_25
- #define HREF_GPIO_NUM GPIO_NUM_23
- #define PCLK_GPIO_NUM GPIO_NUM_22
- #else
- #error "Camera model not selected"
- #endif
- static camera_config_t camera_config = {
- .pin_pwdn = PWDN_GPIO_NUM,
- .pin_reset = RESET_GPIO_NUM,
- .pin_xclk = XCLK_GPIO_NUM,
- .pin_sscb_sda = SIOD_GPIO_NUM,
- .pin_sscb_scl = SIOC_GPIO_NUM,
- .pin_d7 = Y9_GPIO_NUM,
- .pin_d6 = Y8_GPIO_NUM,
- .pin_d5 = Y7_GPIO_NUM,
- .pin_d4 = Y6_GPIO_NUM,
- .pin_d3 = Y5_GPIO_NUM,
- .pin_d2 = Y4_GPIO_NUM,
- .pin_d1 = Y3_GPIO_NUM,
- .pin_d0 = Y2_GPIO_NUM,
- .pin_vsync = VSYNC_GPIO_NUM,
- .pin_href = HREF_GPIO_NUM,
- .pin_pclk = PCLK_GPIO_NUM,
- //XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
- .xclk_freq_hz = 20000000,
- .ledc_timer = LEDC_TIMER_0,
- .ledc_channel = LEDC_CHANNEL_0,
- .pixel_format = PIXFORMAT_JPEG,//YUV422,GRAYSCALE,RGB565,JPEG
- // .pixel_format = PIXFORMAT_RGB888,//YUV422,GRAYSCALE,RGB565,JPEG
- // .frame_size = FRAMESIZE_QVGA,//QQVGA-QXGA Do not use sizes above QVGA when not JPEG
- .frame_size = FRAMESIZE_SVGA,//QQVGA-QXGA Do not use sizes above QVGA when not JPEG
- .jpeg_quality = 12, //0-63 lower number means higher quality
- .fb_count = 1 //if more than one, i2s runs in continuous mode. Use only with JPEG
- };
- #endif
|