|
5 | 5 |
|
6 | 6 |
|
7 | 7 |
|
8 | | -| :1234: [CAPABILITIES](#1234-capabilities) | :floppy_disk: [SD CARD AND SPIFFS](#floppy_disk-sd-card-and-spiffs) | :musical_note: [AUDIO](#musical_note-audio) | :pager: [DISPLAY AND TOUCH](#pager-display-and-touch) | :radio_button: [BUTTONS](#radio_button-buttons) | :bulb: [LEDS](#bulb-leds) | :camera: [CAMERA](#camera-camera) | :battery: [BATTERY](#battery-battery) | |
| 8 | +| :1234: [CAPABILITIES](#1234-capabilities) | :floppy_disk: [SD CARD AND SPIFFS](#floppy_disk-sd-card-and-spiffs) | :musical_note: [AUDIO](#musical_note-audio) | :pager: [DISPLAY AND TOUCH](#pager-display-and-touch) | :radio_button: [BUTTONS](#radio_button-buttons) | :bulb: [LEDS](#bulb-leds) | :battery: [BATTERY](#battery-battery) | :camera: [CAMERA](#camera-camera) | |
9 | 9 | | :-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | |
10 | 10 |
|
11 | 11 | </div> |
@@ -1522,83 +1522,6 @@ esp_err_t bsp_led_set ( |
1522 | 1522 |
|
1523 | 1523 |
|
1524 | 1524 |
|
1525 | | -## :camera: Camera |
1526 | | -
|
1527 | | -There is no dedicated BSP API for camera functionality. Instead, the BSP provides default configuration macros: |
1528 | | -- `BSP_CAMERA_DEFAULT_CONFIG` |
1529 | | -- `BSP_CAMERA_VFLIP` |
1530 | | -- `BSP_CAMERA_HMIRROR` |
1531 | | -
|
1532 | | -These macros are designed for use with the [esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) component. |
1533 | | -
|
1534 | | -> [!NOTE] |
1535 | | -> Don't forget to initialize I2C (`bsp_i2c_init()`) before using the camera, as some camera modules require I2C for configuration. |
1536 | | -
|
1537 | | -### Example Usage |
1538 | | -
|
1539 | | -``` |
1540 | | -/* Initialize I2C bus (required by camera module) */ |
1541 | | -bsp_i2c_init(); |
1542 | | -
|
1543 | | -/* Initialize the camera using BSP default config */ |
1544 | | -const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; |
1545 | | -esp_camera_init(&camera_config); |
1546 | | -
|
1547 | | -/* Optional: Set camera orientation */ |
1548 | | -sensor_t *s = esp_camera_sensor_get(); |
1549 | | -s->set_vflip(s, BSP_CAMERA_VFLIP); // Vertical flip |
1550 | | -s->set_hmirror(s, BSP_CAMERA_HMIRROR); // Horizontal mirror |
1551 | | -
|
1552 | | -... |
1553 | | -
|
1554 | | -/* Capture a frame */ |
1555 | | -camera_fb_t * pic = esp_camera_fb_get(); |
1556 | | -if (pic) { |
1557 | | - /* Access raw image data in pic->buf with size pic->len */ |
1558 | | - process_image(pic->buf, pic->len); // Replace with your function |
1559 | | - esp_camera_fb_return(pic); |
1560 | | -} |
1561 | | -``` |
1562 | | -
|
1563 | | -### Camera API Reference |
1564 | | -
|
1565 | | -
|
1566 | | -## Functions |
1567 | | -
|
1568 | | -| Type | Name | |
1569 | | -| ---: | :--- | |
1570 | | -| esp\_err\_t | [**bsp\_camera\_start**](#function-bsp_camera_start) (void) <br>_Initialize camera._ | |
1571 | | -
|
1572 | | -## Macros |
1573 | | -
|
1574 | | -| Type | Name | |
1575 | | -| ---: | :--- | |
1576 | | -| define | [**BSP\_CAMERA\_EN**](#define-bsp_camera_en) (GPIO\_NUM\_12)<br> | |
1577 | | -| define | [**BSP\_CAMERA\_GPIO\_XCLK**](#define-bsp_camera_gpio_xclk) (GPIO\_NUM\_11)<br> | |
1578 | | -| define | [**BSP\_CAMERA\_RST**](#define-bsp_camera_rst) (GPIO\_NUM\_26)<br> | |
1579 | | -| define | [**BSP\_CAMERA\_XCLK\_CLOCK\_MHZ**](#define-bsp_camera_xclk_clock_mhz) 24<br> | |
1580 | | -
|
1581 | | -
|
1582 | | -
|
1583 | | -## Functions Documentation |
1584 | | -
|
1585 | | -### function `bsp_camera_start` |
1586 | | -
|
1587 | | -_Initialize camera._ |
1588 | | -```c |
1589 | | -esp_err_t bsp_camera_start ( |
1590 | | - void |
1591 | | -) |
1592 | | -``` |
1593 | | -
|
1594 | | -
|
1595 | | -Camera sensor initialization. |
1596 | | -
|
1597 | | -
|
1598 | | -
|
1599 | | -
|
1600 | | -
|
1601 | | -
|
1602 | 1525 | ## :battery: Battery |
1603 | 1526 |
|
1604 | 1527 | Some boards with battery support can measure the battery voltage using an ADC channel. BSP provides a simple API for this: |
@@ -1698,6 +1621,73 @@ false Calibration failed |
1698 | 1621 |
|
1699 | 1622 |
|
1700 | 1623 |
|
| 1624 | +## :camera: Camera |
| 1625 | +
|
| 1626 | +The BSP provides a helper function bsp_camera_start() for initializing the on-board camera module. |
| 1627 | +This function sets up the required I2C bus, video subsystem, and camera clock if necessary. |
| 1628 | +
|
| 1629 | +### Example Usage |
| 1630 | +
|
| 1631 | +Camera usage can be quite complex. For a complete example, refer to the [`display_camera_csi`](https://github.com/espressif/esp-bsp/tree/master/examples/display_camera_csi) example in the BSP repository, or to the examples provided in the [`esp_video`](https://github.com/espressif/esp-video-components/tree/master/esp_video) component. |
| 1632 | +
|
| 1633 | +> [!NOTE] |
| 1634 | +> Please, do not forget select right camera sensor in `menuconfig` |
| 1635 | +
|
| 1636 | +### Camera API Reference |
| 1637 | +
|
| 1638 | +## Structures and Types |
| 1639 | +
|
| 1640 | +| Type | Name | |
| 1641 | +| ---: | :--- | |
| 1642 | +| struct | [**bsp\_camera\_cfg\_t**](#struct-bsp_camera_cfg_t) <br>_BSP camera configuration structure (for future use)_ | |
| 1643 | +
|
| 1644 | +## Functions |
| 1645 | +
|
| 1646 | +| Type | Name | |
| 1647 | +| ---: | :--- | |
| 1648 | +| esp\_err\_t | [**bsp\_camera\_start**](#function-bsp_camera_start) (const [**bsp\_camera\_cfg\_t**](#struct-bsp_camera_cfg_t) \*cfg) <br>_Initialize camera._ | |
| 1649 | +
|
| 1650 | +## Macros |
| 1651 | +
|
| 1652 | +| Type | Name | |
| 1653 | +| ---: | :--- | |
| 1654 | +| define | [**BSP\_CAMERA\_DEVICE**](#define-bsp_camera_device) (ESP\_VIDEO\_MIPI\_CSI\_DEVICE\_NAME)<br> | |
| 1655 | +| define | [**BSP\_CAMERA\_EN**](#define-bsp_camera_en) (GPIO\_NUM\_12)<br> | |
| 1656 | +| define | [**BSP\_CAMERA\_GPIO\_XCLK**](#define-bsp_camera_gpio_xclk) (GPIO\_NUM\_11)<br> | |
| 1657 | +| define | [**BSP\_CAMERA\_RST**](#define-bsp_camera_rst) (GPIO\_NUM\_26)<br> | |
| 1658 | +| define | [**BSP\_CAMERA\_XCLK\_CLOCK\_MHZ**](#define-bsp_camera_xclk_clock_mhz) (24)<br> | |
| 1659 | +
|
| 1660 | +
|
| 1661 | +## Structures and Types Documentation |
| 1662 | +
|
| 1663 | +### struct `bsp_camera_cfg_t` |
| 1664 | +
|
| 1665 | +_BSP camera configuration structure (for future use)_ |
| 1666 | +
|
| 1667 | +Variables: |
| 1668 | +
|
| 1669 | +- uint8\_t dummy |
| 1670 | +
|
| 1671 | +
|
| 1672 | +## Functions Documentation |
| 1673 | +
|
| 1674 | +### function `bsp_camera_start` |
| 1675 | +
|
| 1676 | +_Initialize camera._ |
| 1677 | +```c |
| 1678 | +esp_err_t bsp_camera_start ( |
| 1679 | + const bsp_camera_cfg_t *cfg |
| 1680 | +) |
| 1681 | +``` |
| 1682 | +
|
| 1683 | +
|
| 1684 | +Camera sensor initialization. |
| 1685 | +
|
| 1686 | +
|
| 1687 | +
|
| 1688 | +
|
| 1689 | +
|
| 1690 | +
|
1701 | 1691 |
|
1702 | 1692 |
|
1703 | 1693 | ### Others API Reference |
|
0 commit comments