STLmisc.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. ******************************************************************************
  3. * @file STLmisc.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date Feb-2012
  7. * @brief Contains prtotypes of routines required to monitor
  8. * CPU frequency during run-time.
  9. ******************************************************************************
  10. * @copy
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STLMISC_H
  24. #define __STLMISC_H
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "gd32f30x_libopt.h"
  27. typedef int32_t s32;
  28. typedef int16_t s16;
  29. typedef int8_t s8;
  30. typedef const int32_t sc32; /*!< Read Only */
  31. typedef const int16_t sc16; /*!< Read Only */
  32. typedef const int8_t sc8; /*!< Read Only */
  33. typedef __IO int32_t vs32;
  34. typedef __IO int16_t vs16;
  35. typedef __IO int8_t vs8;
  36. typedef __I int32_t vsc32; /*!< Read Only */
  37. typedef __I int16_t vsc16; /*!< Read Only */
  38. typedef __I int8_t vsc8; /*!< Read Only */
  39. typedef uint32_t u32;
  40. typedef uint16_t u16;
  41. typedef uint8_t u8;
  42. typedef const uint32_t uc32; /*!< Read Only */
  43. typedef const uint16_t uc16; /*!< Read Only */
  44. typedef const uint8_t uc8; /*!< Read Only */
  45. typedef __IO uint32_t vu32;
  46. typedef __IO uint16_t vu16;
  47. typedef __IO uint8_t vu8;
  48. typedef __I uint32_t vuc32; /*!< Read Only */
  49. typedef __I uint16_t vuc16; /*!< Read Only */
  50. typedef __I uint8_t vuc8; /*!< Read Only */
  51. /* SysTick counter state */
  52. #define SysTick_Counter_Disable ((uint32_t)0xFFFFFFFE)
  53. #define SysTick_Counter_Enable ((uint32_t)0x00000001)
  54. #define SysTick_Counter_Clear ((uint32_t)0x00000000)
  55. /* SysTick Flag */
  56. #define SysTick_FLAG_COUNT ((uint8_t)0x30)
  57. #define SysTick_FLAG_SKEW ((uint8_t)0x5E)
  58. #define SysTick_FLAG_NOREF ((uint8_t)0x5F)
  59. /* Exported functions ------------------------------------------------------- */
  60. void SysTick_SetReload(uint32_t Reload);
  61. void SysTick_CounterCmd(uint32_t SysTick_Counter);
  62. void SysTick_ITConfig(ControlStatus NewState);
  63. uint32_t SysTick_GetCounter(void);
  64. FlagStatus SysTick_GetFlagStatus(uint8_t SysTick_FLAG);
  65. #endif /* __STL_CLOCK_RUNTIME_H */
  66. /******************* (C) COPYRIGHT 2012 STMicroelectronics *****END OF FILE****/