csi_camera_property.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (C) 2021 Alibaba Group Holding Limited
  3. * Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef __CSI_CAMERA_PROPERTY_H__
  10. #define __CSI_CAMERA_PROPERTY_H__
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /* Camera Property ID */
  15. #define CSI_CAMERA_PID_BASE (0x009a0000 | 0x900)
  16. #define CSI_CAMERA_FLAG_NEXT_CTRL 0x80000000
  17. /* image processing releated */
  18. #define CSI_CAMERA_PID_HFLIP (CSI_CAMERA_PID_BASE + 0x1)
  19. #define CSI_CAMERA_PID_VFLIP (CSI_CAMERA_PID_BASE + 0x2)
  20. #define CSI_CAMERA_PID_ROTATE (CSI_CAMERA_PID_BASE + 0x3)
  21. /* exposure related */
  22. #define CSI_CAMERA_PID_EXPOSURE_MODE (CSI_CAMERA_PID_BASE + 0x11)
  23. enum CSI_CAMERA_EXPOSURE_MODE {
  24. CSI_CAMERA_EXPOSURE_MODE_AUTO = 0,
  25. CSI_CAMERA_EXPOSURE_MANUAL = 1,
  26. CSI_CAMERA_EXPOSURE_SHUTTER_PRIORITY = 2,
  27. CSI_CAMERA_EXPOSURE_APERTURE_PRIORITY = 3,
  28. };
  29. #define CSI_CAMERA_PID_EXPOSURE_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x12)
  30. #define CSI_CAMERA_PID_EXPOSURE_AUTO_PRIORITY (CSI_CAMERA_PID_BASE + 0x13)
  31. #define CSI_CAMERA_PID_EXPOSURE_BIAS (CSI_CAMERA_PID_BASE + 0x14)
  32. #define CSI_CAMERA_PID_EXPOSURE_METERING (CSI_CAMERA_PID_BASE + 0x15)
  33. enum CSI_CAMERA_PID_EXPOSURE_METERING_MODE {
  34. CSI_CAMERA_EXPOSURE_METERING_AVERAGE = 0,
  35. CSI_CAMERA_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
  36. CSI_CAMERA_EXPOSURE_METERING_SPOT = 2,
  37. CSI_CAMERA_EXPOSURE_METERING_MATRIX = 3,
  38. };
  39. /* Focus related */
  40. #define CSI_CAMERA_PID_FOCUS_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x21)
  41. #define CSI_CAMERA_PID_FOCUS_RELATIVE (CSI_CAMERA_PID_BASE + 0x22)
  42. #define CSI_CAMERA_PID_FOCUS_AUTO (CSI_CAMERA_PID_BASE + 0x23)
  43. #define CSI_CAMERA_PID_AUTO_FOCUS_START (CSI_CAMERA_PID_BASE + 0x24)
  44. #define CSI_CAMERA_PID_AUTO_FOCUS_STOP (CSI_CAMERA_PID_BASE + 0x25)
  45. #define CSI_CAMERA_PID_AUTO_FOCUS_STATUS (CSI_CAMERA_PID_BASE + 0x26)
  46. #define CSI_CAMERA_AUTO_FOCUS_STATUS_IDLE (1<<0)
  47. #define CSI_CAMERA_AUTO_FOCUS_STATUS_BUSY (1<<1)
  48. #define CSI_CAMERA_AUTO_FOCUS_STATUS_REACHED (1<<2)
  49. #define CSI_CAMERA_AUTO_FOCUS_STATUS_FAILED (1<<3)
  50. /* 3A misc */
  51. #define CSI_CAMERA_PID_AUTO_PRESET_WHITE_BALANCE (CSI_CAMERA_PID_BASE + 0x31)
  52. enum CSI_CAMERA_AUTO_PRESET_WHITE_BALANCE_MODE {
  53. CSI_CAMERA_WHITE_BALANCE_MANUAL = 0,
  54. CSI_CAMERA_WHITE_BALANCE_AUTO = 1,
  55. CSI_CAMERA_WHITE_BALANCE_CUSTOM1 = 2,
  56. CSI_CAMERA_WHITE_BALANCE_CUSTOM2 = 3,
  57. };
  58. #define CSI_CAMERA_PID_3A_LOCK (CSI_CAMERA_PID_BASE + 0x32)
  59. #define CSI_CAMERA_LOCK_EXPOSURE (1 << 0)
  60. #define CSI_CAMERA_LOCK_WHITE_BALANCE (1 << 1)
  61. #define CSI_CAMERA_LOCK_FOCUS (1 << 2)
  62. /* Gain */
  63. #define CSI_CAMERA_PID_RED_GAIN (CSI_CAMERA_PID_BASE + 0x41)
  64. #define CSI_CAMERA_PID_GREEN_GAIN (CSI_CAMERA_PID_BASE + 0x42)
  65. #define CSI_CAMERA_PID_BLUE_GAIN (CSI_CAMERA_PID_BASE + 0x43)
  66. #define CSI_CAMERA_PID_WIDE_DYNAMIC_RANGE (CSI_CAMERA_PID_BASE + 0x44)
  67. #define CSI_CAMERA_PID_ZOOM_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x45)
  68. #define CSI_CAMERA_PID_ZOOM_RELATIVE (CSI_CAMERA_PID_BASE + 0x46)
  69. #define CSI_CAMERA_PID_ZOOM_CONTINOUS (CSI_CAMERA_PID_BASE + 0x47)
  70. /* PAN & TILT */
  71. #define CSI_CAMERA_PID_PAN_RELATIVE (CSI_CAMERA_PID_BASE + 0x51)
  72. #define CSI_CAMERA_PID_TILT_RELATIVE (CSI_CAMERA_PID_BASE + 0x52)
  73. #define CSI_CAMERA_PID_PAN_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x53)
  74. #define CSI_CAMERA_PID_TILT_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x54)
  75. #define CSI_CAMERA_PID_PAN_RESET (CSI_CAMERA_PID_BASE + 0x55)
  76. #define CSI_CAMERA_PID_TILT_RESET (CSI_CAMERA_PID_BASE + 0x56)
  77. /* misc enhance */
  78. #define CSI_CAMERA_PID_HDR_MODE (CSI_CAMERA_PID_BASE + 0x61)
  79. #define CSI_CAMERA_PID_BAND_STOP_FILTER (CSI_CAMERA_PID_BASE + 0x62)
  80. #define CSI_CAMERA_PID_IMAGE_STABILIZATION (CSI_CAMERA_PID_BASE + 0x63)
  81. #define CSI_CAMERA_PID_GAIN (CSI_CAMERA_PID_BASE + 0x64)
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* __CSI_CAMERA_PROPERTY_H__ */