/**
 * @file hv_cal_OsdTiming.h
 * @brief Osd Cal layer Timing interface.
 * @verbatim
 * ==============================================================================
 *                        ##### How to use this driver #####
 * ==============================================================================
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-08-22
 */

#ifndef _HV_CAL_OSDTIMING_H
#define _HV_CAL_OSDTIMING_H

#include "hv_comm_DataType.h"

/**
 * @brief get panel htotal
 * @param[in] VOID
 * @return current htotal value
 */
USHORT16 Hv_Cal_OsdTmg_GetPanelHtotal(VOID);

/**
 * @brief set panel htotal
 * @param[in] usHtotal htotal value
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetPanelHtotal(USHORT16 usHtotal);

VOID Hv_Cal_OsdTmg_SetHtotalRatio(UCHAR8 ucRatio);

/**
 * @brief get osd current htotal
 * @param[in] VOID
 * @return current htotal value
 */
USHORT16 Hv_Cal_OsdTmg_GetCurrentHtotal(VOID);

/**
 * @brief set osd current htotal
 * @param[in] usHtotal htotal value
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetCurrentHtotal(USHORT16 usHtotal);
/**
 * @brief set osd write clock enable/disable status
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetOsdWClockGateEnable(BOOL bEnable);

/**
 * @brief set osd read clock enable/disable status
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetOsdRClockGateEnable(BOOL bEnable);

BOOL Hv_Cal_OsdTmg_GetClockEnable(VOID);

/**
 * @brief set osd clock enable/disable status
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetClockEnable(BOOL bEnable);

/**
 * @brief set osd clock dividend
 * @param[in] ucDivNum clock dividend
 *                         0: disable
 *                         1: 2
 *                         2: 4
 *                         3: 8
 *                         4: 16
 *                         5: 32
 *                         6: 32
 *                         7: 32
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetClockDiv(UCHAR8 ucDivNum);

/**
 * @brief set timing configuration
 * @param[in] usHact hactive value
 * @param[in] usVact vactive value
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetTmgSize(USHORT16 usHact, USHORT16 usVact);

/**
 * @brief get timing configuration
 * @param[out] pusWidth timing width
 * @param[out] pusHeight timing height
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_GetTmgSize(USHORT16 *pusWidth, USHORT16 *pusHeight);

/**
 * @brief get Vthr parameter
 * @param[out] pusHtot htotal value
 * @param[out] pusVthr Vthr value
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_GetVthr(USHORT16 *pusHtot, USHORT16 *pusVthr);

/**
 * @brief set Vthr parameter
 * @param[in] usHtot htotal value
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_SetVthr(USHORT16 usHtot);

/**
 * @brief Timing initialization function
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Cal_OsdTmg_Init(VOID);

#endif
