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:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_sdram.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of SDRAM HAL module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_SDRAM_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_SDRAM_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_ll_fmc.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup SDRAM
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported typedef ----------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58
mbed_official 573:ad23fe03a082 59 /** @defgroup SDRAM_Exported_Types SDRAM Exported Types
mbed_official 573:ad23fe03a082 60 * @{
mbed_official 573:ad23fe03a082 61 */
mbed_official 573:ad23fe03a082 62
mbed_official 573:ad23fe03a082 63 /**
mbed_official 573:ad23fe03a082 64 * @brief HAL SDRAM State structure definition
mbed_official 573:ad23fe03a082 65 */
mbed_official 573:ad23fe03a082 66 typedef enum
mbed_official 573:ad23fe03a082 67 {
mbed_official 573:ad23fe03a082 68 HAL_SDRAM_STATE_RESET = 0x00, /*!< SDRAM not yet initialized or disabled */
mbed_official 573:ad23fe03a082 69 HAL_SDRAM_STATE_READY = 0x01, /*!< SDRAM initialized and ready for use */
mbed_official 573:ad23fe03a082 70 HAL_SDRAM_STATE_BUSY = 0x02, /*!< SDRAM internal process is ongoing */
mbed_official 573:ad23fe03a082 71 HAL_SDRAM_STATE_ERROR = 0x03, /*!< SDRAM error state */
mbed_official 573:ad23fe03a082 72 HAL_SDRAM_STATE_WRITE_PROTECTED = 0x04, /*!< SDRAM device write protected */
mbed_official 573:ad23fe03a082 73 HAL_SDRAM_STATE_PRECHARGED = 0x05 /*!< SDRAM device precharged */
mbed_official 573:ad23fe03a082 74
mbed_official 573:ad23fe03a082 75 }HAL_SDRAM_StateTypeDef;
mbed_official 573:ad23fe03a082 76
mbed_official 573:ad23fe03a082 77 /**
mbed_official 573:ad23fe03a082 78 * @brief SDRAM handle Structure definition
mbed_official 573:ad23fe03a082 79 */
mbed_official 573:ad23fe03a082 80 typedef struct
mbed_official 573:ad23fe03a082 81 {
mbed_official 573:ad23fe03a082 82 FMC_SDRAM_TypeDef *Instance; /*!< Register base address */
mbed_official 573:ad23fe03a082 83
mbed_official 573:ad23fe03a082 84 FMC_SDRAM_InitTypeDef Init; /*!< SDRAM device configuration parameters */
mbed_official 573:ad23fe03a082 85
mbed_official 573:ad23fe03a082 86 __IO HAL_SDRAM_StateTypeDef State; /*!< SDRAM access state */
mbed_official 573:ad23fe03a082 87
mbed_official 573:ad23fe03a082 88 HAL_LockTypeDef Lock; /*!< SDRAM locking object */
mbed_official 573:ad23fe03a082 89
mbed_official 573:ad23fe03a082 90 DMA_HandleTypeDef *hdma; /*!< Pointer DMA handler */
mbed_official 573:ad23fe03a082 91
mbed_official 573:ad23fe03a082 92 }SDRAM_HandleTypeDef;
mbed_official 573:ad23fe03a082 93 /**
mbed_official 573:ad23fe03a082 94 * @}
mbed_official 573:ad23fe03a082 95 */
mbed_official 573:ad23fe03a082 96
mbed_official 573:ad23fe03a082 97 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 98 /* Exported macro ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 99
mbed_official 573:ad23fe03a082 100 /** @defgroup SDRAM_Exported_Macros SDRAM Exported Macros
mbed_official 573:ad23fe03a082 101 * @{
mbed_official 573:ad23fe03a082 102 */
mbed_official 573:ad23fe03a082 103
mbed_official 573:ad23fe03a082 104 /** @brief Reset SDRAM handle state
mbed_official 573:ad23fe03a082 105 * @param __HANDLE__: specifies the SDRAM handle.
mbed_official 573:ad23fe03a082 106 * @retval None
mbed_official 573:ad23fe03a082 107 */
mbed_official 573:ad23fe03a082 108 #define __HAL_SDRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SDRAM_STATE_RESET)
mbed_official 573:ad23fe03a082 109
mbed_official 573:ad23fe03a082 110 /**
mbed_official 573:ad23fe03a082 111 * @}
mbed_official 573:ad23fe03a082 112 */
mbed_official 573:ad23fe03a082 113
mbed_official 573:ad23fe03a082 114 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 115
mbed_official 573:ad23fe03a082 116 /** @addtogroup SDRAM_Exported_Functions SDRAM Exported Functions
mbed_official 573:ad23fe03a082 117 * @{
mbed_official 573:ad23fe03a082 118 */
mbed_official 573:ad23fe03a082 119
mbed_official 573:ad23fe03a082 120 /** @addtogroup SDRAM_Exported_Functions_Group1
mbed_official 573:ad23fe03a082 121 * @{
mbed_official 573:ad23fe03a082 122 */
mbed_official 573:ad23fe03a082 123
mbed_official 573:ad23fe03a082 124 /* Initialization/de-initialization functions *********************************/
mbed_official 573:ad23fe03a082 125 HAL_StatusTypeDef HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTypeDef *Timing);
mbed_official 573:ad23fe03a082 126 HAL_StatusTypeDef HAL_SDRAM_DeInit(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 127 void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 128 void HAL_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 129
mbed_official 573:ad23fe03a082 130 void HAL_SDRAM_IRQHandler(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 131 void HAL_SDRAM_RefreshErrorCallback(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 132 void HAL_SDRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma);
mbed_official 573:ad23fe03a082 133 void HAL_SDRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma);
mbed_official 573:ad23fe03a082 134
mbed_official 573:ad23fe03a082 135 /**
mbed_official 573:ad23fe03a082 136 * @}
mbed_official 573:ad23fe03a082 137 */
mbed_official 573:ad23fe03a082 138
mbed_official 573:ad23fe03a082 139 /** @addtogroup SDRAM_Exported_Functions_Group2
mbed_official 573:ad23fe03a082 140 * @{
mbed_official 573:ad23fe03a082 141 */
mbed_official 573:ad23fe03a082 142 /* I/O operation functions ****************************************************/
mbed_official 573:ad23fe03a082 143 HAL_StatusTypeDef HAL_SDRAM_Read_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 144 HAL_StatusTypeDef HAL_SDRAM_Write_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 145 HAL_StatusTypeDef HAL_SDRAM_Read_16b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 146 HAL_StatusTypeDef HAL_SDRAM_Write_16b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint16_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 147 HAL_StatusTypeDef HAL_SDRAM_Read_32b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 148 HAL_StatusTypeDef HAL_SDRAM_Write_32b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 149
mbed_official 573:ad23fe03a082 150 HAL_StatusTypeDef HAL_SDRAM_Read_DMA(SDRAM_HandleTypeDef *hsdram, uint32_t * pAddress, uint32_t *pDstBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 151 HAL_StatusTypeDef HAL_SDRAM_Write_DMA(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize);
mbed_official 573:ad23fe03a082 152
mbed_official 573:ad23fe03a082 153 /**
mbed_official 573:ad23fe03a082 154 * @}
mbed_official 573:ad23fe03a082 155 */
mbed_official 573:ad23fe03a082 156
mbed_official 573:ad23fe03a082 157 /** @addtogroup SDRAM_Exported_Functions_Group3
mbed_official 573:ad23fe03a082 158 * @{
mbed_official 573:ad23fe03a082 159 */
mbed_official 573:ad23fe03a082 160 /* SDRAM Control functions *****************************************************/
mbed_official 573:ad23fe03a082 161 HAL_StatusTypeDef HAL_SDRAM_WriteProtection_Enable(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 162 HAL_StatusTypeDef HAL_SDRAM_WriteProtection_Disable(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 163 HAL_StatusTypeDef HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout);
mbed_official 573:ad23fe03a082 164 HAL_StatusTypeDef HAL_SDRAM_ProgramRefreshRate(SDRAM_HandleTypeDef *hsdram, uint32_t RefreshRate);
mbed_official 573:ad23fe03a082 165 HAL_StatusTypeDef HAL_SDRAM_SetAutoRefreshNumber(SDRAM_HandleTypeDef *hsdram, uint32_t AutoRefreshNumber);
mbed_official 573:ad23fe03a082 166 uint32_t HAL_SDRAM_GetModeStatus(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 167
mbed_official 573:ad23fe03a082 168 /**
mbed_official 573:ad23fe03a082 169 * @}
mbed_official 573:ad23fe03a082 170 */
mbed_official 573:ad23fe03a082 171
mbed_official 573:ad23fe03a082 172 /** @addtogroup SDRAM_Exported_Functions_Group4
mbed_official 573:ad23fe03a082 173 * @{
mbed_official 573:ad23fe03a082 174 */
mbed_official 573:ad23fe03a082 175 /* SDRAM State functions ********************************************************/
mbed_official 573:ad23fe03a082 176 HAL_SDRAM_StateTypeDef HAL_SDRAM_GetState(SDRAM_HandleTypeDef *hsdram);
mbed_official 573:ad23fe03a082 177 /**
mbed_official 573:ad23fe03a082 178 * @}
mbed_official 573:ad23fe03a082 179 */
mbed_official 573:ad23fe03a082 180
mbed_official 573:ad23fe03a082 181 /**
mbed_official 573:ad23fe03a082 182 * @}
mbed_official 573:ad23fe03a082 183 */
mbed_official 573:ad23fe03a082 184
mbed_official 573:ad23fe03a082 185 /**
mbed_official 573:ad23fe03a082 186 * @}
mbed_official 573:ad23fe03a082 187 */
mbed_official 573:ad23fe03a082 188
mbed_official 573:ad23fe03a082 189 /**
mbed_official 573:ad23fe03a082 190 * @}
mbed_official 573:ad23fe03a082 191 */
mbed_official 573:ad23fe03a082 192
mbed_official 573:ad23fe03a082 193 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 194 }
mbed_official 573:ad23fe03a082 195 #endif
mbed_official 573:ad23fe03a082 196
mbed_official 573:ad23fe03a082 197 #endif /* __STM32F7xx_HAL_SDRAM_H */
mbed_official 573:ad23fe03a082 198
mbed_official 573:ad23fe03a082 199 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/