stm32f7xx.h 8.2 KB

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