?? common.h
字號:
//-------------------------------------------------------------------------*
// 文件名: common.h (通用頭文件) *
// 說 明: 包含了寄存器映像頭文件,類型宏定義等 *
//-------------------------------------------------------------------------*
#ifndef _COMMON_H_
#define _COMMON_H_
//1 頭文件
#include "MK60N512VMD100.h" //寄存器映像頭文件
//2 宏定義
//2.1 用于中斷的宏定義
#define ARM_INTERRUPT_LEVEL_BITS 4//中斷優先級宏定義
#define EnableInterrupts asm(" CPSIE i");//開總中斷
#define DisableInterrupts asm(" CPSID i");//關總中斷
//2.2 類型別名宏定義
typedef unsigned char uint8; /* 8 bits */
typedef unsigned short int uint16; /* 16 bits */
typedef unsigned long int uint32; /* 32 bits */
typedef char int8; /* 8 bits */
typedef short int int16; /* 16 bits */
typedef int int32; /* 32 bits */
typedef volatile int8 vint8; /* 8 bits */
typedef volatile int16 vint16; /* 16 bits */
typedef volatile int32 vint32; /* 32 bits */
typedef volatile uint8 vuint8; /* 8 bits */
typedef volatile uint16 vuint16; /* 16 bits */
typedef volatile uint32 vuint32; /* 32 bits */
//3 函數聲明
//-------------------------------------------------------------------------*
//函數名: stop *
//功 能: 設置CPU為STOP模式 *
//參 數: 無 *
//返 回: 無 *
//說 明: 無 *
//-------------------------------------------------------------------------*
void stop (void);
//-------------------------------------------------------------------------*
//函數名: wait *
//功 能: 設置CPU為WAIT模式 *
//參 數: 無 *
//返 回: 無 *
//說 明: 無 *
//-------------------------------------------------------------------------*
void wait (void);
//-------------------------------------------------------------------------*
//函數名: write_vtor *
//功 能: 更改中斷向量表偏移寄存器的值 *
//參 數: 要更改的值 *
//返 回: 無 *
//說 明: 無 *
//-------------------------------------------------------------------------*
void write_vtor (int);
//-------------------------------------------------------------------------*
//函數名: enable_irq *
//功 能: 使能irq中斷 *
//參 數: irq:irq號 *
//返 回: 無 *
//說 明: irq號不是中斷向量號 *
//-------------------------------------------------------------------------*
void enable_irq (int);
//-------------------------------------------------------------------------*
//函數名: disable_irq *
//功 能: 禁止irq中斷 *
//參 數: irq:irq號 *
//返 回: 無 *
//說 明: irq號不是中斷向量號 *
//-------------------------------------------------------------------------*
void disable_irq (int);
//-------------------------------------------------------------------------*
//函數名: set_irq_priority *
//功 能: 設置irq中斷和優先級 *
//參 數: irq:irq號 *
// prio:優先級 *
//返 回: 無 *
//說 明: irq號不是中斷向量號 *
//-------------------------------------------------------------------------*
void set_irq_priority (int, int);
//-------------------------------------------------------------------------*
//函數名: main *
//功 能: 主函數聲明 *
//參 數: 無 *
//返 回: 無 *
//說 明: 無 *
//-------------------------------------------------------------------------*
void main(void);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -