option.h

来自「基于mcx314的运动控制」· C头文件 代码 · 共 73 行

H
73
字号
#ifndef _OPTION_H_
#define _OPTION_H_

// ************* OPTIONS **************
//cowboy//#define MCLK (50000000)

#define	EXT_OSC_CLK		8000000

#define MCLKM (60)              
#define MCLK  (MCLKM * 1000000)
#define PLLON 1
#define PLLM  ((MCLKM*8/10)-8)
#define PLLP  2
#define PLLS  1

//#define MCLKM (20)              
//#define MCLK  (MCLKM * 1000000)
//#define PLLON 1
//#define PLLM  ((MCLKM*8/8)-8)
//#define PLLP  2
//#define PLLS  1
/*  Fout = (8 + M_DIV) * Fin / [ (2+P_DIV) * (2^S_DIV) ]  */

//20,40,50,60,66,75
//        (PLL_M+8)*Fin      (PLL_M+8)*10Mhz
//MCLK=------------------- = --------------
//     (PLL_P+2)*(2^PLL_S)        4*2


#define WRBUFOPT (0x8)   //写缓冲使能(Enabel write buffer operation)
//#define WRBUFOPT (0x0)   //写缓冲禁止(disabel write buffer operation)

#define SYSCFG_0KB  (0x0|WRBUFOPT)
#define SYSCFG_4KB  (0x2|WRBUFOPT)
#define SYSCFG_8KB  (0x6|WRBUFOPT)

//#define DRAM	    1		//In case DRAM is used
#define SDRAM	    2		//In case SDRAM is used
#define BDRAMTYPE   SDRAM	//used in power.c,44blib.c


#define CACHECFG    SYSCFG_8KB

#define _RAM_STARTADDRESS 0x0c000000
//08M字节 SDRAM:0x0c000000-0x0c7fffff
//16M字节 SDRAM:0x0c000000-0x0cffffff
//32M字节 SDRAM:0x0c000000-0x0dffffff
//64M字节 SDRAM:0x0c000000-0x0fffffff

//#define Non_Cache_Start		(0)
#define Non_Cache_Start	(0x1c00000)
//#define Non_Cache_Start   (0x2000000)                          
#define Non_Cache_End     (0xc000000)                          
//#define Non_Cache_Start1  (0x2000000)                          
//#define Non_Cache_End1    (0xc000000)                          
//#define Non_Cache_Start2  (0x2000000)                          
//#define Non_Cache_End2    (0xc000000)                          

#define BUSWIDTH    (16)

#define Debug 1     //Now all the code is under Debug State

//#define _ISR_STARTADDRESS 0xc3fff00   //GCS6:32M bits(4M字节) DRAM/SDRAM
#define _ISR_STARTADDRESS 0xc7fff00     //GCS6:64M bits(8M字节) DRAM/SDRAM

#endif /*__OPTION_H__*/






⌨️ 快捷键说明

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