stm32f7xx.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx.h
  4. * @author MCD Application Team
  5. * @brief CMSIS STM32F7xx 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 STM32F7xx 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) 2016 STMicroelectronics</center></h2>
  20. *
  21. * Redistribution and use in source and binary forms, with or without modification,
  22. * are permitted provided that the following conditions are met:
  23. * 1. Redistributions of source code must retain the above copyright notice,
  24. * this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright notice,
  26. * this list of conditions and the following disclaimer in the documentation
  27. * and/or other materials provided with the distribution.
  28. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  33. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  34. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  35. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  36. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  37. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  38. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  40. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  41. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. ******************************************************************************
  44. */
  45. /** @addtogroup CMSIS
  46. * @{
  47. */
  48. /** @addtogroup stm32f7xx
  49. * @{
  50. */
  51. #ifndef __STM32F7xx_H
  52. #define __STM32F7xx_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. /** @addtogroup Library_configuration_section
  57. * @{
  58. */
  59. /**
  60. * @brief STM32 Family
  61. */
  62. #if !defined (STM32F7)
  63. #define STM32F7
  64. #endif /* STM32F7 */
  65. /* Uncomment the line below according to the target STM32 device used in your
  66. application
  67. */
  68. #if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F767xx) && \
  69. !defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx) && !defined (STM32F722xx) && \
  70. !defined (STM32F723xx) && !defined (STM32F732xx) && !defined (STM32F733xx)
  71. /* #define STM32F756xx */ /*!< STM32F756VG, STM32F756ZG, STM32F756ZG, STM32F756IG, STM32F756BG,
  72. STM32F756NG Devices */
  73. /* #define STM32F746xx */ /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
  74. STM32F746BE, STM32F746BG, STM32F746NE, STM32F746NG Devices */
  75. /* #define STM32F745xx */ /*!< STM32F745VE, STM32F745VG, STM32F745ZG, STM32F745ZE, STM32F745IE, STM32F745IG Devices */
  76. /* #define STM32F765xx */ /*!< STM32F765BI, STM32F765BG, STM32F765NI, STM32F765NG, STM32F765II, STM32F765IG,
  77. STM32F765ZI, STM32F765ZG, STM32F765VI, STM32F765VG Devices */
  78. /* #define STM32F767xx */ /*!< STM32F767BG, STM32F767BI, STM32F767IG, STM32F767II, STM32F767NG, STM32F767NI,
  79. STM32F767VG, STM32F767VI, STM32F767ZG, STM32F767ZI Devices */
  80. /* #define STM32F769xx */ /*!< STM32F769AG, STM32F769AI, STM32F769BG, STM32F769BI, STM32F769IG, STM32F769II,
  81. STM32F769NG, STM32F769NI, STM32F768AI Devices */
  82. /* #define STM32F777xx */ /*!< STM32F777VI, STM32F777ZI, STM32F777II, STM32F777BI, STM32F777NI Devices */
  83. /* #define STM32F779xx */ /*!< STM32F779II, STM32F779BI, STM32F779NI, STM32F779AI, STM32F778AI Devices */
  84. /* #define STM32F722xx */ /*!< STM32F722IE, STM32F722ZE, STM32F722VE, STM32F722RE, STM32F722IC, STM32F722ZC,
  85. STM32F722VC, STM32F722RC Devices */
  86. /* #define STM32F723xx */ /*!< STM32F723IE, STM32F723ZE, STM32F723VE, STM32F723IC, STM32F723ZC, STM32F723VC Devices */
  87. /* #define STM32F732xx */ /*!< STM32F732IE, STM32F732ZE, STM32F732VE, STM32F732RE Devices */
  88. /* #define STM32F733xx */ /*!< STM32F733IE, STM32F733ZE, STM32F733VE Devices */
  89. #endif
  90. /* Tip: To avoid modifying this file each time you need to switch between these
  91. devices, you can define the device in your toolchain compiler preprocessor.
  92. */
  93. #if !defined (USE_HAL_DRIVER)
  94. /**
  95. * @brief Comment the line below if you will not use the peripherals drivers.
  96. In this case, these drivers will not be included and the application code will
  97. be based on direct access to peripherals registers
  98. */
  99. /*#define USE_HAL_DRIVER */
  100. #endif /* USE_HAL_DRIVER */
  101. /**
  102. * @brief CMSIS Device version number V1.2.2
  103. */
  104. #define __STM32F7_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
  105. #define __STM32F7_CMSIS_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
  106. #define __STM32F7_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
  107. #define __STM32F7_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
  108. #define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
  109. |(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
  110. |(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
  111. |(__STM32F7_CMSIS_VERSION))
  112. /**
  113. * @}
  114. */
  115. /** @addtogroup Device_Included
  116. * @{
  117. */
  118. #if defined(STM32F722xx)
  119. #include "stm32f722xx.h"
  120. #elif defined(STM32F723xx)
  121. #include "stm32f723xx.h"
  122. #elif defined(STM32F732xx)
  123. #include "stm32f732xx.h"
  124. #elif defined(STM32F733xx)
  125. #include "stm32f733xx.h"
  126. #elif defined(STM32F756xx)
  127. #include "stm32f756xx.h"
  128. #elif defined(STM32F746xx)
  129. #include "stm32f746xx.h"
  130. #elif defined(STM32F745xx)
  131. #include "stm32f745xx.h"
  132. #elif defined(STM32F765xx)
  133. #include "stm32f765xx.h"
  134. #elif defined(STM32F767xx)
  135. #include "stm32f767xx.h"
  136. #elif defined(STM32F769xx)
  137. #include "stm32f769xx.h"
  138. #elif defined(STM32F777xx)
  139. #include "stm32f777xx.h"
  140. #elif defined(STM32F779xx)
  141. #include "stm32f779xx.h"
  142. #else
  143. #error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
  144. #endif
  145. /**
  146. * @}
  147. */
  148. /** @addtogroup Exported_types
  149. * @{
  150. */
  151. typedef enum
  152. {
  153. RESET = 0U,
  154. SET = !RESET
  155. } FlagStatus, ITStatus;
  156. typedef enum
  157. {
  158. DISABLE = 0U,
  159. ENABLE = !DISABLE
  160. } FunctionalState;
  161. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
  162. typedef enum
  163. {
  164. ERROR = 0U,
  165. SUCCESS = !ERROR
  166. } ErrorStatus;
  167. /**
  168. * @}
  169. */
  170. /** @addtogroup Exported_macro
  171. * @{
  172. */
  173. #define SET_BIT(REG, BIT) ((REG) |= (BIT))
  174. #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
  175. #define READ_BIT(REG, BIT) ((REG) & (BIT))
  176. #define CLEAR_REG(REG) ((REG) = (0x0))
  177. #define WRITE_REG(REG, VAL) ((REG) = (VAL))
  178. #define READ_REG(REG) ((REG))
  179. #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
  180. #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
  181. /**
  182. * @}
  183. */
  184. #ifdef USE_HAL_DRIVER
  185. #include "stm32f7xx_hal.h"
  186. #endif /* USE_HAL_DRIVER */
  187. #ifdef __cplusplus
  188. }
  189. #endif /* __cplusplus */
  190. #endif /* __STM32F7xx_H */
  191. /**
  192. * @}
  193. */
  194. /**
  195. * @}
  196. */
  197. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/