You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.9 KiB
58 lines
1.9 KiB
2 years ago
|
#ifndef __BSP_SDRAM_H
|
||
|
#define __BSP_SDRAM_H
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
#include "fmc.h"
|
||
|
|
||
|
|
||
|
// extern uint32_t SDRAM_BANK_ADDR;
|
||
|
// extern void SDRAM_WriteBuffer(uint32_t *pBuffer, uint32_t uwWriteAddress, uint32_t uwBufferSize);
|
||
|
// extern void SDRAM_ReadBuffer(uint32_t *pBuffer, uint32_t uwReadAddress, uint32_t uwBufferSize);
|
||
|
// extern uint8_t SDRAM_Test( uint32_t count);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#define Bank4_SDRAM_ADDR ((uint32_t)(0XD0000000))
|
||
|
#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)
|
||
|
|
||
|
#define FMC_BANK_SDRAM FMC_Bank2_SDRAM
|
||
|
#define FMC_COMMAND_TARGET_BANK FMC_SDRAM_CMD_TARGET_BANK2
|
||
|
|
||
|
|
||
|
#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
|
||
|
#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
|
||
|
#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
|
||
|
#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
|
||
|
#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
|
||
|
#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
|
||
|
#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
|
||
|
#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
|
||
|
#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
|
||
|
#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
|
||
|
#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)
|
||
|
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
void (*init)(void);
|
||
|
uint8_t (*test)( uint32_t );
|
||
|
}MY_SDRAM_TypeDef;
|
||
|
extern MY_SDRAM_TypeDef my_sdram;
|
||
|
|
||
|
|
||
|
void SDRAM_Init(void);
|
||
|
//void SDRAM_MPU_Config(void);
|
||
|
uint8_t SDRAM_Send_Cmd(uint8_t bankx,uint8_t cmd,uint8_t refresh,uint16_t regval);
|
||
|
void FMC_SDRAM_WriteBuffer(uint8_t *pBuffer,uint32_t WriteAddr,uint32_t n);
|
||
|
void FMC_SDRAM_ReadBuffer(uint8_t *pBuffer,uint32_t ReadAddr,uint32_t n);
|
||
|
void SDRAM_Initialization_Sequence(SDRAM_HandleTypeDef *hsdram);
|
||
|
uint8_t SDRAM_Test(uint32_t count);
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
#endif
|