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

📄 2410test.c

📁 2410TK测试代码
💻 C
📖 第 1 页 / 共 2 页
字号:
//====================================================================
// File Name : 2410test.c
// Function  : S3C2410 Test Main Menu
// Program   : Shin, On Pil (SOP)
// Date      : December 15, 2004
// Version   : 0.0
// History
//   0.0 : Programming start (February 20,2002) -> SOP
//   1.0 (20020530) : First release for customer
//   1.1 (20020801) : Strata NOR Flash Added and etc. -> SOP
//   1.2 (20020930) : Added IIS Slave mode Test Menu. -> SOP
//       (20021208) : IIS Record & Play Test
//       (20030616) : Test
//       (20030711) : CPU ID check -> SOP
//       (20031223) : SOP
//       (20040207) : SOP
//       (20040514) : SOP
//====================================================================

#include <stdlib.h>
#include <string.h>

//Shin, On Pil
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"

#include "2410etc.h"
#include "2410IIC.h"
#include "2410iis.h"
#include "2410int.h"
#include "2410RTC.h"
#include "2410swi.h"
//#include "cpuspeed.h"
//#include "lcdpwr.h"
#include "timer.h"
#include "memtest.h"            // 04/28/2004 SOP

//Kang, Weon Tark
#include "adc.h"
#include "dma.h"
#include "dma2.h"
#include "eint.h"
#include "extdma.h"
#include "k9s1208.h"
#include "mmu.h"
#include "nwait.h"
#include "sdi.h"
#include "stone.h"
#include "ts_auto.h"
#include "ts_sep.h"
#include "usbfifo.h"

//Shin, Jeong Seuk
#include "IrDA.h"
#include "lcd.h"
#include "lcdlib.h"
#include "glib.h"
#include "palette.h"
#include "spi.h"
#include "uart0.h"
#include "uart1.h"
#include "uart2.h"

//Kong, In Wook
#include "iis_dual.h"
#include "etc.h"
#include "flash.h"
#include "idle.h"
#include "pd6710.h"
#include "pll.h"
#include "power.h"
#include "pwr_c.h"
#include "power-off.h"

//Lee Sang Jo
#include "cpuspeed.h"

#define CACHE_EN    1       //0: Cache Disable   1: Cache Enable

void Isr_Init(void);
void HaltUndef(void);
void HaltSwi(void);
void HaltPabort(void);
void HaltDabort(void);

void * function[][2]=
{
//ADC, TSP
    (void *)Test_Adc,                       "ADC                 ",
    (void *)Test_DMA_Adc,                   "ADC with DMA        ",
    (void *)Ts_Sep,                         "ADC TSP Seperate    ",
    (void *)Ts_Auto,                        "ADC TSP Auto        ",
//CPU Speed    
    (void *)Test_CpuSpeed,                  "CPU Speed Test      ",
//DMA   
    (void *)Test_DMA,                       "DMA M2M             ",
    (void *)Test_DMAWorst,                  "DMA Worst Test      ",
    (void *)Test_Dma0Xdreq,                 "External DMA        ",    
//EINT  
    (void *)Test_Eint,                      "External Interrupt  ",
//IIC   
    (void *)Test_Iic,                       "IIC(KS24C080)INT    ",
    (void *)Test_Iic2,                      "IIC(KS24C080)POL    ",
//IIS   
    (void *)Test_IisRecPlay,                "IIS Reco&Play Test  ",
    (void *)Record_Iis,                     "Reco IIS UDA1341    ",
    (void *)Test_Iis,                       "Play IIS UDA1341    ",
    (void *)Iis_Tx,                         "IIS Slave Set Test  ",
    (void *)Iis_Rx,                         "IIS Master Set Test ",            
//Interrupt     
    (void *)Test_Fiq,                       "FIQ Interrupt       ",
    (void *)Change_IntPriorities,           "Change INT Priority ",
//IrDA  
    (void *)Test_IrDA_Rx,                   "UART2 IrDA Rx       ",
    (void *)Test_IrDA_Tx,                   "UART2 IrDA Tx       ",
//LCD   
//    (void *)Test_PaletteMemory,             "LCD Palette RAM     ",
    (void *)Test_Lcd_Stn_1Bit,              "STN 1Bit            ",
    (void *)Test_Lcd_Stn_2Bit,              "STN 2Bit            ",
    (void *)Test_Lcd_Stn_4Bit,              "STN 4Bit            ",    

    (void *)Test_Lcd_Cstn_8Bit,             "CSTN  8Bit          ",
    (void *)Test_Lcd_Cstn_8Bit_On,          "CSTN  8Bit On       ",    
    (void *)Test_Lcd_Cstn_12Bit,            "CSTN 12Bit          ",

    (void *)Test_Lcd_Tft_8Bit_240320,       "TFT240320  8Bit     ",
    (void *)Test_Lcd_Tft_8Bit_240320_On,    "TFT240320  8Bit On  ",    
    (void *)Test_Lcd_Tft_16Bit_240320,      "TFT240320 16Bit     ",
//  (void *)Test_Lcd_Tft_8Bit_240320_Bmp,   "TFT240320 Bmp       ",

    (void *)Test_Lcd_Tft_1Bit_640480,       "TFT640480  1Bit     ",
    (void *)Test_Lcd_Tft_8Bit_640480,       "TFT640480  8Bit     ",
    (void *)Test_Lcd_Tft_16Bit_640480,      "TFT640480 16Bit     ",

    (void *)Test_Lcd_Tft_8Bit_640480_Bswp,  "TFT640480 BSWP      ",
    (void *)Test_Lcd_Tft_8Bit_640480_Palette, "TFT640480 Palette   ",  
    (void *)Test_Lcd_Tft_16Bit_640480_Hwswp,"TFT640480 HWSWP     ",

//  (void *)Test_Lcd_PowerOnOFF,            "LCD Power On/Off    ",    
//Memory
//  (void *)WriteMemory,                    "MEMORY Write        ",
//  (void *)ReadMemory,                     "MEMORY Read         ",
//MPLL
    (void *)Test_PLL,                       "MPLL Change         ",
    (void *)ChangePLL,                      "MPLL MPS Change     ",
    (void *)Test_PllOnOff,                  "MPLL On/Off         ",  
//PMS
    (void *)Test_SlowMode,                  "PMS Slow            ",
    (void *)Test_SlowMode_DIVN,             "PMS Slow DIVN       ",         
    (void *)Test_HoldMode,                  "PMS Hold            ",     
    (void *)Test_IdleMode,                  "PMS Idle            ",
    (void *)Test_MMUIdleMode,               "PMS Idle(MMU)       ",
    (void *)Test_IdleModeHard,              "PMS Idle Hard       ",
    (void *)Test_InitSDRAM,                 "PMS SDRAM Init      ",
    (void *)Test_PowerOffMode,              "PMS Power-Off       ",     
    (void *)Test_PowerOffMode_100Hz,        "PMS Power-Off 100Hz ",
    (void *)MeasurePowerConsumption,        "PMS Measure Power   ",    
//RTC
    (void *)Test_Rtc_Alarm,                 "RTC Alarm           ",
    (void *)Display_Rtc,                    "RTC Display         ",    
    (void *)RndRst_Rtc,                     "RTC Round Reset     ",    
    (void *)Test_Rtc_Tick,                  "RTC Tick            ",
//SDI
    (void *)Test_SDI,                       "SDI Write/Read      ",
//  (void *)MMC_Protect,                    "SDI MMC Protect     ",
//  (void *)MMC_Dma_StrRd,                  "SDI MMC Read        ",
//  (void *)MMC_Dma_StrWt,                  "SDI MMC Write       ", 
//SPI
    (void*) Test_Spi_MS_int,                "SPI0 RxTx Int       ",
    (void *)Test_Spi_MS_poll,               "SPI0 RxTx POLL      ",
    (void *)Test_Spi_M_Tx_DMA1,             "SPI0 Master Tx DMA1 ",
    (void *)Test_Spi_S_Rx_DMA1,             "SPI0 Slave Rx DMA1  ",
    (void *)Test_Spi_M_Rx_DMA1,             "SPI0 Master Rx DMA1 ",
    (void *)Test_Spi_S_Tx_DMA1,             "SPI0 Slave Tx DMA1  ",
    (void *)Test_Spi_M_Int,                 "SPI0 Master RxTx INT",
    (void *)Test_Spi_S_Int,                 "SPI0 Slave RxTx INT ",
//Timer
//  (void *)Test_TimerChannel,              "Timer Channel       ",
//  (void *)Test_TimerDma,                  "Timer DMA           ",
    (void *)Test_TimerInt,                  "Timer Interrupt     ",
    (void *)Test_Timer,                     "Timer Tout          ",
//UART
    (void *)Test_Uart0_Int,                 "UART0 Rx/Tx Int     ",
    (void *)Test_Uart0_Dma,                 "UART0 Rx/Tx DMA     ",
    (void *)Test_Uart0_Fifo,                "UART0 Rx/Tx FIFO    ",
    (void *)Test_Uart0_AfcTx,               "UART0 AFC Tx        ",
    (void *)Test_Uart0_AfcRx,               "UART0 AFC Rx        ",

    (void *)Test_Uart1_Int,                 "UART1 Rx/Tx Int     ",
    (void *)Test_Uart1_Dma,                 "UART1 Rx/Tx DMA     ",
    (void *)Test_Uart1_Fifo,                "UART1 Rx/Tx FIFO    ",
    (void *)Test_Uart1_AfcTx,               "UART1 AFC Tx        ",
    (void *)Test_Uart1_AfcRx,               "UART1 AFC Rx        ",

    (void *)Test_Uart2_Int,                 "UART2 Rx/Tx Int     ",
    (void *)Test_Uart2_Dma,                 "UART2 Rx/Tx DMA     ",
    (void *)Test_Uart2_Fifo,                "UART2 Rx/Tx FIFO    ",
//USB
    (void *)Test_USBFIFO,                   "USB FIFO Test       ",
//WDT
    (void *)Test_WDT_IntReq,                "WDT INT Request     ",
//ETC           
//  (void *)Test_CpuSpeed,                  "*Core Speed         ",
    (void *)Test_XBREQ,                     "External Bus Reqest ",
    (void *)Test_NonalignedAccess,          "NonAlgined Access   ",
    (void *)Test_PD6710,                    "PC Card (PD6710)    ",    
    (void *)ReadPageMode,                   "Read Page Mode      ",
    (void *)Test_SwiIrq,                    "SWI                 ",
    (void *)Test_WaitPin,                   "External Wait       ",
    (void *)Test_ISram,                     "Stone Test          ",  
    (void *)Test_NecInterrupt,              "ETC NEC Int         ",
    (void *)Test_BattFaultInterrupt,        "nBATT_FAULT int     ",      
//NAND, NOR Flash
    (void *)K9S1208_PrintBadBlockNum,       "NAND View Bad Block ",
    (void *)K9S1208_PrintBlock,             "NAND View Page      ",
    (void *)K9S1208_Program,                "NAND Write          ", 
    (void *)K9S1208_Erase,                  "NAND Erase          ",      
    (void *)TestECC,                        "NAND ECC            ", 
    (void *)ProgramFlash,                   "NOR Flash Program   ",    
    0,0
};

//===================================================================
void Main(void)
{
    int i;
    
    Led_Display(15);
    
#if CACHE_EN    
    MMU_Init();
#else
    MMU_DisableDCache();
    MMU_DisableICache();    
#endif    
   
#if ADS10   
    __rt_lib_init();                //for ADS 1.0
#endif
    
//    ChangeClockDivider(0,0);          // 1:1:1    
//    rCLKDIVN |= (1<<2);                     // 1:4:4

//    ChangeClockDivider(0,1);          // 1:1:2
//    ChangeClockDivider(1,0);          // 1:2:2 
    ChangeClockDivider(1,1);          // 1:2:4    

//    ChangeMPllValue(0x92,0x4,0x2);    // FCLK=50MHz    

⌨️ 快捷键说明

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