Electricity/FWLIB/source/ENS1_BOOST.c

39 lines
880 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "ENS1_BOOST.h"
#include "ENS1_CLOCK.h"
/*--------------------ÄÚ˛żBOOST_SET-----------------------*/
uint8_t Boost_Voltage_Sel(uint8_t VOLTAGE_XV)
{
PCLK_Enable(ANALOG_PCLK_EN);
switch (VOLTAGE_XV){
case VOLTAGE_11V :
CMSDK_ANAC->BOOST_CTRL =0x71013;//ÄÚ˛żboost
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
case VOLTAGE_15V :
CMSDK_ANAC->BOOST_CTRL =0x71113;//ÄÚ˛żboost
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
case VOLTAGE_26V :
CMSDK_ANAC->BOOST_CTRL =0x71213;//ÄÚ˛żboost
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
case VOLTAGE_45V :
CMSDK_ANAC->BOOST_CTRL =0xc1413;//
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
case VOLTAGE_55V :
CMSDK_ANAC->BOOST_CTRL =0xc1713;//ÄÚ˛żboost
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
default:
CMSDK_ANAC->BOOST_CTRL =0x71013;//ÄÚ˛żboost
CMSDK_ANAC->PMU_CTRL = 0x10;
break;
}
return 0;
}