📄 u_init.c
字号:
/******************************************************************************
* File name : init.c
* Module name : initial module
* Author : Hiromichi.Kondo
*-----------------------------------------------------------------------------
* $Id: Init.c,v 1.2 2003/05/14 01:26:10 9551619 Exp $
*****************************************************************************/
#define GLBREAL
#include "c33l17.h"
#include "u_value.h"
#include "u_macro.h"
#include "u_regNikka.h"
#include "u_ram_data.h"
#include "u_rom_data.h"
void USBD_Init(void);
static void InitCPU(void);
extern int vbus_on_1st;
/*****************************************************************************
* USBD_Init
*****************************************************************************/
void USBD_Init(void)
{
InitCPU(); /* Initialization of C33 */
PowerOnProc(); /* PowerOn Process */
vbus_on_1st = 0;
timer3_Init();
timer3_Run();
}
/*****************************************************************************
* InitCPU
*****************************************************************************/
static void InitCPU(void)
{
/* Inital CMU */
pCMU_PROTECT =0x96;
USB_CKE = 1; // USB_SAPB clock on
USBSAPB_CKE = 1; // USB_CLK ~
pCMU_PROTECT =0x0;
/* Inital FPT10 Interrupt */
SPT(10) = 2; //FPT10 Int Port As Nikka
SPPT(10) = 1; //Rising edge
SEPT(10) = 1;
INT_PRxL(10) = 6; //FPT10 Int Level 6
INT_FP(10) = 1; //FPT10 Int Flag Clear
INT_EP(10) = 1; //FPT10 Int Enalbe
/* Inital HSDMA CH1 */
SPT(9) = 2; //FPT9 Int Port As Nikka #PDREQ
SPPT(9) = 0; //Falling edge
SEPT(9) = 1;
INT_PHSDxL(1) = 7; //HS1 Int level
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -