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

📄 xsclkmgr.h

📁 优龙YLP270开发板 光盘自带的BIOS和实验例程源码 强烈推荐
💻 H
字号:
#ifndef _ClkMgr_H_
#define _ClkMgr_H_
/******************************************************************************
**
**  COPYRIGHT (C) 2000, 2001 Intel Corporation.
**
**  This software as well as the software described in it is furnished under 
**  license and may only be used or copied in accordance with the terms of the 
**  license. The information in this file is furnished for informational use 
**  only, is subject to change without notice, and should not be construed as 
**  a commitment by Intel Corporation. Intel Corporation assumes no 
**  responsibility or liability for any errors or inaccuracies that may appear 
**  in this document or any software that may be provided in association with 
**  this document. 
**  Except as permitted by such license, no part of this document may be 
**  reproduced, stored in a retrieval system, or transmitted in any form or by 
**  any means without the express written consent of Intel Corporation. 
**
**  FILENAME:       XsClkMgr.h
**
**  PURPOSE:        API for the clocks manager. The clocks manager is responsible 
**                  for enabling and disabling clocks to the peripheral devices.
**                  Note that not all of the registers are handled in this file.
**                  Specifically the OSCC, and CCCR registers are missing from 
**                  this file. The reason is that these registers are supposed to 
**                  be set using the assembly language startup for the system and
**                  really should not be tampered with afterwards. 
**
**  LAST MODIFIED:  $Modtime: 7/17/03 1:01p $
******************************************************************************/

/*
*******************************************************************************
The clock enable register CKEN.
The naming of these bits conforms to the standard whereby the action 
is specified in the name when the bit is set. However, these bits will be 
used for both enabling and disabling the clocks. Therefore an alias is created 
for each of these bits. The alias is the next section.
*******************************************************************************
*/

#define PWM0_CE     (0x1u << 0)     // PWM #0 clock enable
#define PWM1_CE     (0x1u << 1)     // PWM #1 clock enable
#define AC97_CE     (0x1u << 2)     // AC97 
#define SSP2_CE     (0x1u << 3)     // SSP 2
#define SSP3_CE     (0x1u << 4)     // SSP 3
#define STUART_CE   (0x1u << 5)     // Standard UART
#define FFUART_CE   (0x1u << 6)     // Full Function UART
#define BTUART_CE   (0x1u << 7)     // Bluetooth UART
#define I2S_CE      (0x1u << 8)     // I2S
#define OST_CE      (0x1u << 9)     // Operating System Timers
#define USBH_CE     (0x1u << 10)    // USB Host
#define USB_CE      (0x1u << 11)    // USB Client
#define MMC_CE      (0x1u << 12)    // MMC
#define ICP_CE      (0x1u << 13)    // ICP
#define I2C_CE      (0x1u << 14)    // I2C
#define PWRI2C_CE   (0x1u << 15)    //
#define LCD_CE      (0x1u << 16)    // LCD 
#define MSL_CE      (0x1u << 17)    // MSL
#define USIM_CE     (0x1u << 18)    // USIM
#define KEYPAD_CE   (0x1u << 19)    // Keypad
#define MSTICK_CE   (0x1u << 21)    // Memory Stick
#define MEMC_CE     (0x1u << 22)    // Memory Controller
#define SSP_CE      (0x1u << 23)    // SSP 1

/*
*******************************************************************************
Aliases for the device clock enables. The enable and disable procedure takes
a single UINT32 as a parameter. This UINT32 contains the bit settings for the 
devices that are being enabled or disabled.
*******************************************************************************
*/

typedef enum periphClkNamesS
{
    CK_PWM0   =  PWM0_CE,
    CK_PWM1   =  PWM1_CE,
    CK_AC97   =  AC97_CE,
    CK_SSP2   =  SSP2_CE,
    CK_SSP3   =  SSP3_CE,   
    CK_STUART =  STUART_CE,
    CK_FFUART =  FFUART_CE,
    CK_BTUART =  BTUART_CE,
    CK_I2S    =  I2S_CE,
    CK_OST    =  OST_CE,
    CK_USBH   =  USBH_CE,
    CK_USB    =  USB_CE,
    CK_MMC    =  MMC_CE,
    CK_ICP    =  ICP_CE,
    CK_I2C    =  I2C_CE,
    CK_PWRI2C =  PWRI2C_CE,
    CK_LCD    =  LCD_CE,
    CK_MSL    =  MSL_CE,
    CK_USIM   =  USIM_CE,
    CK_KEYPAD =  KEYPAD_CE,
    CK_MSTICK =  MSTICK_CE,
    CK_MEMC   =  MEMC_CE,
    CK_SSP    =  SSP_CE
} periphClkNamesT;   

/*
*******************************************************************************
Note: The following structure defines all of the Clock manager registers, 
but only the CKEN register is manipulated in this module. The other registers
should have been pre-programmed by the assembly language startup code.
*******************************************************************************
*/

#define CKEN_REGISTER_BASE 0x41300000

typedef struct clkMgrRegsS
{
    VUINT32 CCCR;       // Core clock configuration register
    VUINT32 CKEN;       // Clock Enable register
    VUINT32 OSCC;       // Oscillator Configuration register
}clkMgrRegsT;

/*
*******************************************************************************
function prototypes
*******************************************************************************
*/

UINT32 xsCMEnableClock (periphClkNamesT);
UINT32 xsCMDisableClock (periphClkNamesT);
UINT32 xsCMDisableClockAll(void);

/*****************************************************************************/

#endif //_ClkMgr_H_ 

⌨️ 快捷键说明

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