📄 main.c
字号:
//=====================================================================//
// company: COMMIT Incorporated //
// department: HW //
// author: HW //
// version: 1.0 //
// create date: 08/14/2006 //
// release date: //
// final revise date: //
// reviser: //
// file descript: for Poseidon2.2 //
//=====================================================================//
//=====================================================================//
//include files //
//=====================================================================//
#include "main.h"
#include "inth_w.h"
//#define FM_TEST
//=====================================================================//
//main function //
//=====================================================================//
extern UWORD16 AbbDeviceAddress ; // device address used for the I2c communication
int checksum_result=0;
void VIKING2_INIT();
void VIKING2_BOOT();
void main (void)
{
int inputSelect = 0 ,i,j,count;
int inthNumber=0;
unsigned char ttt[100];
unsigned char temp[100];
unsigned short temp1[50],ttt1;
AbbDeviceAddress = AbbDeviceAddressDefault ;
UART_Initialize(UART3);
ConfigurePin();
gpio_dataout_low(1,2); // Enable Viking Core Voltage, and Select TD antenna.
// Tps62351_menu(); //1.43V
EMIFS_Viking_CS2();
// VIKINGII_INIT();
// while(1);
(*(short *)(0x08000022)) =0x0003;
(*(short *)(0x08000024)) |= 0x1;
/*
while(1)
{
(*(short *)(0x08000024)) |= 0x1;
//ttt1= (*(short *)(0x08000026)) ;
if(ttt1!=0)
{i++;}
(*(short *)(0x08000024)) &= (~0x1);
// ttt1= (*(short *)(0x08000026)) ;
if(ttt1!=0)
{i++;}
}
*/
// DSP_MMU();
// Switch_to_DSP(); //just for DSP run wlq add.
// WaitDSPRun();
ULPDR_CLOCK_GSM_REG |= 0x01;
// while(1)
// UART_Printf(UART3, "XXXXXXXXXXXXXXXXXXXX\r\n");
while( 1 )
{
UART_Printf(UART2, "\r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, " ARM BENCH ----- Neptune Test Menu \r\n");
UART_Printf(UART2, "========================================== \r\n");
UART_Printf(UART2, "00. Deliver control power to DSP. \r\n");
UART_Printf(UART2, "01. VikingII, Maxim and RF TEST MENU\r\n");
UART_Printf(UART2, "02. Triton test. \r\n");
UART_Printf(UART2, "03. Memory test. \r\n");
UART_Printf(UART2, "04. CRPM test. \r\n");
UART_Printf(UART2, "05. USIM test. \r\n");
UART_Printf(UART2, "06. GPIO test. \r\n");
UART_Printf(UART2, "07. Pin test. \r\n");
UART_Printf(UART2, "08. GSM Mode On. \r\n");
UART_Printf(UART2, "09. TD Mode On. \r\n");
UART_Printf(UART2, "10. GPIO I2C. \r\n");
UART_Printf(UART2, "11. CheckSum. \r\n");
UART_Printf(UART2, "21. LCD test. \r\n");
UART_Printf(UART2, "22. Keypad test. \r\n");
UART_Printf(UART2, "23. MMC/SD/SDIO card test. \r\n");
UART_Printf(UART2, "24. FM radio test. \r\n");
UART_Printf(UART2, "25. Melody test. \r\n");
UART_Printf(UART2, "41. UART test. \r\n");
UART_Printf(UART2, "42. MCBSP test. \r\n");
UART_Printf(UART2, "43. SPI test. \r\n");
UART_Printf(UART2, "44. TPS62351 test. \r\n");
UART_Printf(UART2, "45. Tca6408--I2C to GPIO test. \r\n");
UART_Printf(UART2, "99. Other test. \r\n");
UART_Printf(UART2, "SELECT ON OPTION TO TEST. \r\n");
inputSelect = UART_GetNum(UART2);
switch(inputSelect)
{
case 0:
// Switch_to_DSP();
break;
case 1:
VikingII_test_menu();
break;
case 2:
triton_test();
break;
case 3:
memory_main();
break;
case 4:
CRPMRegResetValueTest( );
break;
case 5:
usim_test();
break;
case 6:
GPIO_Test();
break;
case 7:
PinConfTest();
break;
case 8:
GSM_Antenna_On();
break;
case 9:
TD_Antenna_On();
break;
case 10:
I2C_GPIO();
break;
case 11:
checksum_result=CheckSum();
break;
case 21:
Lcdtest( );
break;
case 22:
kbctest( );
break;
case 23:
MMC_Test();
break;
case 24:
TEA5760_test();
break;
case 25:
break;
case 41:
UART_Initialize(UART3);
break;
case 42:
MCBSP_LoopBackTest(MCBSP1);
break;
case 43:
SPI_test_menu();
break;
case 44:
Tps62351_menu();
break;
case 45:
Tca6408_menu();
break;
case 99:
break;
default:
break;
}
}
}
int CheckSum()
{
int prog_start=0x10003b00,/*0x10003b00*/prog_end=0x10038100;//100381FE;
int checksum=0;
for(;prog_start<prog_end;prog_start += 4)
checksum=checksum^(*(int *)prog_start);
return checksum;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -