/**
 * @file hv_cal_mprt.h
 * @brief Header file of cal mprt spi module.
 * 
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * 
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2023-02-03
 */

#ifndef _HV_CAL_MPRT_SPI_H_
#define _HV_CAL_MPRT_SPI_H_
#include "hv_comm_DataType.h"


VOID Hv_Cal_MPRT_Init(VOID);

/**
 * @brief Mprt port enable
 * @param[in] ucPort which port enable.
 */
VOID Hv_Cal_MPRT_PwmEnable(UCHAR8 ucPort, BOOL bEn);

/**
 * @brief get Mprt port status
 * @param[in] ucPort which port.
 */
BOOL Hv_Cal_MPRT_GetPwmEnable(UCHAR8 ucPort);

/**
 * @brief Mprt mode
 * @param[in] usPwmPort which port PWM.
 * @param[in] usMode mprt work mode.
 */
VOID Hv_Cal_MPRT_PwmSetMode(USHORT16 usPwmPort, USHORT16 usMode);

/**
 * @brief Mprt start
 * @param[in] usPwmPort which port PWM.
 * @param[in] usVale start value.
 */
VOID Hv_Cal_MPRT_PwmSetStart(USHORT16 usPwmPort, USHORT16 usStart);

/**
 * @brief Mprt value
 * @param[in] usPwmPort which port PWM.
 * @param[in] usVale value num.
 */
VOID Hv_Cal_MPRT_PwmSetValue(USHORT16 usPwmPort, USHORT16 usVale);

/**
 * @brief Mprt mult
 * @param[in] usPwmPort which port PWM.
 * @param[in] usMult mult value.
 */
VOID Hv_Cal_MPRT_PwmSetMult(USHORT16 usPwmPort, USHORT16 usMult);

/**
 * @brief Mprt pol
 * @param[in] usPwmPort which port PWM.
 * @param[in] ucPol 0:normal, 1: revsers.
 */
VOID Hv_Cal_MPRT_PwmSetPol(USHORT16 usPwmPort, UCHAR8 ucPol);

/**
 * @brief Mprt mux
 * @param[in] usPwmPort which port PWM.
 * @param[in] ucMux usPwmPort merge which pwm output.
 */
VOID Hv_Cal_MPRT_PwmSetMux(USHORT16 usPwmPort, UCHAR8 ucMux);

/**
 * @brief Set hSync and vSync source.
 * @param[in] usPwbSource 0-3 form ptg, 4 form KTX.
 */
VOID Hv_Cal_MPRT_SetMprtSource(UCHAR8 ucSource);

/**
 * @brief Set mprt pwm low when vSync come.
 * @param[in] bPort which pwm port.
 */
VOID Hv_Cal_MPRT_SetMprtVsClear(UCHAR8 ucPort);

/**
 * @brief Set mprt sta value for vrr.
 * @param[in] bPort which pwm port.
 */
VOID Hv_Cal_MPRT_SetMprtStaVrrEn(UCHAR8 ucPort);

/**
 * @brief Set sync for ldc.
 * @param[in] bPort which pwm port.
 */
VOID Hv_Cal_MPRT_SetLdcVsync(UCHAR8 ucPort);

#if 0
VOID Hv_Cal_MPRT_PwmSetPtgSel();

VOID Hv_Cal_MPRT_FrameRateDectIntInit();

VOID Hv_Cal_MPRT_ClearFrameRateDectInt();

VOID Hv_Cal_MPRT_FrameRateDectIntEn(BOOL bEn);

USHORT16 Hv_Cal_MPRT_GetRXVToal();

USHORT16 Hv_Cal_MPRT_GetMprtPwmVal(USHORT16 usPwmPort);

VOID Hv_Cal_MPRT_SetPTGReg();

VOID Hv_Cal_MPRT_SetMprtPinShare();

VOID Hv_Cal_MPRT_SPI_CleanMprtVsInt(VOID);

VOID Hv_Cal_MPRT_SPI_SetMprtVsIntMode(UINT32 uiIntMode);

VOID Hv_Cal_MPRT_SPI_EnableMprtVsInt(BOOL bEn);
#endif

#endif
