stm32f4xx_flash_ramfunc.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_flash_ramfunc.h
  4. * @author MCD Application Team
  5. * @version V1.8.1
  6. * @date 27-January-2022
  7. * @brief Header file of FLASH RAMFUNC driver.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * Copyright (c) 2016 STMicroelectronics.
  12. * All rights reserved.
  13. *
  14. * This software is licensed under terms that can be found in the LICENSE file
  15. * in the root directory of this software component.
  16. * If no LICENSE file comes with this software, it is provided AS-IS.
  17. *
  18. ******************************************************************************
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __STM32F4xx_FLASH_RAMFUNC_H
  22. #define __STM32F4xx_FLASH_RAMFUNC_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32f4xx.h"
  28. /** @addtogroup STM32F4xx_StdPeriph_Driver
  29. * @{
  30. */
  31. /** @addtogroup FLASH RAMFUNC
  32. * @{
  33. */
  34. /* Exported types ------------------------------------------------------------*/
  35. /* Private define ------------------------------------------------------------*/
  36. /**
  37. * @brief __RAM_FUNC definition
  38. */
  39. #if defined ( __CC_ARM )
  40. /* ARM Compiler
  41. ------------
  42. RAM functions are defined using the toolchain options.
  43. Functions that are executed in RAM should reside in a separate source module.
  44. Using the 'Options for File' dialog you can simply change the 'Code / Const'
  45. area of a module to a memory space in physical RAM.
  46. Available memory areas are declared in the 'Target' tab of the 'Options for Target'
  47. dialog.
  48. */
  49. #define __RAM_FUNC void
  50. #elif defined ( __ICCARM__ )
  51. /* ICCARM Compiler
  52. ---------------
  53. RAM functions are defined using a specific toolchain keyword "__ramfunc".
  54. */
  55. #define __RAM_FUNC __ramfunc void
  56. #elif defined ( __GNUC__ )
  57. /* GNU Compiler
  58. ------------
  59. RAM functions are defined using a specific toolchain attribute
  60. "__attribute__((section(".RamFunc")))".
  61. */
  62. #define __RAM_FUNC void __attribute__((section(".RamFunc")))
  63. #endif
  64. /* Exported constants --------------------------------------------------------*/
  65. /* Exported macro ------------------------------------------------------------*/
  66. /* Exported functions --------------------------------------------------------*/
  67. __RAM_FUNC FLASH_FlashInterfaceCmd(FunctionalState NewState);
  68. __RAM_FUNC FLASH_FlashSleepModeCmd(FunctionalState NewState);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* __STM32F4xx_FLASH_RAMFUNC_H */
  73. /**
  74. * @}
  75. */
  76. /**
  77. * @}
  78. */