STM32F439xx HAL User Manual
stm32f4xx_hal_sram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f4xx_hal_sram.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of SRAM HAL module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00010   *
00011   * Redistribution and use in source and binary forms, with or without modification,
00012   * are permitted provided that the following conditions are met:
00013   *   1. Redistributions of source code must retain the above copyright notice,
00014   *      this list of conditions and the following disclaimer.
00015   *   2. Redistributions in binary form must reproduce the above copyright notice,
00016   *      this list of conditions and the following disclaimer in the documentation
00017   *      and/or other materials provided with the distribution.
00018   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00019   *      may be used to endorse or promote products derived from this software
00020   *      without specific prior written permission.
00021   *
00022   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00023   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00025   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00026   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00028   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032   *
00033   ******************************************************************************
00034   */ 
00035 
00036 /* Define to prevent recursive inclusion -------------------------------------*/
00037 #ifndef __STM32F4xx_HAL_SRAM_H
00038 #define __STM32F4xx_HAL_SRAM_H
00039 
00040 #ifdef __cplusplus
00041  extern "C" {
00042 #endif
00043 
00044 /* Includes ------------------------------------------------------------------*/
00045 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F412Zx) ||\
00046     defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
00047   #include "stm32f4xx_ll_fsmc.h"
00048 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F413xx || STM32F423xx */
00049 
00050 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
00051  defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
00052   #include "stm32f4xx_ll_fmc.h"
00053 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */
00054 
00055 
00056 /** @addtogroup STM32F4xx_HAL_Driver
00057   * @{
00058   */
00059 
00060 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
00061     defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
00062     defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) ||\
00063     defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
00064 
00065 /** @addtogroup SRAM
00066   * @{
00067   */ 
00068 
00069 /* Exported typedef ----------------------------------------------------------*/
00070 
00071 /** @defgroup SRAM_Exported_Types SRAM Exported Types
00072   * @{
00073   */ 
00074 /** 
00075   * @brief  HAL SRAM State structures definition  
00076   */ 
00077 typedef enum
00078 {
00079   HAL_SRAM_STATE_RESET     = 0x00U,  /*!< SRAM not yet initialized or disabled           */
00080   HAL_SRAM_STATE_READY     = 0x01U,  /*!< SRAM initialized and ready for use             */
00081   HAL_SRAM_STATE_BUSY      = 0x02U,  /*!< SRAM internal process is ongoing               */
00082   HAL_SRAM_STATE_ERROR     = 0x03U,  /*!< SRAM error state                               */
00083   HAL_SRAM_STATE_PROTECTED = 0x04U   /*!< SRAM peripheral NORSRAM device write protected */
00084   
00085 }HAL_SRAM_StateTypeDef;
00086 
00087 /** 
00088   * @brief  SRAM handle Structure definition  
00089   */ 
00090 typedef struct
00091 {
00092   FMC_NORSRAM_TypeDef           *Instance;  /*!< Register base address                        */ 
00093   
00094   FMC_NORSRAM_EXTENDED_TypeDef  *Extended;  /*!< Extended mode register base address          */
00095   
00096   FMC_NORSRAM_InitTypeDef       Init;       /*!< SRAM device control configuration parameters */
00097 
00098   HAL_LockTypeDef               Lock;       /*!< SRAM locking object                          */ 
00099   
00100   __IO HAL_SRAM_StateTypeDef    State;      /*!< SRAM device access state                     */
00101   
00102   DMA_HandleTypeDef             *hdma;      /*!< Pointer DMA handler                          */
00103   
00104 }SRAM_HandleTypeDef; 
00105 
00106 /**
00107   * @}
00108   */
00109 
00110 /* Exported constants --------------------------------------------------------*/
00111 /* Exported macro ------------------------------------------------------------*/
00112 
00113 /** @defgroup SRAM_Exported_Macros SRAM Exported Macros
00114   * @{
00115   */
00116 /** @brief Reset SRAM handle state
00117   * @param  __HANDLE__ SRAM handle
00118   * @retval None
00119   */
00120 #define __HAL_SRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SRAM_STATE_RESET)
00121 
00122 /**
00123   * @}
00124   */
00125 /* Exported functions --------------------------------------------------------*/
00126 
00127 /** @addtogroup SRAM_Exported_Functions
00128  *  @{
00129  */
00130 
00131 /** @addtogroup SRAM_Exported_Functions_Group1
00132  *  @{
00133  */
00134 /* Initialization/de-initialization functions  **********************************/
00135 HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming);
00136 HAL_StatusTypeDef HAL_SRAM_DeInit(SRAM_HandleTypeDef *hsram);
00137 void              HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram);
00138 void              HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram);
00139 
00140 void              HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma);
00141 void              HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma);
00142 /**
00143   * @}
00144   */ 
00145 
00146 /** @addtogroup SRAM_Exported_Functions_Group2
00147  *  @{
00148  */
00149 /* I/O operation functions  *****************************************************/
00150 HAL_StatusTypeDef HAL_SRAM_Read_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize);
00151 HAL_StatusTypeDef HAL_SRAM_Write_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize);
00152 HAL_StatusTypeDef HAL_SRAM_Read_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize);
00153 HAL_StatusTypeDef HAL_SRAM_Write_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pSrcBuffer, uint32_t BufferSize);
00154 HAL_StatusTypeDef HAL_SRAM_Read_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
00155 HAL_StatusTypeDef HAL_SRAM_Write_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
00156 HAL_StatusTypeDef HAL_SRAM_Read_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
00157 HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
00158 /**
00159   * @}
00160   */ 
00161 
00162 /** @addtogroup SRAM_Exported_Functions_Group3
00163  *  @{
00164  */
00165 /* SRAM Control functions  ******************************************************/
00166 HAL_StatusTypeDef HAL_SRAM_WriteOperation_Enable(SRAM_HandleTypeDef *hsram);
00167 HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable(SRAM_HandleTypeDef *hsram);
00168 /**
00169   * @}
00170   */ 
00171 
00172 /** @addtogroup SRAM_Exported_Functions_Group4
00173  *  @{
00174  */
00175 /* SRAM State functions *********************************************************/
00176 HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram);
00177 /**
00178   * @}
00179   */
00180 
00181 /**
00182   * @}
00183   */
00184 
00185 /* Private types -------------------------------------------------------------*/
00186 /* Private variables ---------------------------------------------------------*/
00187 /* Private constants ---------------------------------------------------------*/
00188 /* Private macros ------------------------------------------------------------*/
00189 /* Private functions ---------------------------------------------------------*/
00190 /**
00191   * @}
00192   */ 
00193 
00194 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
00195           STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F412Zx ||\
00196           STM32F412Vx || STM32F412Rx || STM32F413xx || STM32F423xx */
00197 /**
00198   * @}
00199   */
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203 
00204 #endif /* __STM32F4xx_HAL_SRAM_H */
00205 
00206 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/