1 #ifndef __SYS_H
2 #define __SYS_H
3 #include "tk499.h"
4 #include "HAL_conf.h"
5 //位带操作,实现51类似的GPIO控制功能
6 //具体实现思想,参考<<CM3权威指南>>第五章(87页~92页).M4同M3类似,只是寄存器地址变了.
7 //IO口操作宏定义
8 //#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))
9 //#define MEM_ADDR(addr)  *((volatile unsigned long  *)(addr))
10 //#define BIT_ADDR(addr, bitnum)   MEM_ADDR(BITBAND(addr, bitnum))
11 
12 void  RemapVtorTable(void);
13 void  AI_Responder_enable(void);
14 void  AI_Responder_disable(void);
15 
16 void Sys_Soft_Reset(void);                                  //系统软复位
17 void Sys_Standby(void);                                     //待机模式
18 
19 void TK499_NVIC_Init(u8 NVIC_PreemptionPriority,u8 NVIC_SubPriority,u8 NVIC_Channel,u8 NVIC_Group);
20 void Ex_NVIC_Config(u8 GPIOx,u8 BITx,u8 TRIM);              //外部中断配置函数(只对GPIOA~I)
21 
22 //以下为汇编函数
23 void WFI_SET(void);     //执行WFI指令
24 void INTX_DISABLE(void);//关闭所有中断
25 void INTX_ENABLE(void); //开启所有中断
26 
27 void TIM3_Config(u16 arr,u16 psc);
28 #endif
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40