hv_mw_OsdInterrupt.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * @file hv_drv_OsdInterrupt.h
  3. * @brief Osd driver layer interrupt handle interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use Hv_Mw_OsdInterrupt_Enable(...) to register Osd ISR.
  9. * (+) Use Hv_Mw_OsdInterrupt_Disable(...) to unregister Osd ISR.
  10. * @endverbatim
  11. *
  12. * @author HiView SoC Software Team
  13. * @version 0.0.1
  14. * @date 2022-08-22
  15. */
  16. #ifndef _HV_MW_OSDINTERRUPT_H
  17. #define _HV_MW_OSDINTERRUPT_H
  18. #include "hv_comm_DataType.h"
  19. #define OSD_INT_DMA_LENGTH_ERR_BIT (BIT_0)
  20. #define OSD_INT_DMA_READ_GOING_BIT (BIT_1)
  21. #define OSD_INT_DMA_READ_DONE_BIT (BIT_2)
  22. #define OSD_INT_DMA_RESET_ERR_BIT (BIT_5)
  23. #define OSD_INT_DMA_START_ERR_BIT (BIT_6)
  24. #define OSD_INT_DMA_CNT_ERR_BIT (BIT_7)
  25. #define OSD_INT_REGEN_CLR_BIT (BIT_9)
  26. #ifdef HV_SCALER_DEBUG_VERSION
  27. extern UINT32 g_uiDMACount, g_uiRegenClrCount, g_uiIrqCount;
  28. #endif
  29. typedef enum _OsdInterruptTrigType
  30. {
  31. OSD_INT_TRIG_HIGH_LEVEL = 0,
  32. OSD_INT_TRIG_LOW_LEVEL = 1,
  33. OSD_INT_TRIG_POSITIVE_EDGE = 4,
  34. OSD_INT_TRIG_NEGATIVE_EDGE = 5,
  35. } OsdInterruptTrigType;
  36. /**
  37. * @brief Set flag to control if send sync event to osd task when reg_en interrupt come
  38. * @param[in] bSyncEnable HV_TRUE-send, HV_FALSE-not send
  39. * @return VOID without return
  40. */
  41. VOID Hv_Mw_OsdInterrupt_SetSyncFlag(BOOL bSyncEnable);
  42. /**
  43. * @brief Set frame delay count for waiting after set reg_en (count = 0, if not set)
  44. * @param[in] ucFrameDelay More frame delay count
  45. * @return VOID without return
  46. */
  47. VOID Hv_Mw_OsdInterrupt_SetSyncFrameDelay(UCHAR8 ucFrameDelay);
  48. /**
  49. * @brief Debug function, would set interrupt triggered counts to zero
  50. * @param[in] None
  51. * @return VOID without return
  52. */
  53. VOID Hv_Mw_OsdInterrupt_DebugInit(VOID);
  54. /**
  55. * @brief Debug function, would print interrupt triggered counts
  56. * @param[in] bResult Test success or not
  57. * @return VOID without return
  58. */
  59. VOID Hv_Mw_OsdInterrupt_DebugPrint(BOOL bResult);
  60. /**
  61. * @brief register Osd ISR and enable Osd Interrupt
  62. * @param[in] enTrigType interrupt trigger type OSD_INT_TRIG_HIGH_LEVEL: high-level triggered
  63. * OSD_INT_TRIG_LOW_LEVEL: low-level triggered, not supported
  64. * OSD_INT_TRIG_POSITIVE_EDGE: rising-edge triggered
  65. * OSD_INT_TRIG_NEGATIVE_EDGE: falling-edge triggered
  66. * @param[in] usEnabledBits Osd interrupt source bits
  67. * @return VOID without return
  68. */
  69. VOID Hv_Mw_OsdInterrupt_Enable(OsdInterruptTrigType enTrigType, USHORT16 usEnabledBits);
  70. /**
  71. * @brief unregister Osd ISR and disable Osd interrupt
  72. * @param[in] None
  73. * @return VOID without return
  74. */
  75. VOID Hv_Mw_OsdInterrupt_Disable(VOID);
  76. #endif