stm32f769i_discovery_sdram.h
Go to the documentation of this file.
1 
37 /* Define to prevent recursive inclusion -------------------------------------*/
38 #ifndef __STM32F769I_DISCOVERY_SDRAM_H
39 #define __STM32F769I_DISCOVERY_SDRAM_H
40 
41 #ifdef __cplusplus
42  extern "C" {
43 #endif
44 
45 /* Includes ------------------------------------------------------------------*/
46 #include "stm32f7xx_hal.h"
47 
67 #define SDRAM_OK ((uint8_t)0x00)
68 #define SDRAM_ERROR ((uint8_t)0x01)
69 
74 #define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)
75 #define SDRAM_DEVICE_SIZE ((uint32_t)0x1000000) /* SDRAM device size in MBytes */
76 
77 /* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_8 */
78 /* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16 */
79 #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
80 
81 #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
82 /* #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_3 */
83 
84 #define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
85 
86 #define SDRAM_TIMEOUT ((uint32_t)0xFFFF)
87 
88 /* DMA definitions for SDRAM DMA transfer */
89 #define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
90 #define __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
91 #define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0
92 #define SDRAM_DMAx_STREAM DMA2_Stream0
93 #define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn
94 #define BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler
95 
102 #define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
103 #define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
104 #define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
105 #define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
106 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
107 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
108 #define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
109 #define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
110 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
111 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
112 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)
113 
127 uint8_t BSP_SDRAM_Init(void);
128 uint8_t BSP_SDRAM_DeInit(void);
129 void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
130 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
131 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
132 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
133 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
135 
136 /* These functions can be modified in case the current settings (e.g. DMA stream)
137  need to be changed for specific application needs */
138 void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram, void *Params);
139 void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram, void *Params);
140 
141 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* __STM32F769I_DISCOVERY_SDRAM_H */
163 
164 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
BSP_SDRAM_WriteData_DMA
uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in DMA mode.
Definition: stm32f769i_discovery_sdram.c:339
BSP_SDRAM_MspDeInit
void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram, void *Params)
DeInitializes SDRAM MSP.
Definition: stm32f769i_discovery_sdram.c:472
BSP_SDRAM_ReadData
uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in polling mode.
Definition: stm32f769i_discovery_sdram.c:282
BSP_SDRAM_ReadData_DMA
uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in DMA mode.
Definition: stm32f769i_discovery_sdram.c:301
BSP_SDRAM_Sendcmd
uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
Sends command to the SDRAM bank.
Definition: stm32f769i_discovery_sdram.c:356
BSP_SDRAM_Initialization_sequence
void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
Programs the SDRAM device.
Definition: stm32f769i_discovery_sdram.c:220
BSP_SDRAM_WriteData
uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in polling mode.
Definition: stm32f769i_discovery_sdram.c:320
BSP_SDRAM_MspInit
void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
Definition: stm32f769i_discovery_sdram.c:374
FMC_SDRAM_CommandTypeDef
SDRAM command parameters structure definition.
Definition: stm32f7xx_ll_fmc.h:635
BSP_SDRAM_DeInit
uint8_t BSP_SDRAM_DeInit(void)
DeInitializes the SDRAM device.
Definition: stm32f769i_discovery_sdram.c:194
BSP_SDRAM_Init
uint8_t BSP_SDRAM_Init(void)
Initializes the SDRAM device.
Definition: stm32f769i_discovery_sdram.c:145
SDRAM_HandleTypeDef
SDRAM handle Structure definition.
Definition: stm32f7xx_hal_sdram.h:65
stm32f7xx_hal.h
This file contains all the functions prototypes for the HAL module driver.


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53