100 lines
2.4 KiB
C
100 lines
2.4 KiB
C
|
|
#ifndef _SYS_H
|
|||
|
|
#define _SYS_H
|
|||
|
|
#include "stm32h7xx.h"
|
|||
|
|
#include "core_cm7.h"
|
|||
|
|
#include "stm32h7xx_hal.h"
|
|||
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//STM32H7<48><37><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//ϵͳʱ<CDB3>ӳ<EFBFBD>ʼ<EFBFBD><CABC>
|
|||
|
|
|
|||
|
|
|
|||
|
|
//STM32H7<48><37><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>-HAL<41>⺯<EFBFBD><E2BAAF><EFBFBD>汾
|
|||
|
|
//DevEBox <20><>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD>
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>mcudev.taobao.com
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>shop389957290.taobao.com
|
|||
|
|
|
|||
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//0,<2C><>֧<EFBFBD><D6A7>os
|
|||
|
|
//1,֧<><D6A7>os
|
|||
|
|
#define SYSTEM_SUPPORT_OS 0 //<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7>OS
|
|||
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ̹ؼ<CCB9><D8BC><EFBFBD>
|
|||
|
|
typedef int32_t s32;
|
|||
|
|
typedef int16_t s16;
|
|||
|
|
typedef int8_t s8;
|
|||
|
|
|
|||
|
|
typedef const int32_t sc32;
|
|||
|
|
typedef const int16_t sc16;
|
|||
|
|
typedef const int8_t sc8;
|
|||
|
|
|
|||
|
|
typedef __IO int32_t vs32;
|
|||
|
|
typedef __IO int16_t vs16;
|
|||
|
|
typedef __IO int8_t vs8;
|
|||
|
|
|
|||
|
|
typedef __I int32_t vsc32;
|
|||
|
|
typedef __I int16_t vsc16;
|
|||
|
|
typedef __I int8_t vsc8;
|
|||
|
|
|
|||
|
|
typedef uint32_t u32;
|
|||
|
|
typedef uint16_t u16;
|
|||
|
|
typedef uint8_t u8;
|
|||
|
|
|
|||
|
|
typedef const uint32_t uc32;
|
|||
|
|
typedef const uint16_t uc16;
|
|||
|
|
typedef const uint8_t uc8;
|
|||
|
|
|
|||
|
|
typedef __IO uint32_t vu32;
|
|||
|
|
typedef __IO uint16_t vu16;
|
|||
|
|
typedef __IO uint8_t vu8;
|
|||
|
|
|
|||
|
|
typedef __I uint32_t vuc32;
|
|||
|
|
typedef __I uint16_t vuc16;
|
|||
|
|
typedef __I uint8_t vuc8;
|
|||
|
|
|
|||
|
|
#define ON 1
|
|||
|
|
#define OFF 0
|
|||
|
|
#define Write_Through() (*(__IO uint32_t*)0XE000EF9C=1UL<<2) //Cacheдģʽ
|
|||
|
|
|
|||
|
|
void Cache_Enable(void); //ʹ<><CAB9>STM32H7<48><37>L1-Cahce
|
|||
|
|
u8 Stm32_Clock_Init(u32 plln,u32 pllm,u32 pllp,u32 pllq); //<2F><><EFBFBD><EFBFBD>ϵͳʱ<CDB3><CAB1>
|
|||
|
|
u8 Get_ICahceSta(void); //<2F>ж<EFBFBD>I_Cache<68>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
u8 Get_DCahceSta(void); //<2F>ж<EFBFBD>I_Dache<68>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void QSPI_Enable_Memmapmode(void); //QSPI<50><49><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ӳ<EFBFBD><D3B3>ģʽ
|
|||
|
|
|
|||
|
|
#if defined(__clang__) //ʹ<><CAB9>V6<56><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(clang)
|
|||
|
|
void __attribute__((noinline)) WFI_SET(void);
|
|||
|
|
void __attribute__((noinline)) INTX_DISABLE(void);
|
|||
|
|
void __attribute__((noinline)) INTX_ENABLE(void);
|
|||
|
|
void __attribute__((noinline)) MSR_MSP(u32 addr);
|
|||
|
|
#elif defined (__CC_ARM) //ʹ<><CAB9>V5<56><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(ARMCC)
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ຯ<EFBFBD><E0BAAF>
|
|||
|
|
void WFI_SET(void); //ִ<><D6B4>WFIָ<49><D6B8>
|
|||
|
|
void INTX_DISABLE(void);//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
|
|||
|
|
void INTX_ENABLE(void); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
|
|||
|
|
void MSR_MSP(u32 addr); //<2F><><EFBFBD>ö<EFBFBD>ջ<EFBFBD><D5BB>ַ
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//STM32H7<48><37><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>-HAL<41>⺯<EFBFBD><E2BAAF><EFBFBD>汾
|
|||
|
|
//DevEBox <20><>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD>
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>mcudev.taobao.com
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>shop389957290.taobao.com
|
|||
|
|
|
|||
|
|
/////////////////////////////////////////////////////////////////////////////////
|