📄 lib_lpc_pll.h
字号:
/*
***********************************************************************
Embest Info&Tech Co., Ltd. All rights reserved.
www.embedinfo.com
***********************************************************************
---------------- file information -------------------------------------
file name: lpc_lib_pll.h
version : v0
author : peter pan / panqan@hotmail.com
panqian@embedinfo.com
begin : 2006-02-10
finish : 2006-02-10
define : lpc pll control head file
notes :
---------------- modify information -----------------------------------
version :
modify :
begin :
finish :
define :
-----------------------------------------------------------------------
*/
/*
Fosc (PLL)
-------> SYS clock:
1. cclk(cpu work clock)
(VPB divider)
---------------> 2. pclk(peripheral device)
(each control)
3. peripheral device clock <----------------
calculate:
cclk = M * Fosc 或 cclk = FCCO / (2*P)
FCCO:
FCCO = cclk * 2 * P / FCCO = FOSC * M * 2 * P
Fosc: 10 MHz ~ 25 MHz.
cclk: 10 MHz to Fmax (the maximum allowed frequency for the LPCxx).
Fcco: 156 MHz ~ 320 MHz.
*/
// (--------------------- compiler condition --------------------------
#ifndef lpc_lib_pll_h
#define lpc_lib_pll_h
// --------------------- compiler condition --------------------------)
/*-------------------------------------------------------------------*/
/* include files */
/*---------------------------------------------------------------- --*/
#include "..\..\..\com\type_redefine.h"
#include "..\..\..\com\register_lpc22xx.h"
/*-------------------------------------------------------------------*/
/* local function declare */
/*-------------------------------------------------------------------*/
void lpc_init_pll_manual();
void lpc_init_pll_auto();
/*-------------------------------------------------------------------*/
/* variable define */
/*-------------------------------------------------------------------*/
// for lpc_init_pll_manual()
#define PLL_CFG 0x61 // M=2 multiple
// P=8
#define PLL_VPBDIV 0x11 // VPB = CCLK
#define MAM_TIM 0x03 // read code 2 clock
#define PCLKF 20000000 //
#define Fpclk 20000000
//#define Fpclk 10000000
/*
// for lpc_init_pll_manual()
#define PLL_CFG 0x23 // 4 multiple
#define PLL_VPBDIV 0x00 // VPB = 1/4 CCLK
#define MAM_TIM 0x03 // read code 2 clock
*/
/*
// for lpc_init_pll_manual()
#define PLL_CFG 0x43 // M=4 multiple
// P=4
#define PLL_VPBDIV 0x00 // VPB = CCLK
#define MAM_TIM 0x03 // read code 2 clock
*/
/*
// for lpc_init_pll_manual()
#define PLL_CFG 0x26 // M=6 multiple
// P=2
#define PLL_VPBDIV 0x00 // VPB = CCLK/4
#define MAM_TIM 0x03 // read code 2 clock
*/
/*
// for lpc_init_pll_auto()
// Fosc、Fcclk、Fcco、Fpclk
#define Fosc 10000000 //crystal,10MHz~25MHz
#define Fcclk (Fosc * 4) //Fosc * N,<=60MHZ
#define Fcco (Fcclk * 4) //Fcclk* N,[156MHz~320MHz]
#define Fpclk (Fcclk / 4) * 4 //(Fcclk/4) * [1~4]
*/
// for lpc_init_pll_auto()
// Fosc、Fcclk、Fcco、Fpclk
#define Fosc 10000000 //crystal,10MHz~25MHz
#define Fcclk (Fosc * 4) //Fosc * N,<=60MHZ
//Fcclk/Fosc=M
#define Fcco (Fcclk * 7) //Fcclk* N,[156MHz~320MHz]
//Fcco=Fcclk*2*P
#define Fpclk (Fcclk/4) * 4 //(Fcclk/4) * [1~4]
/*-------------------------------------------------------------------*/
/* extern function declare */
/*-------------------------------------------------------------------*/
/*--- define in XXX.c ---
extern void XXX();
*/
/*-------------------------------------------------------------------*/
/* extern variable declare */
/*-------------------------------------------------------------------*/
/*--- USED in XXX() ---
XXX SSS; // used inXXX()
*/
/*-------------------------------------------------------------------*/
/* function code */
/*-------------------------------------------------------------------*/
/**********************************************************************
* name : xxxxx
* func : xxxxx
* para : xxxx
* ret : xxxx
* glob : xxxx
* inc :
* author:
* date :
* modify:
* comment:
**********************************************************************/
/*void xxx(xxx xxx)
{
}
*/
#endif //lpc_lib_pll_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -