📄 clk.h
字号:
//////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004, Eyoka @ Microunit
// All Rights Reserved
//________________________________________________________________________
//
// FILENAME: clk.h
// PROJECT: High-Resolution Video System On OMAP
// MODULE: MPU System
// DESCRIPTION: Clock Generation and System Reset Management Interface
// TARGET CPU: ARM-925T of OMAP5910
// VERSION: 0.2
//________________________________________________________________________
//
// REVISE HISTORY
// DATE VERSION AUTHOR DESCRIPTION
// 2004-11-08 0.2 Eyoka Checked.
// 2004-11-01 0.1 Eyoka Created.
//////////////////////////////////////////////////////////////////////////
#ifndef _CLK_H_
#define _CLK_H_
#include "datatypes.h"
/////////////////////////////////////////////////////////////////////
// TYPES
/////////////////////////////////////////////////////////////////////
typedef enum
{
FULL_SYNC = 0,
SYNC_SCAL = 1
}
CLK_MODE_t;
typedef enum
{
DIV_1 = 0,
DIV_2 = 1,
DIV_4 = 2,
DIV_8 = 3
}
CLK_DIV_t;
/////////////////////////////////////////////////////////////////////
// REGISTERS
/////////////////////////////////////////////////////////////////////
#define ARM_CKCTL REG16(0xFFFECE00)
#define ARM_IDLECT1 REG16(0xFFFECE04)
#define ARM_IDLECT2 REG16(0xFFFECE08)
#define ARM_EWUPCT REG16(0xFFFECE0C)
#define ARM_RSTCT1 REG16(0xFFFECE10)
#define ARM_RSTCT2 REG16(0xFFFECE14)
#define ARM_SYSST REG16(0xFFFECE18)
#define DPLL1_CTL_REG REG16(0xFFFECF00)
/////////////////////////////////////////////////////////////////////
// FUNCTIONS
/////////////////////////////////////////////////////////////////////
//___________________________________________________________________
// Function: CLK_Init
// Usage: Initialize clock generation settings.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void CLK_Init(void);
//___________________________________________________________________
// Function: CLK_SetupDPLL
// Usage: Config the DPLL to get proper clock frequency.
// Parameters:
// mult multiplier, 2<=mult<=25
// divd divider, 1<=divd<=4
// timeout timeout value to wait for DPLL to be locked.
// Return Values:
// BOOL TRUE if successfully locked, FALSE otherwise
//___________________________________________________________________
// do not support multpier 0 or 1
BOOL CLK_SetupDPLL(int mult, int divd, int timeout);
//___________________________________________________________________
// Function: CLK_SetDIV_DSPMMU
// Usage: Set DSPMMU clock divider
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_DSPMMU(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_SetDIV_TC
// Usage: Set traffic controler clock divider
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_TC(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_SetDIV_DSP
// Usage: Set DSP clock divider
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_DSP(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_SetDIV_ARM
// Usage: Set MPU clock divider
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_ARM(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_SetDIV_LCD
// Usage: Set LCD-controller clock divider
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_LCD(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_SetDIV_PER
// Usage: Set peripheral clock divider.
// Parameters:
// divd can be: DIV_1, DIV_2, DIV_4 or DIV_8
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetDIV_PER(CLK_DIV_t divd);
//___________________________________________________________________
// Function: CLK_EnableDSPCK
// Usage: Enable/Disable the DSP clock (DSP_CK).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableDSPCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableGPIOCK
// Usage: Enable/Disable the MPU-GPIO clock (connected to TIPB).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableGPIOCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableDMAREQCK
// Usage: Enable/Disable the permanently-supplied-clock to the
// DMA controller to function on a clock-request basis.
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableDMAREQCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableTIMCK
// Usage: Enable/Disable the MPU-timer clock (connected to TIPB).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableTIMCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableAPICK
// Usage: Enable/Disable the MPUI clock.
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableAPICK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableLBCK
// Usage: Enable/Disable the local bus clock.
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableLBCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableLCDCK
// Usage: Enable/Disable the LCD-controller clock (connected to TIPB).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableLCDCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnablePERCK
// Usage: Enable/Disable the peripheral clock (MPUPER_CK).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnablePERCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableXORCK
// Usage: Enable/Disable the OS-timer clock(XORP_CK).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableXORCK(BOOL bEnable);
//___________________________________________________________________
// Function: CLK_EnableWDTCK
// Usage: Enable/Disable the watchdog timer clock (connected to TIPB).
// Parameters:
// bEnable TRUE to Enable, FALSE to Disable.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_EnableWDTCK(BOOL bEnable);
//___________________________________________________________________
// Function: RST_SoftReset
// Usage: Software reset the MPU.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_SoftReset(void);
//___________________________________________________________________
// Function: RST_ReleaseDSP
// Usage: Release DSP from reset.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_ReleaseDSP(void);
//___________________________________________________________________
// Function: RST_ResetDSP
// Usage: Reset the DSP.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_ResetDSP(void);
//___________________________________________________________________
// Function: RST_EnableDSP
// Usage: Enables the DSP.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_EnableDSP(void);
//___________________________________________________________________
// Function: RST_ResetARM
// Usage: Reset the MPU.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_ResetARM(void);
//___________________________________________________________________
// Function: RST_ResetPER
// Usage: Reset the MPU Peripherals.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_ResetPER(void);
//___________________________________________________________________
// Function: RST_ReleasePER
// Usage: Release MPU Peripherals from reset.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void RST_ReleasePER(void);
//___________________________________________________________________
// Function: CLK_SetMode
// Usage: Set clock mode
// Parameters:
// mode can be: FULL_SYNC or SYNC_SCAL.
// Return Values: N/A
//___________________________________________________________________
//
void CLK_SetMode(CLK_MODE_t mode);
#endif // ifndef _CLK_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -