You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

207 lines
5.8 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx.h
  4. * @author MCD Application Team
  5. * @brief CMSIS STM32H7xx Device Peripheral Access Layer Header File.
  6. *
  7. * The file is the unique include file that the application programmer
  8. * is using in the C source code, usually in main.c. This file contains:
  9. * - Configuration section that allows to select:
  10. * - The STM32H7xx device used in the target application
  11. * - To use or not the peripheral's drivers in application code(i.e.
  12. * code will be based on direct access to peripheral's registers
  13. * rather than drivers API), this option is controlled by
  14. * "#define USE_HAL_DRIVER"
  15. *
  16. ******************************************************************************
  17. * @attention
  18. *
  19. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  20. * All rights reserved.</center></h2>
  21. *
  22. * This software component is licensed by ST under BSD 3-Clause license,
  23. * the "License"; You may not use this file except in compliance with the
  24. * License. You may obtain a copy of the License at:
  25. * opensource.org/licenses/BSD-3-Clause
  26. *
  27. ******************************************************************************
  28. */
  29. /** @addtogroup CMSIS
  30. * @{
  31. */
  32. /** @addtogroup stm32h7xx
  33. * @{
  34. */
  35. #ifndef STM32H7xx_H
  36. #define STM32H7xx_H
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif /* __cplusplus */
  40. /** @addtogroup Library_configuration_section
  41. * @{
  42. */
  43. /**
  44. * @brief STM32 Family
  45. */
  46. #if !defined (STM32H7)
  47. #define STM32H7
  48. #endif /* STM32H7 */
  49. /* Uncomment the line below according to the target STM32H7 device used in your
  50. application
  51. */
  52. #if !defined (STM32H743xx) && !defined (STM32H753xx) && !defined (STM32H750xx) && !defined (STM32H742xx) && \
  53. !defined (STM32H745xx) && !defined (STM32H755xx) && !defined (STM32H747xx) && !defined (STM32H757xx)
  54. /* #define STM32H742xx */ /*!< STM32H742VI, STM32H742ZI, STM32H742AI, STM32H742II, STM32H742BI, STM32H742XI Devices */
  55. /* #define STM32H743xx */ /*!< STM32H743VI, STM32H743ZI, STM32H743AI, STM32H743II, STM32H743BI, STM32H743XI Devices */
  56. /* #define STM32H753xx */ /*!< STM32H753VI, STM32H753ZI, STM32H753AI, STM32H753II, STM32H753BI, STM32H753XI Devices */
  57. /* #define STM32H750xx */ /*!< STM32H750V, STM32H750I, STM32H750X Devices */
  58. /* #define STM32H747xx */ /*!< STM32H747ZI, STM32H747AI, STM32H747II, STM32H747BI, STM32H747XI Devices */
  59. /* #define STM32H757xx */ /*!< STM32H757ZI, STM32H757AI, STM32H757II, STM32H757BI, STM32H757XI Devices */
  60. /* #define STM32H745xx */ /*!< STM32H745ZI, STM32H745II, STM32H745BI, STM32H745XI Devices */
  61. /* #define STM32H755xx */ /*!< STM32H755ZI, STM32H755II, STM32H755BI, STM32H755XI Devices */
  62. #endif
  63. /* Tip: To avoid modifying this file each time you need to switch between these
  64. devices, you can define the device in your toolchain compiler preprocessor.
  65. */
  66. #if defined(DUAL_CORE) && !defined(CORE_CM4) && !defined(CORE_CM7)
  67. #error "Dual core device, please select CORE_CM4 or CORE_CM7"
  68. #endif
  69. #if !defined (USE_HAL_DRIVER)
  70. /**
  71. * @brief Comment the line below if you will not use the peripherals drivers.
  72. In this case, these drivers will not be included and the application code will
  73. be based on direct access to peripherals registers
  74. */
  75. /*#define USE_HAL_DRIVER */
  76. #endif /* USE_HAL_DRIVER */
  77. /**
  78. * @brief CMSIS Device version number V1.5.0
  79. */
  80. #define __STM32H7xx_CMSIS_DEVICE_VERSION_MAIN (0x01) /*!< [31:24] main version */
  81. #define __STM32H7xx_CMSIS_DEVICE_VERSION_SUB1 (0x05) /*!< [23:16] sub1 version */
  82. #define __STM32H7xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
  83. #define __STM32H7xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
  84. #define __STM32H7xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
  85. |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
  86. |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
  87. |(__CMSIS_DEVICE_HAL_VERSION_RC))
  88. /**
  89. * @}
  90. */
  91. /** @addtogroup Device_Included
  92. * @{
  93. */
  94. #if defined(STM32H743xx)
  95. #include "stm32h743xx.h"
  96. #elif defined(STM32H753xx)
  97. #include "stm32h753xx.h"
  98. #elif defined(STM32H750xx)
  99. #include "stm32h750xx.h"
  100. #elif defined(STM32H742xx)
  101. #include "stm32h742xx.h"
  102. #elif defined(STM32H745xx)
  103. #include "stm32h745xx.h"
  104. #elif defined(STM32H755xx)
  105. #include "stm32h755xx.h"
  106. #elif defined(STM32H747xx)
  107. #include "stm32h747xx.h"
  108. #elif defined(STM32H757xx)
  109. #include "stm32h757xx.h"
  110. #else
  111. #error "Please select first the target STM32H7xx device used in your application (in stm32h7xx.h file)"
  112. #endif
  113. /**
  114. * @}
  115. */
  116. /** @addtogroup Exported_types
  117. * @{
  118. */
  119. typedef enum
  120. {
  121. RESET = 0,
  122. SET = !RESET
  123. } FlagStatus, ITStatus;
  124. typedef enum
  125. {
  126. DISABLE = 0,
  127. ENABLE = !DISABLE
  128. } FunctionalState;
  129. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
  130. typedef enum
  131. {
  132. ERROR = 0,
  133. SUCCESS = !ERROR
  134. } ErrorStatus;
  135. /**
  136. * @}
  137. */
  138. /** @addtogroup Exported_macros
  139. * @{
  140. */
  141. #define SET_BIT(REG, BIT) ((REG) |= (BIT))
  142. #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
  143. #define READ_BIT(REG, BIT) ((REG) & (BIT))
  144. #define CLEAR_REG(REG) ((REG) = (0x0))
  145. #define WRITE_REG(REG, VAL) ((REG) = (VAL))
  146. #define READ_REG(REG) ((REG))
  147. #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
  148. #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
  149. /**
  150. * @}
  151. */
  152. #if defined (USE_HAL_DRIVER)
  153. #include "stm32h7xx_hal.h"
  154. #endif /* USE_HAL_DRIVER */
  155. #ifdef __cplusplus
  156. }
  157. #endif /* __cplusplus */
  158. #endif /* STM32H7xx_H */
  159. /**
  160. * @}
  161. */
  162. /**
  163. * @}
  164. */
  165. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/