/* * @Copyright (C),: 2020-2030, ConvenientPower Inc. * @File: * @Author: your name * @Date: 2023-01-05 10:16:59 * @LastEditTime: 2023-01-05 18:19:22 * @LastEditors: your name * @Description: Used to specify the main functions accomplished by this program file */ /** ****************************************************************************** * @copyright Copyright (C), 2016-2022, ConvenientPower. Co., Ltd. * @file config.h * @version 1.0 * @author qing.cheng * @date 2023-01-04 * @brief Header file of CONFIG_H module. ****************************************************************************** */ #ifndef _CONFIG_H_ #define _CONFIG_H_ #include "core_comm.h" #include "drv_comm.h" #include "comp_config.h" #define TYPEC_PORT0 0 #define TYPEC_PORT1 1 #define TYPEC_PORT_MAX 2 /**********************POWER MODE CHOICE START***************************/ /*一个ACDC进来,两个DCDC通过FB控制两路buck的应用*/ // #define ACDC_2DCDC_2FB /*一个ACDC进来,一路控制OPTO调压一个通过DCDC_FB调压*/ //#define ACDC_1ACDC_1DCDC_FB /*一个ACDC进来,一路控制OPTO调压*/ #define ACDC_1ACDC /**********************POWER MODE CHOICE END***************************/ #define TYPEC_PORT0_SUPPORT 1 #define TYPEC_PORT1_SUPPORT 1 #ifdef ACDC_2DCDC_2FB #define TYPEC_PORT1_SUPPORT 1 #endif /******************log debug***************************/ #define UART_DEUG 1 #if UART_DEUG #define log_info comp_uart2_sync_print #else #define log_info(...) #endif /***************SYSTEM ENABLE CLOCK*******************/ #define SYSTEM_MODULE_CLOCK (PERI_UART2_EN | PERI_PD0H_EN | PERI_PD0L_EN | PERI_PD1H_EN | PERI_PD1L_EN | \ PERI_PWD0_EN | PERI_PWD1_EN | PERI_PWD2_EN | PERI_PWD3_EN |PERI_WDOG_EN |\ PERI_DAC_CTR_EN | PERI_VIN_DIS_EN | PERI_ADC_EN) #define I2C_DC_SUPPORT 0 /****************project inforamtion MTP ADDR:0x100000C0*******************/ #define SOFT_WARE_VERISION_H 0x00 #define SOFT_WARE_VERISION_L 0x03 #define CUSTOM_ID 0xA1 #define PROJECT_ID 0x60 /**********************���칦�ܺ궨��************************************/ /*The voltage is adjusted to a percentage of ps rdy*/ #define PERCENT_OF_VOL_REGULA 5 /*5--±5%*/ /*Do not look at the voltage adjustment completed current difference */ #define PS_RDY_CHECK_CURRENT 250 /*Cable impedance SNS R*/ #define CABLE_IMPEDANCE_R 102 /*102 ≈100 = (cur*102)>>10*/ /*Cable large compensation voltage*/ #define CABLE_COMP_MAX_VOL 300 /*fix power cc offset*/ #define FIX_CC_OFFEST 400 /*sample resistor*/ #define SINS_R 50 /** 1:100, 0:50***/ #define FB_CV_GAIN_CHOICE 1 #define QC30_MAX_VOL 12000 /***********protocol support***********************/ #define TYPEC_SUPPORT 1 #define TYEP_INSERT_DEBOUNCE_SUPPORT 1 #define PD_SUPPORT 1 #if PD_SUPPORT #define PD_EMARK_SUPPORT 1 #define PD_DERAT_SUPPORT 0 #ifdef ACDC_2DCDC_2FB #define PD_DOUBLE_PORT_DERAT_SUPPORT 0 #endif #ifdef ACDC_1ACDC #define PD_EPR_SUPPORT 0 #define PD_EPR_CHUNK_SUPPORT 0 #endif #endif/**PD_SUPPORT**/ #define DCP_SUPPORT 1 #define HVDCP_SUPPORT 1 #define QC_SCP_SUPPORT 1 #if QC_SCP_SUPPORT & HVDCP_SUPPORT #define SCP_SUPPORT 1 #define QC_SUPPORT 1 #define QC30_SUPPORT 1 #endif/**QC_SCP_SUPPORT**/ #define UFCS_SUPPORT 0 #if UFCS_SUPPORT #define UFCS_DERAT_SUPPORT 0 #define UFCS_MTP_PATCH 1 #endif/**UFCS_SUPPORT**/ #define APPLE_MODE_SUPPORT 1 #define TFCP_SUPPORT 0 #define AFC_SUPPORT 1 #define PROTECTION_SUPPORT 1 #if PROTECTION_SUPPORT #define VIN_OVP_SUPPORT 0 #define VIN_UVP_SUPPORT 1 #define CHIP_OTP_SUPPORT 0 #define DNDP_OVP_SUPPORT 1 #define GATE_UVP_SUPPORT 0 #define V2_OCP_SUPPORT 0 #define VBUS_OCP_SUPPORT 0 #define CCx_OVP_SUPPORT 0 #define VCONN_OCP_SUPPORT 0 #endif/**PROTECTION_SUPPORT**/ #define CABLE_COMP_SUPPORT 0 #define POWEROUT_SUPPORT 0 #define ADC_ENABLE 1 #define WATCHDOG_ENABLE 1 #define VD_ENABLE 0 #ifdef ACDC_2DCDC_2FB #define VOL_COMP_SUPPORT 0 #define CC_COMP_SUPPORT 0 #endif #if VD_ENABLE #define VD_PEAK_DETECT 1 #define VD_FREQ_DETECT 0 #endif/**VD_ENABLE**/ #define ADC_UPDATE_SUPPORT 0 #define DAC_TRIM_ENABLE 1 #define ADC_TRIM_ENABLE 1 #define AUTO_ZERO_SUPPORT 0 #define LOOP_TASK_ENABLE 0 #if LOOP_TASK_ENABLE #define TEMP_REPORT_SUPPORT 0 #define GREEN_MODE_SUPPORT 0 #define SLEEP_MODE_SUPPORT 0 #define LPS_PROTE_ENABLE 0 #endif extern volatile uint16_t g_systick_cnt[2]; #define GET_SYSTICK16_TIME(port)\ g_systick_cnt[port] #endif