⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 triton_power_test.c

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 C
字号:
//=====================================================================//
//        company:               COMMIT Incorporated                   //
//        department:            HW                                    //
//        author:                LijUNJIE                                //
//        version:               1.0                                   //
//        create date:           11/09/2005                            //
//        release date:                                                //
//        final revise date:                                           //
//        reviser:                                                     //
//        file descript:                                               //
//=====================================================================//

#include "UART_IrDA.h"
#include "triton_mapping.h"
#include "global_types.h"

void AVTIVE_TO_SLEEP_SW()
 {
  MSI2C_AccessPage(PMC_MASTER_page); //access to PMC master page
 
  //Set the subsysytem P1,P2,P3 to SLEEP
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P2_DEV,0x02);
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P3_DEV,0x02);
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P1_DEV,0x02);  

  }

void AVTIVE_TO_SLEEP_WAKEUP1()
 {
  MSI2C_AccessPage(PMC_MASTER_page); //access to PMC master page

  
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P1_CFG_TRANSITION,0x9F); //enable wakeup envent on level
  //Set the subsysytem P2,P3 to SLEEP
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P2_DEV,0x02);
  MSI2C_MasterPollingSendAbb(PMC_MASTER_P3_DEV,0x02);
  
  }


void SLEEP_TO_ACTIVE()
{
 UART_Printf(UART2,"\tSet RTC and Alarm time\r\n");
 SetRTC();
 Alarm_Test();
}


void Power_Test_Menu(void)
 {
  int choice = 1;
  int temp;
  while(choice)
   {
    UART_Printf(UART2,"\n\r");
    UART_Printf(UART2,"\t=================================\r\n");
    UART_Printf(UART2,"\t   Triton Power Test\r\n");
    UART_Printf(UART2,"\t=================================\r\n");
    UART_Printf(UART2,"\t 0:EXIT\r\n");
    UART_Printf(UART2,"\t 1:Active state to Sleep state by SW\r\n");
    UART_Printf(UART2,"\t 2:Active state to Sleep state by WAKEUP1 \r\n");
    UART_Printf(UART2,"\t 3:SLEEP state to ACTIVE state by Alarm \r\n");
    UART_Printf(UART2,"\t==================================\r\n");
    UART_Printf(UART2,"\r\n\tEnter your choice:\r\n");
   
    choice = UART_GetNum(UART2);
    UART_Printf(UART2,"\n\r");

    switch(choice)
	 {
	  case 0:
	  {break;}

      case 1:
	  {
	  AVTIVE_TO_SLEEP_SW();
	  break;
	  }

      case 2:
	  {
	   AVTIVE_TO_SLEEP_WAKEUP1();
	   break;
	  }

	  case 3:
	  {
	   SLEEP_TO_ACTIVE();
	   break;
	  }

      default:
	  break;
	 }//end switch
    }//end while
  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -