mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Sep 28 14:00:11 2015 +0100
Revision:
632:7687fb9c4f91
Parent:
385:be64abf45658
Child:
634:ac7d6880524d
Synchronized with git revision f7ce4ed029cc611121464252ff28d5e8beb895b0

Full URL: https://github.com/mbedmicro/mbed/commit/f7ce4ed029cc611121464252ff28d5e8beb895b0/

NUCLEO_F303K8 - add support of the STM32F303K8

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 375:3d36234a1087 1 /**
mbed_official 375:3d36234a1087 2 ******************************************************************************
mbed_official 375:3d36234a1087 3 * @file stm32f3xx_hal_sram.h
mbed_official 375:3d36234a1087 4 * @author MCD Application Team
mbed_official 632:7687fb9c4f91 5 * @version V1.1.1
mbed_official 632:7687fb9c4f91 6 * @date 19-June-2015
mbed_official 375:3d36234a1087 7 * @brief Header file of SRAM HAL module.
mbed_official 375:3d36234a1087 8 ******************************************************************************
mbed_official 375:3d36234a1087 9 * @attention
mbed_official 375:3d36234a1087 10 *
mbed_official 632:7687fb9c4f91 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 375:3d36234a1087 12 *
mbed_official 375:3d36234a1087 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 375:3d36234a1087 14 * are permitted provided that the following conditions are met:
mbed_official 375:3d36234a1087 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 375:3d36234a1087 16 * this list of conditions and the following disclaimer.
mbed_official 375:3d36234a1087 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 375:3d36234a1087 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 375:3d36234a1087 19 * and/or other materials provided with the distribution.
mbed_official 375:3d36234a1087 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 375:3d36234a1087 21 * may be used to endorse or promote products derived from this software
mbed_official 375:3d36234a1087 22 * without specific prior written permission.
mbed_official 375:3d36234a1087 23 *
mbed_official 375:3d36234a1087 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 375:3d36234a1087 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 375:3d36234a1087 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 375:3d36234a1087 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 375:3d36234a1087 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 375:3d36234a1087 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 375:3d36234a1087 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 375:3d36234a1087 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 375:3d36234a1087 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 375:3d36234a1087 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 375:3d36234a1087 34 *
mbed_official 375:3d36234a1087 35 ******************************************************************************
mbed_official 375:3d36234a1087 36 */
mbed_official 375:3d36234a1087 37
mbed_official 375:3d36234a1087 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 375:3d36234a1087 39 #ifndef __STM32F3xx_HAL_SRAM_H
mbed_official 375:3d36234a1087 40 #define __STM32F3xx_HAL_SRAM_H
mbed_official 375:3d36234a1087 41
mbed_official 375:3d36234a1087 42 #ifdef __cplusplus
mbed_official 375:3d36234a1087 43 extern "C" {
mbed_official 375:3d36234a1087 44 #endif
mbed_official 375:3d36234a1087 45
mbed_official 375:3d36234a1087 46 /* Includes ------------------------------------------------------------------*/
mbed_official 375:3d36234a1087 47 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
mbed_official 375:3d36234a1087 48 #include "stm32f3xx_ll_fmc.h"
mbed_official 375:3d36234a1087 49 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
mbed_official 375:3d36234a1087 50
mbed_official 375:3d36234a1087 51
mbed_official 375:3d36234a1087 52 /** @addtogroup STM32F3xx_HAL_Driver
mbed_official 375:3d36234a1087 53 * @{
mbed_official 375:3d36234a1087 54 */
mbed_official 375:3d36234a1087 55
mbed_official 375:3d36234a1087 56 /** @addtogroup SRAM
mbed_official 375:3d36234a1087 57 * @{
mbed_official 375:3d36234a1087 58 */
mbed_official 375:3d36234a1087 59
mbed_official 375:3d36234a1087 60 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
mbed_official 375:3d36234a1087 61
mbed_official 375:3d36234a1087 62 /* Exported typedef ----------------------------------------------------------*/
mbed_official 375:3d36234a1087 63
mbed_official 375:3d36234a1087 64 /** @defgroup SRAM_Exported_Types SRAM Exported Types
mbed_official 375:3d36234a1087 65 * @{
mbed_official 375:3d36234a1087 66 */
mbed_official 375:3d36234a1087 67 /**
mbed_official 375:3d36234a1087 68 * @brief HAL SRAM State structures definition
mbed_official 375:3d36234a1087 69 */
mbed_official 375:3d36234a1087 70 typedef enum
mbed_official 375:3d36234a1087 71 {
mbed_official 375:3d36234a1087 72 HAL_SRAM_STATE_RESET = 0x00, /*!< SRAM not yet initialized or disabled */
mbed_official 375:3d36234a1087 73 HAL_SRAM_STATE_READY = 0x01, /*!< SRAM initialized and ready for use */
mbed_official 375:3d36234a1087 74 HAL_SRAM_STATE_BUSY = 0x02, /*!< SRAM internal process is ongoing */
mbed_official 375:3d36234a1087 75 HAL_SRAM_STATE_ERROR = 0x03, /*!< SRAM error state */
mbed_official 375:3d36234a1087 76 HAL_SRAM_STATE_PROTECTED = 0x04 /*!< SRAM peripheral NORSRAM device write protected */
mbed_official 375:3d36234a1087 77
mbed_official 375:3d36234a1087 78 }HAL_SRAM_StateTypeDef;
mbed_official 375:3d36234a1087 79
mbed_official 375:3d36234a1087 80 /**
mbed_official 375:3d36234a1087 81 * @brief SRAM handle Structure definition
mbed_official 375:3d36234a1087 82 */
mbed_official 375:3d36234a1087 83 typedef struct
mbed_official 375:3d36234a1087 84 {
mbed_official 375:3d36234a1087 85 FMC_NORSRAM_TypeDef *Instance; /*!< Register base address */
mbed_official 375:3d36234a1087 86
mbed_official 375:3d36234a1087 87 FMC_NORSRAM_EXTENDED_TypeDef *Extended; /*!< Extended mode register base address */
mbed_official 375:3d36234a1087 88
mbed_official 375:3d36234a1087 89 FMC_NORSRAM_InitTypeDef Init; /*!< SRAM device control configuration parameters */
mbed_official 375:3d36234a1087 90
mbed_official 375:3d36234a1087 91 HAL_LockTypeDef Lock; /*!< SRAM locking object */
mbed_official 375:3d36234a1087 92
mbed_official 375:3d36234a1087 93 __IO HAL_SRAM_StateTypeDef State; /*!< SRAM device access state */
mbed_official 375:3d36234a1087 94
mbed_official 375:3d36234a1087 95 DMA_HandleTypeDef *hdma; /*!< Pointer DMA handler */
mbed_official 375:3d36234a1087 96
mbed_official 375:3d36234a1087 97 }SRAM_HandleTypeDef;
mbed_official 375:3d36234a1087 98
mbed_official 375:3d36234a1087 99 /**
mbed_official 375:3d36234a1087 100 * @}
mbed_official 375:3d36234a1087 101 */
mbed_official 375:3d36234a1087 102
mbed_official 375:3d36234a1087 103 /* Exported constants --------------------------------------------------------*/
mbed_official 375:3d36234a1087 104 /* Exported macro ------------------------------------------------------------*/
mbed_official 375:3d36234a1087 105
mbed_official 375:3d36234a1087 106 /** @defgroup SRAM_Exported_Macros SRAM Exported Macros
mbed_official 375:3d36234a1087 107 * @{
mbed_official 375:3d36234a1087 108 */
mbed_official 375:3d36234a1087 109
mbed_official 375:3d36234a1087 110 /** @brief Reset SRAM handle state
mbed_official 375:3d36234a1087 111 * @param __HANDLE__: SRAM handle
mbed_official 375:3d36234a1087 112 * @retval None
mbed_official 375:3d36234a1087 113 */
mbed_official 375:3d36234a1087 114 #define __HAL_SRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SRAM_STATE_RESET)
mbed_official 375:3d36234a1087 115
mbed_official 375:3d36234a1087 116 /**
mbed_official 375:3d36234a1087 117 * @}
mbed_official 375:3d36234a1087 118 */
mbed_official 375:3d36234a1087 119
mbed_official 375:3d36234a1087 120 /* Exported functions --------------------------------------------------------*/
mbed_official 375:3d36234a1087 121 /** @addtogroup SRAM_Exported_Functions SRAM Exported Functions
mbed_official 375:3d36234a1087 122 * @{
mbed_official 375:3d36234a1087 123 */
mbed_official 375:3d36234a1087 124
mbed_official 375:3d36234a1087 125 /** @addtogroup SRAM_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 375:3d36234a1087 126 * @{
mbed_official 375:3d36234a1087 127 */
mbed_official 375:3d36234a1087 128
mbed_official 375:3d36234a1087 129 /* Initialization/de-initialization functions ********************************/
mbed_official 375:3d36234a1087 130 HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming);
mbed_official 375:3d36234a1087 131 HAL_StatusTypeDef HAL_SRAM_DeInit(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 132 void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 133 void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 134
mbed_official 375:3d36234a1087 135 void HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma);
mbed_official 375:3d36234a1087 136 void HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma);
mbed_official 375:3d36234a1087 137
mbed_official 375:3d36234a1087 138 /**
mbed_official 375:3d36234a1087 139 * @}
mbed_official 375:3d36234a1087 140 */
mbed_official 375:3d36234a1087 141
mbed_official 375:3d36234a1087 142 /** @addtogroup SRAM_Exported_Functions_Group2 Input Output and memory control functions
mbed_official 375:3d36234a1087 143 * @{
mbed_official 375:3d36234a1087 144 */
mbed_official 375:3d36234a1087 145
mbed_official 375:3d36234a1087 146 /* I/O operation functions ***************************************************/
mbed_official 375:3d36234a1087 147 HAL_StatusTypeDef HAL_SRAM_Read_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 148 HAL_StatusTypeDef HAL_SRAM_Write_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 149 HAL_StatusTypeDef HAL_SRAM_Read_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 150 HAL_StatusTypeDef HAL_SRAM_Write_16b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 151 HAL_StatusTypeDef HAL_SRAM_Read_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 152 HAL_StatusTypeDef HAL_SRAM_Write_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 153 HAL_StatusTypeDef HAL_SRAM_Read_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 154 HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 375:3d36234a1087 155
mbed_official 375:3d36234a1087 156 /**
mbed_official 375:3d36234a1087 157 * @}
mbed_official 375:3d36234a1087 158 */
mbed_official 375:3d36234a1087 159
mbed_official 375:3d36234a1087 160 /** @addtogroup SRAM_Exported_Functions_Group3 Control functions
mbed_official 375:3d36234a1087 161 * @{
mbed_official 375:3d36234a1087 162 */
mbed_official 375:3d36234a1087 163
mbed_official 375:3d36234a1087 164 /* SRAM Control functions ****************************************************/
mbed_official 375:3d36234a1087 165 HAL_StatusTypeDef HAL_SRAM_WriteOperation_Enable(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 166 HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 167
mbed_official 375:3d36234a1087 168 /**
mbed_official 375:3d36234a1087 169 * @}
mbed_official 375:3d36234a1087 170 */
mbed_official 375:3d36234a1087 171
mbed_official 375:3d36234a1087 172 /** @addtogroup SRAM_Exported_Functions_Group4 Peripheral State functions
mbed_official 375:3d36234a1087 173 * @{
mbed_official 375:3d36234a1087 174 */
mbed_official 375:3d36234a1087 175
mbed_official 375:3d36234a1087 176 /* SRAM Peripheral State functions ********************************************/
mbed_official 375:3d36234a1087 177 HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram);
mbed_official 375:3d36234a1087 178
mbed_official 375:3d36234a1087 179 /**
mbed_official 375:3d36234a1087 180 * @}
mbed_official 375:3d36234a1087 181 */
mbed_official 375:3d36234a1087 182
mbed_official 375:3d36234a1087 183 /**
mbed_official 375:3d36234a1087 184 * @}
mbed_official 375:3d36234a1087 185 */
mbed_official 375:3d36234a1087 186
mbed_official 375:3d36234a1087 187 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
mbed_official 375:3d36234a1087 188 /**
mbed_official 375:3d36234a1087 189 * @}
mbed_official 375:3d36234a1087 190 */
mbed_official 375:3d36234a1087 191
mbed_official 375:3d36234a1087 192 /**
mbed_official 375:3d36234a1087 193 * @}
mbed_official 375:3d36234a1087 194 */
mbed_official 375:3d36234a1087 195
mbed_official 375:3d36234a1087 196 #ifdef __cplusplus
mbed_official 375:3d36234a1087 197 }
mbed_official 375:3d36234a1087 198 #endif
mbed_official 375:3d36234a1087 199
mbed_official 375:3d36234a1087 200 #endif /* __STM32F3xx_HAL_SRAM_H */
mbed_official 375:3d36234a1087 201
mbed_official 375:3d36234a1087 202 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/