|
| 1 | +| Supported Targets | ESP32-P4 | |
| 2 | +| ----------------- | -------- | |
| 3 | + |
| 4 | + |
| 5 | +# Camera display via DSI example |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +This example demonstrates how to use the esp_driver_cam component to capture camera sensor signals and display it via DSI interface. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +The subsections below give only absolutely necessary information. For full steps to configure ESP-IDF and use it to build and run projects, see [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started). |
| 14 | + |
| 15 | + |
| 16 | +### Hardware Required |
| 17 | + |
| 18 | +This example requires: |
| 19 | + |
| 20 | +- OV5647 camera sensor with VCM (Voice Coil Motor). The VCM used in this example is DW9714. |
| 21 | +- ILI9881C LCD screen |
| 22 | +- ESP32P4 devkit |
| 23 | + |
| 24 | + |
| 25 | + GND GND |
| 26 | + ┌────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────┐ |
| 27 | + │ │ │ │ |
| 28 | + │ │ │ │ |
| 29 | + │ │ │ │ |
| 30 | + │ │ │ │ |
| 31 | + │ │ │ │ |
| 32 | + │ │ │ │ |
| 33 | + │ │ │ │ |
| 34 | + │ │ │ │ |
| 35 | + │ ┌───────────────┴─────────────┴──────────────────┐ │ |
| 36 | + │ │ │ ┌──────────┴───────────┐ |
| 37 | + │ │ │ DSI DATA 1P │ │ |
| 38 | + │ │ ├───────────────────────────┤ │ |
| 39 | + ┌───────────┴─────────┐ CSI DATA 1P │ │ │ │ |
| 40 | + │ ├──────────────────────┤ │ DSI DATA 1N │ │ |
| 41 | + │ │ │ ├───────────────────────────┤ │ |
| 42 | + │ │ CSI DATA 1N │ ESP32-P4 │ │ │ |
| 43 | + │ OV5647 ├──────────────────────┤ │ DSI CLK N │ ILI9881C │ |
| 44 | + │ │ │ ├───────────────────────────┤ │ |
| 45 | + │ │ CSI CLK N │ │ │ │ |
| 46 | + │ ├──────────────────────┤ │ DSI CLK P │ │ |
| 47 | + │ │ │ ├───────────────────────────┤ │ |
| 48 | + │ │ CSI CLK P │ │ │ │ |
| 49 | + │ ├──────────────────────┤ │ DSI DATA 0P │ │ |
| 50 | + │ │ │ ├───────────────────────────┤ │ |
| 51 | + │ │ CSI DATA 0P │ │ │ │ |
| 52 | + │ ├──────────────────────┤ │ DSI DATA 0N │ │ |
| 53 | + │ │ │ ├───────────────────────────┤ │ |
| 54 | + │ │ CSI DATA 0N │ │ │ │ |
| 55 | + │ ├──────────────────────┤ │ └──────────────────────┘ |
| 56 | + │ │ │ │ |
| 57 | + └───────┬──┬──────────┘ │ │ |
| 58 | + │ │ I2C SCL │ │ |
| 59 | + │ └─────────────────────────────────┤ │ |
| 60 | + │ I2C SDA │ │ |
| 61 | + └────────────────────────────────────┤ │ |
| 62 | + └────────────────────────────────────────────────┘ |
| 63 | + |
| 64 | + |
| 65 | +### Set Chip Target |
| 66 | + |
| 67 | +First of all, your target must be supported by both: |
| 68 | + |
| 69 | +- **By your ESP-IDF version**: For the full list of supported targets, run: |
| 70 | + ``` |
| 71 | + idf.py --list-targets |
| 72 | + ``` |
| 73 | +- **By this example**: For the full list of supported targets, refer to the supported targets table at the top of this README. |
| 74 | + |
| 75 | +After you make sure that your target is supported, go to your example project directory and [set the chip target](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/tools/idf-py.html#select-the-target-chip-set-target): |
| 76 | + |
| 77 | +``` |
| 78 | +idf.py set-target <target> |
| 79 | +``` |
| 80 | + |
| 81 | +For example, to set esp32-P4 as the chip target, run: |
| 82 | + |
| 83 | +``` |
| 84 | +idf.py set-target esp32p4 |
| 85 | +``` |
| 86 | + |
| 87 | + |
| 88 | +### Configure the Project |
| 89 | + |
| 90 | +For information about Kconfig options, see [Project Configuration](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html) > _Name of relevant section(s)_. |
| 91 | + |
| 92 | +To conveniently check or modify Kconfig options for this example in a project configuration menu, run: |
| 93 | + |
| 94 | +``` |
| 95 | +idf.py menuconfig |
| 96 | +``` |
| 97 | + |
| 98 | +``` |
| 99 | +Set CONFIG_CAMERA_OV5647 to y |
| 100 | +``` |
| 101 | + |
| 102 | + |
| 103 | +### Build and Flash |
| 104 | + |
| 105 | +Execute the following command to build the project, flash it to your development board, and run the monitor tool to view the serial output: |
| 106 | + |
| 107 | +``` |
| 108 | +idf.py build flash monitor |
| 109 | +``` |
| 110 | + |
| 111 | +This command can be reduced to `idf.py flash monitor`. |
| 112 | + |
| 113 | +If the above command fails, check the log on the serial monitor which usually provides information on the possible cause of the issue. |
| 114 | + |
| 115 | +To exit the serial monitor, use `Ctrl` + `]`. |
| 116 | + |
| 117 | + |
| 118 | +## Example Output |
| 119 | + |
| 120 | +If you see the following console output, your example should be running correctly: |
| 121 | + |
| 122 | +``` |
| 123 | +I (1085) main_task: Calling app_main() |
| 124 | +I (1095) ili9881c: ID1: 0x98, ID2: 0x81, ID3: 0x5c |
| 125 | +I (1125) gpio: GPIO[31]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0 |
| 126 | +I (1125) gpio: GPIO[34]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0 |
| 127 | +I (1295) ov5647: Detected Camera sensor PID=0x5647 with index 0 |
| 128 | +I (1305) cam_dsi: fmt[0].name:MIPI_2lane_24Minput_RAW8_800x1280_50fps |
| 129 | +I (1305) cam_dsi: fmt[1].name:MIPI_2lane_24Minput_RAW8_800x640_50fps |
| 130 | +I (1315) cam_dsi: fmt[2].name:MIPI_2lane_24Minput_RAW8_800x800_50fps |
| 131 | +I (1355) cam_dsi: Format in use:MIPI_2lane_24Minput_RAW8_800x640_50fps |
| 132 | +``` |
| 133 | + |
| 134 | + |
| 135 | +## Reference |
| 136 | + |
| 137 | +- Link to the ESP-IDF feature's API reference, for example [ESP-IDF: Camera Controller Driver](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/camera_driver.html) |
| 138 | +- [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started) |
| 139 | +- [Project Configuration](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html) (Kconfig Options) |
0 commit comments