66 lines
1.6 KiB
C
66 lines
1.6 KiB
C
#ifndef _SYS_H
|
|
#define _SYS_H
|
|
|
|
#include "stm32l4xx.h"
|
|
#include "core_cm4.h"
|
|
#include "stm32l4xx_hal.h"
|
|
|
|
|
|
/**
|
|
* SYS_SUPPORT_OS用于定义系统文件夹是否支持OS
|
|
* 0,不支持OS
|
|
* 1,支持OS
|
|
*/
|
|
#define SYS_SUPPORT_OS 0
|
|
|
|
|
|
/*函数声明*******************************************************************************************/
|
|
|
|
void sys_nvic_set_vector_table(uint32_t baseaddr, uint32_t offset); /* 设置中断偏移量 */
|
|
void sys_standby(void); /* 进入待机模式 */
|
|
void sys_soft_reset(void); /* 系统软复位 */
|
|
//uint8_t sys_stm32_clock_init(uint32_t plln, uint32_t pllm, uint32_t pllp, uint32_t pllq); /* 配置系统时钟 */
|
|
uint8_t SystemClock_Config(void);
|
|
|
|
/* 以下为汇编函数 */
|
|
void sys_wfi_set(void); /* 执行WFI指令 */
|
|
void sys_intx_disable(void); /* 关闭所有中断 */
|
|
void sys_intx_enable(void); /* 开启所有中断 */
|
|
void sys_msr_msp(uint32_t addr); /* 设置栈顶地址 */
|
|
void Error_Handler(uint8_t flag);
|
|
|
|
#endif
|
|
//#ifndef _SYS_H
|
|
//#define _SYS_H
|
|
|
|
////#ifdef __cplusplus
|
|
//// extern "C" {
|
|
////#endif
|
|
|
|
//#include "stm32l4xx.h"
|
|
//#include "core_cm4.h"
|
|
//#include "stm32f4xx_hal.h"
|
|
|
|
////#include "General_type.h"
|
|
|
|
//#ifndef IN_SYS
|
|
//#define EX_SYS extern
|
|
// #else
|
|
//#define EX_SYS
|
|
//#endif
|
|
|
|
//EX_SYS void SystemClock_Config(void);//时钟系统配置
|
|
////以下为汇编函数
|
|
//EX_SYS void WFI_SET(void); //执行WFI指令
|
|
//EX_SYS void INTX_DISABLE(void);//关闭所有中断
|
|
//EX_SYS void INTX_ENABLE(void); //开启所有中断
|
|
//EX_SYS void MSR_MSP(uint32_t addr); //设置堆栈地址
|
|
|
|
//#ifdef __cplusplus
|
|
//}
|
|
//#endif
|
|
//#endif
|
|
|
|
|
|
|