📄 target.#3
字号:
#include "MEMSIC.h"
/**********************************************************************************
*
*
*
***********************************************************************************/
void Sysclk_Init(void) // Initialize oscillator
{
OSCICN = 0x80; // configure internal oscillator for
// its lowest frequency
RSTSRC = 0x04;
}
/**********************************************************************************
*
*
*
***********************************************************************************/
void Port_Init(void) // Initialize crossbar and GPIO
{
P1MDIN = 0x7F; // Port 1 pin 7 set as analog input
P0MDIN = 0xFF; // Not analog input
P0MDOUT = 0x00; // Open-drain output
P1MDOUT |= 0x0F; // Port 1 pins 0-3 set high impedence
P2MDOUT |= 0x0C; // Port 2 pins 0,1 set high impedence
P1SKIP = 0x80; // Port 1 pin 7 skipped by crossbar
XBR0 = 0x00;
XBR1 = 0x40; // Enable Crossbar
}
/**********************************************************************************
*
*
*
***********************************************************************************/
void Interrupt_Init(void)
{
ET2 = 1; // Enable Timer2 interrupt
PT2 = 1; // Set T2 to High priority.
}
/**********************************************************************************
*
*
*
***********************************************************************************/
void WDT_Init(void)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -