ST / BSP_DISCO_L4R9I

Dependents:   DISCO_L4R9I-LCD-demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l4r9i_discovery_psram.h Source File

stm32l4r9i_discovery_psram.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4r9i_discovery_psram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l4r9i_discovery_psram.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020 
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L4R9I_DISCOVERY_PSRAM_H
00023 #define __STM32L4R9I_DISCOVERY_PSRAM_H
00024 
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028 
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l4xx_hal.h"
00031 
00032 /** @addtogroup BSP
00033   * @{
00034   */
00035 
00036 /** @addtogroup STM32L4R9I_DISCOVERY
00037   * @{
00038   */
00039 
00040 /** @addtogroup STM32L4R9I_DISCOVERY_PSRAM
00041   * @{
00042   */
00043 
00044 /** @defgroup STM32L4R9I_DISCOVERY_PSRAM_Exported_Types Exported Constants
00045   * @{
00046   */
00047 
00048 /**
00049   * @brief  PSRAM status structure definition
00050   */
00051 #define   PSRAM_OK         ((uint8_t)0x00)
00052 #define   PSRAM_ERROR      ((uint8_t)0x01)
00053 
00054 #define PSRAM_DEVICE_ADDR  ((uint32_t)0x60000000)
00055 #define PSRAM_DEVICE_SIZE  ((uint32_t)0x400000)  /* PSRAM device size in Bytes */
00056 
00057 /* #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8*/
00058 #define PSRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00059 
00060 #define PSRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_DISABLE
00061 /* #define PSRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_ENABLE*/
00062 
00063 #define PSRAM_WRITEBURST      FMC_WRITE_BURST_DISABLE
00064 /* #define PSRAM_WRITEBURST     FMC_WRITE_BURST_ENABLE */
00065 
00066 #define CONTINUOUSCLOCK_FEATURE    FMC_CONTINUOUS_CLOCK_SYNC_ONLY
00067 /* #define CONTINUOUSCLOCK_FEATURE     FMC_CONTINUOUS_CLOCK_SYNC_ASYNC */
00068 
00069 /* DMA definitions for SRAM DMA transfer */
00070 #define __PSRAM_DMAx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00071 #define __PSRAM_DMAx_CLK_DISABLE           __HAL_RCC_DMA2_CLK_DISABLE
00072 #define PSRAM_DMAx_INSTANCE                DMA2_Channel3
00073 #define PSRAM_DMAx_IRQn                    DMA2_Channel3_IRQn
00074 #define BSP_PSRAM_DMA_IRQHandler           DMA2_Channel3_IRQHandler
00075 
00076 
00077 /** @defgroup STM32L4R9I_DISCOVERY_PSRAM_Exported_Variables Exported Variables
00078   * @{
00079   */
00080 extern SRAM_HandleTypeDef psramHandle;
00081 
00082 /**
00083   * @}
00084   */
00085 
00086 /** @defgroup STM32L4R9I_DISCOVERY_PSRAM_Exported_Functions Exported Functions
00087   * @{
00088   */
00089 uint8_t BSP_PSRAM_Init(void);
00090 uint8_t BSP_PSRAM_DeInit(void);
00091 uint8_t BSP_PSRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00092 uint8_t BSP_PSRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00093 uint8_t BSP_PSRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00094 uint8_t BSP_PSRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00095 
00096 /* These __weak functions can be surcharged by application code in case the current settings
00097    (eg. interrupt priority) need to be changed for specific application needs */
00098 void BSP_PSRAM_MspInit(SRAM_HandleTypeDef *hsram, void *Params);
00099 void BSP_PSRAM_MspDeInit(SRAM_HandleTypeDef *hsram, void *Params);
00100 
00101 /**
00102   * @}
00103   */
00104 
00105 /**
00106   * @}
00107   */
00108 
00109 /**
00110   * @}
00111   */
00112 
00113 /**
00114   * @}
00115   */
00116 
00117 /**
00118   * @}
00119   */
00120 
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124 
00125 #endif /* __STM32L4R9I_DISCOVERY_PSRAM_H */
00126 
00127 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/