📄 triton_ldo_test.c
字号:
MSI2C_AccessPage(PMC_SLAVE_page);
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_SLAVE_VREXTH_CFG_DEDICATED);
MSI2C_MasterPollingSendAbb(PMC_SLAVE_VREXTH_CFG_DEDICATED,(voltage |(previous_content & 0xFE)));
}
void Triton_Map_MMC_SIM(void)
{
int previous_content ;
/* to access to the page of the Abb module PMC_SLAVE */
MSI2C_AccessPage(PMC_SLAVE_page);
/* change VRMMC from NO_GROUP to DEV_GRP_APPLI (0b001) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_SLAVE_VRMMC_CFG_STS);
MSI2C_MasterPollingSendAbb(PMC_SLAVE_VRMMC_CFG_STS,(previous_content | 0x20));
/* change VRSIM from NO_GROUP to DEV_GRP_PERIPH (0b001) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_SLAVE_VRSIM_CFG_STS);
MSI2C_MasterPollingSendAbb(PMC_SLAVE_VRSIM_CFG_STS,(previous_content | 0x20));
}
void triton_map_VRVBUS(void)
{
int previous_content ;
/* to access to the page of the Abb module PMC_SLAVE */
MSI2C_AccessPage(PMC_SLAVE_page);
/* change VRMMC from NO_GROUP to DEV_GRP_APPLI (0b001) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_SLAVE_VRVBUS_CFG_STS);
MSI2C_MasterPollingSendAbb(PMC_SLAVE_VRVBUS_CFG_STS,(previous_content | 0x20));
}
void triton_VRVBUS(void)
{
triton_map_VRVBUS();
}
void triton_map_VRUSB(void)
{
int previous_content ;
/* to access to the page of the Abb module PMC_SLAVE */
MSI2C_AccessPage(PMC_SLAVE_page);
/* change VRMMC from NO_GROUP to DEV_GRP_APPLI (0b001) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_SLAVE_VRUSB_CFG_STS);
MSI2C_MasterPollingSendAbb(PMC_SLAVE_VRUSB_CFG_STS,(previous_content | 0x20));
}
void triton_VRUSB(void)
{
triton_map_VRUSB();
}
void PM_P1_P2_P3_DEVOFF(void)
{
MSI2C_AccessPage(PMC_MASTER_page); //Page 1
MSI2C_MasterPollingSendAbb(PMC_MASTER_P1_DEV,DEVOFF);
MSI2C_MasterPollingSendAbb(PMC_MASTER_P2_DEV,DEVOFF);
MSI2C_MasterPollingSendAbb(PMC_MASTER_P3_DEV,DEVOFF);
}
void Neptune_VRSIM_2V8(void)
{
int i;
unsigned short val ;
int previous_content;
AbbDeviceAddress = AbbDeviceAddressDefault ;
/* I2c interface initialization */
MSI2C_InitConnectionAbb();
// Tritonsys_Regen_Sleepoff();
/* to access to the page of the Abb module MASTER */
MSI2C_AccessPage(PMC_MASTER_page);
/* configure PU and PD config registers */
/* set MCLK2 PD for non-apps usage */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_PU_PD_CFG1);
MSI2C_MasterPollingSendAbb(PMC_MASTER_PU_PD_CFG1,(previous_content & 0x02));
// previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_PU_PD_CFG1);
/* configure ITWAKEUP1 to be unmasked after 1st switch-on(P1_LVL_WAKEUP=1) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_P1_CFG_TRANSITION);
MSI2C_MasterPollingSendAbb(PMC_MASTER_P1_CFG_TRANSITION,(previous_content | 0x80));
// previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_P1_CFG_TRANSITION);
Tritonsys_Remap_Resources();
//Tritonsys_Map_MMC_SIM();
// Triton_Map_MMC_SIM();
triton_VRDBB(VRDBB1_40v); // vrdbb open to1.4v
triton_VRPLL(VRPLL_1_40V);
CONFIGURATION_VOLTAGE_CTRL_0 |= 0x044; //enable down mode and Vmode='1';
for(i=0;i<1000;i++);
trition_VRSIM(VRSIM_2V8); //set triton output 2.8V
for(i=0;i<1000;i++);
CONFIGURATION_VOLTAGE_CTRL_0 |= 0x0001; //set FMODE='01', 2.8v
for(i=0;i<1000;i++);
CONFIGURATION_VOLTAGE_CTRL_0 &= ~(0x040); //disable down mode
}
void Neptune_VRSIM_1V8(void)
{
int i;
unsigned short val ;
int previous_content;
AbbDeviceAddress = AbbDeviceAddressDefault ;
/* I2c interface initialization */
MSI2C_InitConnectionAbb();
// Tritonsys_Regen_Sleepoff();
/* to access to the page of the Abb module MASTER */
MSI2C_AccessPage(PMC_MASTER_page);
/* configure PU and PD config registers */
/* set MCLK2 PD for non-apps usage */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_PU_PD_CFG1);
MSI2C_MasterPollingSendAbb(PMC_MASTER_PU_PD_CFG1,(previous_content & 0x02));
// previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_PU_PD_CFG1);
/* configure ITWAKEUP1 to be unmasked after 1st switch-on(P1_LVL_WAKEUP=1) */
previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_P1_CFG_TRANSITION);
MSI2C_MasterPollingSendAbb(PMC_MASTER_P1_CFG_TRANSITION,(previous_content | 0x80));
// previous_content = MSI2C_MasterPollingReceiveAbb(PMC_MASTER_P1_CFG_TRANSITION);
Tritonsys_Remap_Resources();
//Tritonsys_Map_MMC_SIM();
// Triton_Map_MMC_SIM();
triton_VRDBB(VRDBB1_40v); // vrdbb open to1.4v
triton_VRPLL(VRPLL_1_40V);
CONFIGURATION_VOLTAGE_CTRL_0 |= 0x044; //enable down mode and Vmode='1';
for(i=0;i<1000;i++);
CONFIGURATION_VOLTAGE_CTRL_0 &= ~(0x0007); //Vmode='0', Fmode='00' 1.8V
for(i=0;i<1000;i++);
trition_VRSIM(VRSIM_1V8);
for(i=0;i<1000;i++);
CONFIGURATION_VOLTAGE_CTRL_0 &= ~(0x040); //disable down mode
}
void Tps62351_menu(void)
{
int temp,inputSelect;
MSI2C_InitConnectionAbb();
MSI2C_MasterPollingSend(0x4A,0x00,0x80);//device ID 0x4A,address 0x00
temp=MSI2C_MasterPollingReceive(0x4a,0x00);
while( 1 )
{
UART_Printf(UART2, "\r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, " ARM BENCH ----- Tps62351 Test Menu \r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, "00. Back up to up menu. \r\n");
UART_Printf(UART2, "01. TPS62351 output is 1.4V\r\n");
UART_Printf(UART2, "02. TPS62351 output is 1.4125V\r\n");
UART_Printf(UART2, "03. TPS62351 output is 1.425V\r\n");
UART_Printf(UART2, "04. TPS62351 output is 1.4375V\r\n");
UART_Printf(UART2, "05. TPS62351 output is 1.45V\r\n");
UART_Printf(UART2, "06. TPS62351 output is 1.4625V\r\n");
UART_Printf(UART2, "07. TPS62351 output is 1.475V\r\n");
UART_Printf(UART2, "08. TPS62351 output is 1.4875V\r\n");
UART_Printf(UART2, "09. TPS62351 output is 1.5V\r\n");
UART_Printf(UART2, "10. TPS62351 output is 1.1V\r\n");
UART_Printf(UART2, "11. TPS62351 output is 1.35V\r\n");
UART_Printf(UART2, "12. TPS62351 output is 1.30V\r\n");
UART_Printf(UART2, "13. TPS62351 output is 1.265V\r\n");
UART_Printf(UART2, "14. TPS62351 output is 1.225V\r\n");
UART_Printf(UART2, "15. TPS62351 output is 1.2V\r\n");
UART_Printf(UART2, "10. TPS62351 output is 1.1V\r\n");
UART_Printf(UART2, "16. TPS62351 output is 1.55V\r\n");
UART_Printf(UART2, "17. TPS62351 output is 1.60V\r\n");
UART_Printf(UART2, "18. TPS62351 output is 1.65V\r\n");
inputSelect = UART_GetNum(UART2);
switch(inputSelect)
{
case 0:
// Switch_to_DSP();
break;
case 1:
MSI2C_MasterPollingSend(0x4A,0x00,0xA8); //1.4V
break;
case 2:
MSI2C_MasterPollingSend(0x4A,0x00,0xA9); //1.4125V
break;
case 3:
MSI2C_MasterPollingSend(0x4A,0x00,0xAA); //1.425V
break;
case 4:
MSI2C_MasterPollingSend(0x4A,0x00,0xAB); //1.4375V
break;
case 5:
MSI2C_MasterPollingSend(0x4A,0x00,0xAC); //1.45V
break;
case 6:
MSI2C_MasterPollingSend(0x4A,0x00,0xAD); //1.4625V
break;
case 7:
MSI2C_MasterPollingSend(0x4A,0x00,0xAE); //1.475V
break;
case 8:
MSI2C_MasterPollingSend(0x4A,0x00,0xAF); //1.4875V
break;
case 9:
MSI2C_MasterPollingSend(0x4A,0x00,0xB0); //1.5V
break;
case 10:
MSI2C_MasterPollingSend(0x4A,0x00,0x90); //1.1V
break;
case 11:
MSI2C_MasterPollingSend(0x4A,0x00,0xa4); //1.35V
break;
case 12:
MSI2C_MasterPollingSend(0x4A,0x00,0xa0); //1.3V
break;
case 13:
MSI2C_MasterPollingSend(0x4A,0x00,0x9d); //1.2625V
break;
case 14:
MSI2C_MasterPollingSend(0x4A,0x00,0x9a); //1.2250V
break;
case 15:
MSI2C_MasterPollingSend(0x4A,0x00,0x98); //1.20V
break;
case 16:
MSI2C_MasterPollingSend(0x4A,0x00,0xb4); //1.55V
break;
case 17:
MSI2C_MasterPollingSend(0x4A,0x00,0xb8); //1.60V
break;
case 18:
MSI2C_MasterPollingSend(0x4A,0x00,0xbc); //1.65V
break;
default:
break;
}
break;
}
//MSI2C_MasterPollingSend(0x4A,0x00,0xac);//1.45V: 0xa8
//MSI2C_MasterPollingSend(0x4A,0x00,0xaf); //1.5V 0xaf
//MSI2C_MasterPollingSend(0x4A,0x00,0xB1); //1.51V 0xaf
//MSI2C_MasterPollingSend(0x4A,0x00,0xab); //1.44V 0xab:
//MSI2C_MasterPollingSend(0x4A,0x00,0xaa); //1.43v 0xaa;
//MSI2C_MasterPollingSend(0x4A,0x00,0xae); //1.48V 0xac
//MSI2C_MasterPollingSend(0x4A,0x00,0xad);
//MSI2C_MasterPollingSend(0x4A,0x00,0x8e);//1.089V 0x8e
temp=MSI2C_MasterPollingReceive(0x4a,0x00);
}
void Tps62350_menu(void)
{
int temp,inputSelect;
MSI2C_InitConnectionAbb();
MSI2C_MasterPollingSend(0x48,0x00,0xB4);//device ID 0x4A,address 0x00
temp=MSI2C_MasterPollingReceive(0x48,0x00);
while( inputSelect )
{
UART_Printf(UART2, "\r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, " ARM BENCH ----- Tps62350 Test Menu \r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, "00. Back up to up menu. \r\n");
UART_Printf(UART2, "01. TPS62350 output is 1.4V\r\n");
UART_Printf(UART2, "02. TPS62350 output is 1.4125V\r\n");
UART_Printf(UART2, "03. TPS62350 output is 1.425V\r\n");
UART_Printf(UART2, "04. TPS62350 output is 1.4375V\r\n");
UART_Printf(UART2, "05. TPS62350 output is 1.45V\r\n");
UART_Printf(UART2, "06. TPS62350 output is 1.4625V\r\n");
UART_Printf(UART2, "07. TPS62350 output is 1.475V\r\n");
UART_Printf(UART2, "08. TPS62350 output is 1.4875V\r\n");
UART_Printf(UART2, "09. TPS62350 output is 1.5V\r\n");
UART_Printf(UART2, "10. TPS62350 output is 1.1V\r\n");
UART_Printf(UART2, "11. TPS62350 output is 1.35V\r\n");
UART_Printf(UART2, "12. TPS62350 output is 1.30V\r\n");
UART_Printf(UART2, "13. TPS62350 output is 1.265V\r\n");
UART_Printf(UART2, "14. TPS62350 output is 1.225V\r\n");
UART_Printf(UART2, "15. TPS62350 output is 1.2V\r\n");
UART_Printf(UART2, "10. TPS62350 output is 1.1V\r\n");
inputSelect = UART_GetNum(UART2);
switch(inputSelect)
{
case 0:
// Switch_to_DSP();
break;
case 1:
MSI2C_MasterPollingSend(0x48,0x00,0xB4); //1.4V
break;
case 2:
MSI2C_MasterPollingSend(0x48,0x00,0xB5); //1.4125V
break;
case 3:
MSI2C_MasterPollingSend(0x48,0x00,0xB6); //1.425V
break;
case 4:
MSI2C_MasterPollingSend(0x48,0x00,0xB7); //1.4375V
break;
case 5:
MSI2C_MasterPollingSend(0x48,0x00,0xB8); //1.45V
break;
case 6:
MSI2C_MasterPollingSend(0x48,0x00,0xB9); //1.4625V
break;
case 7:
MSI2C_MasterPollingSend(0x48,0x00,0xBA); //1.475V
break;
case 8:
MSI2C_MasterPollingSend(0x48,0x00,0xBB); //1.4875V
break;
case 9:
MSI2C_MasterPollingSend(0x48,0x00,0xBC); //1.5V
break;
case 10:
MSI2C_MasterPollingSend(0x48,0x00,0xA8); //1.1V
break;
case 11:
MSI2C_MasterPollingSend(0x48,0x00,0xB0); //1.35V
break;
case 12:
MSI2C_MasterPollingSend(0x48,0x00,0xAC); //1.3V
break;
case 13:
MSI2C_MasterPollingSend(0x48,0x00,0xA9); //1.2625V
break;
case 14:
MSI2C_MasterPollingSend(0x48,0x00,0xA6); //1.2250V
break;
case 15:
MSI2C_MasterPollingSend(0x48,0x00,0xA4); //1.20V
break;
default:
break;
}
//break;
}
//MSI2C_MasterPollingSend(0x4A,0x00,0xac);//1.45V: 0xa8
//MSI2C_MasterPollingSend(0x4A,0x00,0xaf); //1.5V 0xaf
//MSI2C_MasterPollingSend(0x4A,0x00,0xB1); //1.51V 0xaf
//MSI2C_MasterPollingSend(0x4A,0x00,0xab); //1.44V 0xab:
//MSI2C_MasterPollingSend(0x4A,0x00,0xaa); //1.43v 0xaa;
//MSI2C_MasterPollingSend(0x4A,0x00,0xae); //1.48V 0xac
//MSI2C_MasterPollingSend(0x4A,0x00,0xad);
//MSI2C_MasterPollingSend(0x4A,0x00,0x8e);//1.089V 0x8e
temp=MSI2C_MasterPollingReceive(0x48,0x00);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -