Subversion Repositories DashDisplay

Rev

Rev 61 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /**
  2.   ******************************************************************************
  3.   * @file    stm32l1xx_hal_sram.h
  4.   * @author  MCD Application Team
  5.   * @brief   Header file of SRAM HAL module.
  6.   ******************************************************************************
  7.   * @attention
  8.   *
  9.   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10.   * All rights reserved.</center></h2>
  11.   *
  12.   * This software component is licensed by ST under BSD 3-Clause license,
  13.   * the "License"; You may not use this file except in compliance with the
  14.   * License. You may obtain a copy of the License at:
  15.   *                        opensource.org/licenses/BSD-3-Clause
  16.   *
  17.   ******************************************************************************
  18.   */
  19.  
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __STM32L1xx_HAL_SRAM_H
  22. #define __STM32L1xx_HAL_SRAM_H
  23.  
  24. #ifdef __cplusplus
  25.  extern "C" {
  26. #endif
  27.  
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32l1xx_ll_fsmc.h"
  30.  
  31. /** @addtogroup STM32L1xx_HAL_Driver
  32.   * @{
  33.   */
  34.  
  35. #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD)
  36.  
  37. /** @addtogroup SRAM
  38.   * @{
  39.   */
  40.  
  41. /* Exported typedef ----------------------------------------------------------*/
  42.  
  43. /** @defgroup SRAM_Exported_Types SRAM Exported Types
  44.   * @{
  45.   */
  46. /**
  47.   * @brief  HAL SRAM State structures definition  
  48.   */
  49. typedef enum
  50. {
  51.   HAL_SRAM_STATE_RESET     = 0x00,  /*!< SRAM not yet initialized or disabled           */
  52.   HAL_SRAM_STATE_READY     = 0x01,  /*!< SRAM initialized and ready for use             */
  53.   HAL_SRAM_STATE_BUSY      = 0x02,  /*!< SRAM internal process is ongoing               */
  54.   HAL_SRAM_STATE_ERROR     = 0x03,  /*!< SRAM error state                               */
  55.   HAL_SRAM_STATE_PROTECTED = 0x04   /*!< SRAM peripheral NORSRAM device write protected */
  56.  
  57. }HAL_SRAM_StateTypeDef;
  58.  
  59. /**
  60.   * @brief  SRAM handle Structure definition  
  61.   */
  62. typedef struct
  63. {
  64.   FSMC_NORSRAM_TypeDef           *Instance;  /*!< Register base address                        */
  65.  
  66.   FSMC_NORSRAM_EXTENDED_TypeDef  *Extended;  /*!< Extended mode register base address          */
  67.  
  68.   FSMC_NORSRAM_InitTypeDef       Init;       /*!< SRAM device control configuration parameters */
  69.  
  70.   HAL_LockTypeDef               Lock;       /*!< SRAM locking object                          */
  71.  
  72.   __IO HAL_SRAM_StateTypeDef    State;      /*!< SRAM device access state                     */
  73.  
  74.   DMA_HandleTypeDef             *hdma;      /*!< Pointer DMA handler                          */
  75.  
  76. }SRAM_HandleTypeDef;
  77.  
  78. /**
  79.   * @}
  80.   */
  81.  
  82. /* Exported constants --------------------------------------------------------*/
  83. /* Exported macro ------------------------------------------------------------*/
  84.  
  85. /** @defgroup SRAM_Exported_Macros SRAM Exported Macros
  86.   * @{
  87.   */
  88.  
  89. /** @brief Reset SRAM handle state
  90.   * @param  __HANDLE__ SRAM handle
  91.   * @retval None
  92.   */
  93. #define __HAL_SRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SRAM_STATE_RESET)
  94.  
  95. /**
  96.   * @}
  97.   */
  98.  
  99. /* Exported functions --------------------------------------------------------*/
  100.  
  101. /** @addtogroup SRAM_Exported_Functions
  102.  *  @{
  103.  */
  104.  
  105. /** @addtogroup SRAM_Exported_Functions_Group1
  106.  *  @{
  107.  */
  108.  
  109. /* Initialization/de-initialization functions  **********************************/
  110. HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FSMC_NORSRAM_TimingTypeDef *Timing, FSMC_NORSRAM_TimingTypeDef *ExtTiming);
  111. HAL_StatusTypeDef HAL_SRAM_DeInit(SRAM_HandleTypeDef *hsram);
  112. void              HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram);
  113. void              HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram);
  114.  
  115. void              HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma);
  116. void              HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma);
  117.  
  118. /**
  119.   * @}
  120.   */
  121.  
  122. /** @addtogroup SRAM_Exported_Functions_Group2
  123.  *  @{
  124.  */
  125.  
  126. /* I/O operation functions  *****************************************************/
  127. HAL_StatusTypeDef HAL_SRAM_Read_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize);
  128. HAL_StatusTypeDef HAL_SRAM_Write_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize);
  129. HAL_StatusTypeDef HAL_SRAM_Read_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize);
  130. HAL_StatusTypeDef HAL_SRAM_Write_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pSrcBuffer, uint32_t BufferSize);
  131. HAL_StatusTypeDef HAL_SRAM_Read_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
  132. HAL_StatusTypeDef HAL_SRAM_Write_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
  133. HAL_StatusTypeDef HAL_SRAM_Read_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
  134. HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
  135.  
  136. /**
  137.   * @}
  138.   */
  139.  
  140. /** @addtogroup SRAM_Exported_Functions_Group3
  141.  *  @{
  142.  */
  143.  
  144. /* SRAM Control functions  ******************************************************/
  145. HAL_StatusTypeDef HAL_SRAM_WriteOperation_Enable(SRAM_HandleTypeDef *hsram);
  146. HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable(SRAM_HandleTypeDef *hsram);
  147.  
  148. /**
  149.   * @}
  150.   */
  151.  
  152. /** @addtogroup SRAM_Exported_Functions_Group4
  153.  *  @{
  154.  */
  155.  
  156. /* SRAM State functions *********************************************************/
  157. HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram);
  158.  
  159. /**
  160.   * @}
  161.   */
  162.  
  163. /**
  164.   * @}
  165.   */
  166.  
  167. /**
  168.   * @}
  169.   */
  170.  
  171. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  172.  
  173. /**
  174.   * @}
  175.   */
  176.  
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180.  
  181. #endif /* __STM32L1xx_HAL_SRAM_H */
  182.  
  183. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  184.