drv_sdram.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-03-18 luobeihai first version
  9. */
  10. #ifndef __DRV_SDRAM_H__
  11. #define __DRV_SDRAM_H__
  12. /* parameters for sdram peripheral */
  13. /* Bank1 or Bank2 */
  14. #define SDRAM_TARGET_BANK 1
  15. /* apm32f407 Bank Addr: 0x60000000 */
  16. #define SDRAM_BANK_ADDR ((uint32_t)0x60000000)
  17. /* data width: 8, 16, 32 */
  18. #define SDRAM_DATA_WIDTH 16
  19. /* column bit numbers */
  20. #define SDRAM_COLUMN_BITS DMC_COL_WIDTH_8
  21. /* row bit numbers */
  22. #define SDRAM_ROW_BITS DMC_ROW_WIDTH_11
  23. #define SDRAM_SIZE ((uint32_t)0x200000)
  24. /* memory mode register */
  25. #define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
  26. #define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
  27. #define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
  28. #define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
  29. #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
  30. #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
  31. #define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
  32. #define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
  33. #define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
  34. #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
  35. #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)
  36. #endif