sys_api.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef SYS_API_H
  2. #define SYS_API_H
  3. #include "stm32f7xx.h"
  4. #include "core_cm7.h"
  5. #include "stm32f7xx_hal.h"
  6. //////////////////////////////////////////////////////////////////////////////////
  7. //0,不支持os
  8. //1,支持os
  9. #define SYSTEM_SUPPORT_OS 0 //定义系统文件夹是否支持OS
  10. ///////////////////////////////////////////////////////////////////////////////////
  11. //定义一些常用的数据类型短关键字
  12. typedef int32_t s32;
  13. typedef int16_t s16;
  14. typedef int8_t s8;
  15. typedef const int32_t sc32;
  16. typedef const int16_t sc16;
  17. typedef const int8_t sc8;
  18. typedef __IO int32_t vs32;
  19. typedef __IO int16_t vs16;
  20. typedef __IO int8_t vs8;
  21. typedef __I int32_t vsc32;
  22. typedef __I int16_t vsc16;
  23. typedef __I int8_t vsc8;
  24. typedef uint32_t u32;
  25. typedef uint16_t u16;
  26. typedef uint8_t u8;
  27. typedef const uint32_t uc32;
  28. typedef const uint16_t uc16;
  29. typedef const uint8_t uc8;
  30. typedef __IO uint32_t vu32;
  31. typedef __IO uint16_t vu16;
  32. typedef __IO uint8_t vu8;
  33. typedef __I uint32_t vuc32;
  34. typedef __I uint16_t vuc16;
  35. typedef __I uint8_t vuc8;
  36. #define ON 1
  37. #define OFF 0
  38. #define Write_Through() (*(__IO uint32_t*)0XE000EF9C=1UL<<2) //Cache透写模式
  39. void Cache_Enable(void); //使能STM32H7的L1-Cahce
  40. u8 Get_ICahceSta(void);//判断I_Cache是否打开
  41. u8 Get_DCahceSta(void);//判断I_Dache是否打开
  42. #if defined(__clang__) //使用V6编译器(clang)
  43. void __attribute__((noinline)) WFI_SET(void);
  44. void __attribute__((noinline)) INTX_DISABLE(void);
  45. void __attribute__((noinline)) INTX_ENABLE(void);
  46. void __attribute__((noinline)) MSR_MSP(u32 addr);
  47. #elif defined (__CC_ARM) //使用V5编译器(ARMCC)
  48. //以下为汇编函数
  49. void WFI_SET(void); //执行WFI指令
  50. void INTX_DISABLE(void);//关闭所有中断
  51. void INTX_ENABLE(void); //开启所有中断
  52. void MSR_MSP(u32 addr); //设置堆栈地址
  53. #endif
  54. #endif