stm32f4xx.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx.h
  4. * @author MCD Application Team
  5. * @brief CMSIS STM32F4xx 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 STM32F4xx 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</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 stm32f4xx
  49. * @{
  50. */
  51. #ifndef __STM32F4xx_H
  52. #define __STM32F4xx_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. /** @addtogroup Library_configuration_section
  57. * @{
  58. */
  59. #define USE_HAL_DRIVER
  60. //#define __IO volatile
  61. #define STM32F429xx
  62. /**
  63. * @brief STM32 Family
  64. */
  65. #if !defined (STM32F4)
  66. #define STM32F4
  67. #endif /* STM32F4 */
  68. /**
  69. * @brief CMSIS version number V2.6.2
  70. */
  71. //#define __STM32F4xx_CMSIS_VERSION_MAIN (0x02U) /*!< [31:24] main version */
  72. //#define __STM32F4xx_CMSIS_VERSION_SUB1 (0x06U) /*!< [23:16] sub1 version */
  73. //#define __STM32F4xx_CMSIS_VERSION_SUB2 (0x02U) /*!< [15:8] sub2 version */
  74. //#define __STM32F4xx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
  75. /*#define __STM32F4xx_CMSIS_VERSION ((__STM32F4xx_CMSIS_VERSION_MAIN << 24)\
  76. |(__STM32F4xx_CMSIS_VERSION_SUB1 << 16)\
  77. |(__STM32F4xx_CMSIS_VERSION_SUB2 << 8 )\
  78. |(__STM32F4xx_CMSIS_VERSION))
  79. */
  80. /** @addtogroup Device_Included
  81. * @{
  82. */
  83. #include "stm32f429xx.h"
  84. /** @addtogroup Exported_types
  85. * @{
  86. */
  87. typedef enum
  88. {
  89. RESET = 0U,
  90. SET = !RESET
  91. } FlagStatus, ITStatus;
  92. typedef enum
  93. {
  94. DISABLE = 0U,
  95. ENABLE = !DISABLE
  96. } FunctionalState;
  97. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
  98. typedef enum
  99. {
  100. ERROR = 0U,
  101. SUCCESS = !ERROR
  102. } ErrorStatus;
  103. /**
  104. * @}
  105. */
  106. /** @addtogroup Exported_macro
  107. * @{
  108. */
  109. #define SET_BIT(REG, BIT) ((REG) |= (BIT))
  110. #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
  111. #define READ_BIT(REG, BIT) ((REG) & (BIT))
  112. #define CLEAR_REG(REG) ((REG) = (0x0))
  113. #define WRITE_REG(REG, VAL) ((REG) = (VAL))
  114. #define READ_REG(REG) ((REG))
  115. #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
  116. #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
  117. /**
  118. * @}
  119. */
  120. #if defined (USE_HAL_DRIVER)
  121. #include "stm32f4xx_hal.h"
  122. #endif /* USE_HAL_DRIVER */
  123. #ifdef __cplusplus
  124. }
  125. #endif /* __cplusplus */
  126. #endif /* __STM32F4xx_H */
  127. /**
  128. * @}
  129. */
  130. /**
  131. * @}
  132. */
  133. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/