📄 lle_time.h
字号:
/*******************************************************************************/
/**
Copyright (c) 2007 Freescale Semiconductor
Freescale Confidential Proprietary
\file lle_TIME.h
\brief Definitions and function prototypes for timers
\author Freescale Semiconductor
\author B05114
\version 1.1
\date December/2007
*/
/*******************************************************************************/
#ifndef _LLE_TIME_H
#define _LLE_TIME_H
/* Constants for PLL and bus clock configuration */
/* If POSTDIV = 0: fbus = [OSCCLK*(SYNDIV+1)]/[(REFDIV+1)] */
/* Else: fbus = [OSCCLK*(SYNDIV+1)]/[2*(REFDIV+1)*(POSTDIV)] */
#define PLL_POSTDIV 0x00
#define PLL_SYNDIV 0x04
#define PLL_REFDIV 0x00
/* fbus = [8MHz*(5)]/[(1)] = 40MHz */
/* fVCO = 2*OSCCLK*(SYNDIV+1)/(REFDIV+1) = 16MHz* 5/1 = 80MHz */
#define PLL_VCOFRQ 0x01 /* -> VCOFRQ = 01b */
/* fREF = OSCCLK/(REFDIV+1) = 8MHz/1 = 8MHz */
#define PLL_REFFRQ 0x02 /* -> REFRQ = 10b */
/* Constants for RTI configuration, decimal divider and OSCCLK = 8 MHz */
#define RTI_50ms 0x57 /* RTI period=400k/8MHz = 50ms */
#define RTI_150ms 0x6B /* RTI period=1.2M/8MHz = 150ms */
/* Constant for API configuration: period = 2*(APIR+1)*0.1ms */
#define API_50ms 249 /* APIR = 249, period = 50ms) */
#define API_100ms 499 /* APIR = 499, period = 100ms) */
/* Constants for delays */
#define DELAY_100uS 308 /* ~100us, fBUS = 40MHz */
#define DELAY_4mS 12320 /* ~4ms, fBUS = 40MHz */
#define DELAY_10mS 30800 /* ~10ms, fBUS = 40MHz */
#define SPI_DELAY 10 /* ~3us, fBUS = 40MHz */
/** Macros */
#define lle_Delay100us() lle_SW_Delay(DELAY_100uS)
#define lle_Delay4ms() lle_SW_Delay(DELAY_4mS)
#define lle_Delay10ms() lle_SW_Delay(DELAY_10mS)
/** Function Prototypes */
/** System clock and PLL initialization */
void lle_Init_XOSC(void);
/** Real time interupt initialization at 50 ms */
void lle_Init_RTI(UINT8 u8RTI_period);
/** Autonomous periodical interrupt initialization */
void lle_Init_API(UINT16 u16API_period);
/** Software loop for time delay */
void lle_SW_Delay(UINT16 u16Delay);
#endif /* _LLE_TIME_H */
/*******************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -