drv_dcmi.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-03-24 spaceman the first version
  9. */
  10. #ifndef __DRV_DCMI_H__
  11. #define __DRV_DCMI_H__
  12. #include <rtthread.h>
  13. #include "board.h"
  14. #ifdef BSP_USING_DCMI
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define DCMI_DEVICE(dev) (struct stm32_dcmi *)(dev)
  19. #define DCMI_CTRL_CROP (0x01)
  20. #define DCMI_CTRL_TRANSMIT_CONTINUOUS (0x02)
  21. #define DCMI_CTRL_TRANSMIT_SNAPSHOT (0x03)
  22. #define DCMI_CTRL_SUSPEND (0x04)
  23. #define DCMI_CTRL_RESUME (0x05)
  24. #define DCMI_CTRL_STOP (0x06)
  25. #define DCMI_CTRL_GET_FPS (0x07)
  26. struct stm32_dcmi {
  27. struct rt_device parent;
  28. DCMI_HandleTypeDef dcmi_handle;
  29. DMA_HandleTypeDef dma_handle;
  30. struct rt_semaphore cam_semaphore;
  31. };
  32. struct stm32_dcmi_cropsize {
  33. uint16_t displey_xsize;
  34. uint16_t displey_ysize;
  35. uint16_t sensor_xsize;
  36. uint16_t sensor_ysize;
  37. };
  38. struct stm32_dcmi_dma_transmitbuffer {
  39. uint32_t dma_buffer;
  40. uint32_t dma_buffersize;
  41. };
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif /* BSP_USING_DCMI */
  46. #endif /* __DRV_DCMI_H__ */