You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
2.7 KiB

4 months ago
/*
* @Copyright (C),: 2020-2030, ConvenientPower Inc.
* @File:
* @Author: your name
* @Date: 2023-03-09 09:50:29
* @LastEditTime: 2023-03-14 14:01:34
* @LastEditors: your name
* @Description: Used to specify the main functions accomplished by this program file
*/
/**
******************************************************************************
* @copyright Copyright (C), 2016-2022, ConvenientPower. Co., Ltd.
* @file drv_vd.h
* @version 1.0
* @author qing.cheng
* @date 2022-11-08
* @brief Header file of DRV_VD_H module.
******************************************************************************
*/
#ifndef _DRV_VD_H_
#define _DRV_VD_H_
#include "core_comm.h"
#include "vd_define.h"
#define VD_LS_COMP_HIGH_WITDH(x) (x)
#define VD_LS_COMP_LOW_WITDH(x) ((9<<x) & 0X1FF)
#define VD_LS_COMP_PWM(x) ((18<<x) & 0xFFF)
/*
* @brief drv_vd_ls_comp_cfg_set
* @param value
* @note
* @retval null
*/
#define drv_vd_ls_comp_cfg_set( value)\
do{\
REG_VD_LS_COMP->word = value;\
}while(0);
/*
* @brief drv_vd_ls_comp_cfg_clr
* @param clr
* @note
* @retval null
*/
#define drv_vd_ls_comp_cfg_clr( clr)\
do{\
REG_VD_LS_COMP->word &= ~(clr);\
}while(0);
/*
* @brief drv_vd_ls_comp_cfg_set
* @param value
* @note
* @retval null
*/
#define drv_vd_ls_comp_cfg_mask_set( value)\
do{\
REG_VD_LS_COMP->word |= value;\
}while(0);
/*
* @brief drv_vd_ls_comp_cfg_set
* @param value
* @note
* @retval null
*/
#define drv_vd_ls_balnk_time_set( value)\
do{\
REG_VD_LS->word = value;\
}while(0);
/*
* @brief drv_vd_dbg_get
* @param null
* @note
* @retval vd dbg value
*/
#define drv_vd_dbg_get() (REG_VD_DBG->word)
/*
* @brief drv_vd_ac_off_set
* @param null
* @note
* @retval vd dbg value
*/
#define drv_vd_ac_off_enable(en)\
do{\
REG_VD_AC_OFF->bf.dis = en;\
}while(0);
/*
* @brief drv_vd_ac_off_flag_get
* @param null
* @note
* @retval vd ac off flag
*/
#define drv_vd_ac_off_flag_get() (REG_VD_AC_OFF->bf.flag)
/*
* @brief drv_vd_rst_set
* @param value
* @note
* @retval null
*/
#define drv_vd_rst_set( value)\
do{\
REG_VD_RST->word = value;\
}while(0);
/*
* @brief drv_vd_rst_clr
* @param clr
* @note
* @retval null
*/
#define drv_vd_rst_clr( clr)\
do{\
REG_VD_RST->word &= ~(clr);\
}while(0);
/*
* @brief drv_vd_rst_set
* @param value
* @note
* @retval null
*/
#define drv_vd_rst_mask_set( value)\
do{\
REG_VD_RST->word |= value;\
}while(0);
/*
* @brief drv_vd_ls_comp_cfg_set
* @param value
* @note
* @retval null
*/
#define drv_vd_cfg_tdring_sel_set( value)\
do{\
REG_VD_CFG->word = value;\
}while(0);
#endif