/**
 * @file hv_drv_Mprt.h
 * @brief Header file of mprt module.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 *
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.0
 * @date 2022-02-01
 */

#ifndef _HV_DRV_MPRT_SPI_H_
#define _HV_DRV_MPRT_SPI_H_

#include "hv_comm_DataType.h"
#include "hv_comm_Log.h"
#include "hv_vos_Irq.h"
#include "hv_drv_Spi.h"
#include "hv_comm_Define.h"

//#define SPI_TIMEOUT  0x1000

/**
 * @brief enable outport high frequence pwm.
 * @param[in] bEn 1:enable, 0:disable.
 */
VOID Hv_Drv_MPRT_SetOutHighFreqPwmEnable(BOOL bEn);

/**
 * @brief get outport high frequence pwm status.
 */
BOOL Hv_Drv_MPRT_GetOutHighFreqPwmEnable(VOID);

/**
 * @brief outport high frequence pwm, need get usHighFreqTotal and usHighFreqMult form table.
 * @param[in] ucPort which port for pwm.
 */
VOID Hv_Drv_MPRT_SetOutHighFreqPwm(UCHAR8 ucPort);

/**
 * @brief set high frequence pwm duty.
 * @param[in] ucPort which port for pwm.
 */
VOID Hv_Drv_MPRT_SetOutHighFreqPwmDuty(UCHAR8 ucPort, USHORT16 usSta, USHORT16 usVal);

/**
 * @brief enable outport mprt pwm.
 * @param[in] enMprtType mprt type.
 */
VOID Hv_Drv_MPRT_SetOutMprtPwmEnable(MprtType enMprtType);

/**
 * @brief enable outport mprt pwm.
 * @param[in] bEn 1:enable, 0:disable.
 * @param[in] usSta mprt brightess.
 */
VOID Hv_Drv_MPRT_SetOutMprtPwm(UCHAR8 ucPort);

/**
 * @brief MPRT Init.
 */
VOID Hv_Drv_MPRT_Init(VOID);
/**
 * @brief set high frequence pwm duty.
 * @param[in] ucPort which port for pwm.
 * @param[in] bEn status of enable.
 */
VOID Hv_Drv_MPRT_PwmEnable(UCHAR8 ucPort, BOOL bEn);
VOID Hv_Drv_MPRT_PwmMode(USHORT16 usPwmPort, USHORT16 usMode);

#endif
