aurix_hal_sys.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*! \file system.h
  2. * \brief Basic system control API definition
  3. *
  4. * A simple API providing general system control functions like
  5. * - PLL control
  6. * - interrupt enable/disable
  7. * - access protection enable/disable
  8. * - software reset
  9. * - power management
  10. *
  11. * \autor TGL
  12. *
  13. * \version
  14. * 08.08.2010 initial version
  15. * 13.09.2010 GetExtClock function added
  16. *
  17. */
  18. #ifndef __SYSTEM_H__
  19. #define __SYSTEM_H__
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif /* __cplusplus */
  23. /*! \brief Check if cache is enabled
  24. */
  25. int SYSTEM_IsCacheEnabled(void);
  26. /*! \brief Enable/disable cache
  27. */
  28. void SYSTEM_EnaDisCache(int Enable);
  29. /* 0,1,2 ... core WDT
  30. * 3 ... safety WDT
  31. */
  32. void SYSTEM_EnableProtectionExt(int Sel);
  33. void SYSTEM_DisableProtectionExt(int Sel);
  34. void SYSTEM_EnableSecProtection(void);
  35. void SYSTEM_DisableSecProtection(void);
  36. unsigned long SYSTEM_GetStmClock(void);
  37. unsigned long SYSTEM_GetCanClock(void);
  38. /*! \brief System initialisation
  39. *
  40. * Do basic system initialisation like
  41. * - PLL setup
  42. */
  43. void SYSTEM_Init(void);
  44. /*! \brief Get external clock frequency
  45. *
  46. * Return external clock frequency. Usually this is the system's
  47. * crystal or oscillator frequency.
  48. * \return External clock frequency, unit Hz
  49. */
  50. unsigned long SYSTEM_GetExtClock(void);
  51. /*! \brief Get CPU clock frequency
  52. *
  53. * Return CPU clock frequency. Usually this is the core frequency.
  54. * \return CPU clock frequency, unit Hz
  55. */
  56. unsigned long SYSTEM_GetCpuClock(void);
  57. /*! \brief Get system clock frequency
  58. *
  59. * Return system clock frequency. Usually this is the peripheral frequency.
  60. * \return System clock frequency, unit Hz
  61. */
  62. unsigned long SYSTEM_GetSysClock(void);
  63. /*! \brief Globally enable interrupts
  64. */
  65. void SYSTEM_EnableInterrupts(void);
  66. /*! \brief Globally disable interrupts
  67. */
  68. void SYSTEM_DisableInterrupts(void);
  69. /*! \brief Globally enable access protection
  70. *
  71. * This function is optional. If the architecture doesn't support access
  72. * protection this function does nothing.
  73. */
  74. void SYSTEM_EnableProtection(void);
  75. /*! \brief Globally disable access protection
  76. *
  77. * This function is optional. If the architecture doesn't support access
  78. * protection this function does nothing.
  79. */
  80. void SYSTEM_DisableProtection(void);
  81. /*! \brief Execute software reset
  82. */
  83. int SYSTEM_Reset(void);
  84. /*! \brief Execute Idle instruction
  85. */
  86. int SYSTEM_Idle(void);
  87. /*! \brief Execute power down function
  88. */
  89. int SYSTEM_Sleep(void);
  90. /*! \brief Debug break system
  91. */
  92. void SYSTEM_DbgBreak(void);
  93. #ifdef __cplusplus
  94. }
  95. #endif /* __cplusplus */
  96. #endif /* __SYSTEM_H__ */