IMX334_priv.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /******************************************************************************\
  2. |* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *|
  3. |* All Rights Reserved. *|
  4. |* *|
  5. |* The material in this file is confidential and contains trade secrets of *|
  6. |* of VeriSilicon. This is proprietary information owned or licensed by *|
  7. |* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *|
  8. |* transmitted, or used in any way for any purpose, without the express *|
  9. |* written permission of VeriSilicon. *|
  10. |* *|
  11. \******************************************************************************/
  12. /**
  13. * @file IMX334_priv.h
  14. *
  15. * @brief Interface description for image sensor specific implementation (iss).
  16. *
  17. *****************************************************************************/
  18. /**
  19. * @page module_name_page Module Name
  20. * Describe here what this module does.
  21. *
  22. * For a detailed list of functions and implementation detail refer to:
  23. * - @ref module_name
  24. *
  25. * @defgroup IMX334_priv
  26. * @{
  27. *
  28. */
  29. #ifndef __IMX334_PRIV_H__
  30. #define __IMX334_PRIV_H__
  31. #include <ebase/types.h>
  32. #include <common/return_codes.h>
  33. #include <hal/hal_api.h>
  34. #include <isi/isi_common.h>
  35. #include "vvsensor.h"
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. typedef struct IMX334_Context_s
  41. {
  42. IsiSensorContext_t IsiCtx; /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
  43. struct vvcam_mode_info SensorMode;
  44. uint32_t KernelDriverFlag;
  45. char SensorRegCfgFile[128];
  46. uint32_t HdrMode;
  47. IsiResolution_t Resolution;
  48. uint32_t MaxFps;
  49. uint32_t MinFps;
  50. uint32_t CurrFps;
  51. //// modify below here ////
  52. IsiSensorConfig_t Config; /**< sensor configuration */
  53. bool_t Configured; /**< flags that config was applied to sensor */
  54. bool_t Streaming; /**< flags that csensor is streaming data */
  55. bool_t TestPattern; /**< flags that sensor is streaming test-pattern */
  56. bool_t isAfpsRun; /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
  57. float one_line_exp_time;
  58. uint16_t MaxIntegrationLine;
  59. uint16_t MinIntegrationLine;
  60. uint32_t gain_accuracy;
  61. uint16_t FrameLengthLines; /**< frame line length */
  62. uint16_t CurFrameLengthLines;
  63. float AecMinGain;
  64. float AecMaxGain;
  65. float AecMinIntegrationTime;
  66. float AecMaxIntegrationTime;
  67. float AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
  68. float AecGainIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
  69. float AecCurGain;
  70. float AecCurIntegrationTime;
  71. float AecCurGainSEF1;
  72. float AecCurIntegrationTimeSEF1;
  73. bool GroupHold;
  74. uint32_t OldGain;
  75. uint32_t OldIntegrationTime;
  76. uint32_t OldGainSEF1;
  77. uint32_t OldIntegrationTimeSEF1;
  78. int subdev;
  79. bool enableHdr;
  80. uint8_t pattern;
  81. float CurHdrRatio;
  82. } IMX334_Context_t;
  83. static RESULT IMX334_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
  84. pConfig);
  85. static RESULT IMX334_IsiInitSensorIss(IsiSensorHandle_t handle);
  86. static RESULT IMX334_IsiReleaseSensorIss(IsiSensorHandle_t handle);
  87. static RESULT IMX334_IsiGetCapsIss(IsiSensorHandle_t handle,
  88. IsiSensorCaps_t * pIsiSensorCaps);
  89. static RESULT IMX334_IsiSetupSensorIss(IsiSensorHandle_t handle,
  90. const IsiSensorConfig_t *
  91. pConfig);
  92. static RESULT IMX334_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
  93. bool_t on);
  94. static RESULT IMX334_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
  95. bool_t on);
  96. static RESULT IMX334_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
  97. uint32_t * p_value);
  98. static RESULT IMX334_IsiSetBayerPattern(IsiSensorHandle_t handle,
  99. uint8_t pattern);
  100. static RESULT IMX334_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
  101. float *pMinGain,
  102. float *pMaxGain);
  103. static RESULT IMX334_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
  104. handle,
  105. float
  106. *pMinIntegrationTime,
  107. float
  108. *pMaxIntegrationTime);
  109. static RESULT IMX334_IsiExposureControlIss(IsiSensorHandle_t handle,
  110. float NewGain,
  111. float NewIntegrationTime,
  112. uint8_t *
  113. pNumberOfFramesToSkip,
  114. float *pSetGain,
  115. float *pSetIntegrationTime,
  116. float *hdr_ratio);
  117. static RESULT IMX334_IsiGetGainIss(IsiSensorHandle_t handle,
  118. float *pSetGain);
  119. static RESULT IMX334_IsiGetSEF1GainIss(IsiSensorHandle_t handle,
  120. float *pSetGain);
  121. static RESULT IMX334_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
  122. float *pIncr);
  123. static RESULT IMX334_IsiSetGainIss(IsiSensorHandle_t handle,
  124. float NewGain, float *pSetGain,
  125. float *hdr_ratio);
  126. static RESULT IMX334_IsiSetSEF1GainIss(IsiSensorHandle_t handle,
  127. float NewIntegrationTime,
  128. float NewGain, float *pSetGain,
  129. float *hdr_ratio);
  130. static RESULT IMX334_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
  131. float
  132. *pSetIntegrationTime);
  133. static RESULT IMX334_IsiGetSEF1IntegrationTimeIss(IsiSensorHandle_t
  134. handle,
  135. float
  136. *pSetIntegrationTime);
  137. static RESULT IMX334_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
  138. float *pIncr);
  139. static RESULT IMX334_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
  140. float NewIntegrationTime,
  141. float
  142. *pSetIntegrationTime,
  143. uint8_t *
  144. pNumberOfFramesToSkip,
  145. float *hdr_ratio);
  146. static RESULT IMX334_IsiSetSEF1IntegrationTimeIss(IsiSensorHandle_t
  147. handle,
  148. float
  149. NewIntegrationTime,
  150. float
  151. *pSetIntegrationTime,
  152. uint8_t *
  153. pNumberOfFramesToSkip,
  154. float *hdr_ratio);
  155. static RESULT IMX334_IsiGetResolutionIss
  156. (IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
  157. static RESULT IMX334_IsiResetSensorIss(IsiSensorHandle_t handle);
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161. /* @} IMX334priv */
  162. #endif /* __IMX334PRIV_H__ */