cam_hal.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "esp_camera.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @brief Uninitialize the lcd_cam module
  21. *
  22. * @param handle Provide handle pointer to release resources
  23. *
  24. * @return
  25. * - ESP_OK Success
  26. * - ESP_FAIL Uninitialize fail
  27. */
  28. esp_err_t cam_deinit(void);
  29. /**
  30. * @brief Initialize the lcd_cam module
  31. *
  32. * @param config Configurations - see lcd_cam_config_t struct
  33. *
  34. * @return
  35. * - ESP_OK Success
  36. * - ESP_ERR_INVALID_ARG Parameter error
  37. * - ESP_ERR_NO_MEM No memory to initialize lcd_cam
  38. * - ESP_FAIL Initialize fail
  39. */
  40. esp_err_t cam_init(const camera_config_t *config);
  41. esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint16_t sensor_pid);
  42. void cam_stop(void);
  43. void cam_start(void);
  44. camera_fb_t *cam_take(TickType_t timeout);
  45. void cam_give(camera_fb_t *dma_buffer);
  46. #ifdef __cplusplus
  47. }
  48. #endif