fc10ef2e10
GD32F470ZGT6 based project with full peripheral support: - SDRAM (W9825G6KH) via EXMC - LCD NT35510 (480x800) via EXMC NOR/PSRAM - Flash (W25Q64) via SPI - UART (USART0) debug console - LED indicators - CMSIS-DAP debug interface - CMake + ARM GCC toolchain build system
42 lines
827 B
C++
42 lines
827 B
C++
#ifndef __EXMC_DRIVER_H__
|
|
#define __EXMC_DRIVER_H__
|
|
|
|
#include <cstdint>
|
|
#include "bus_core.h"
|
|
#include "gd32f4xx.h"
|
|
|
|
#define EXMC_REGION_0 EXMC_BANK0_NORSRAM_REGION0
|
|
#define EXMC_REGION_1 EXMC_BANK0_NORSRAM_REGION1
|
|
#define EXMC_REGION_2 EXMC_BANK0_NORSRAM_REGION2
|
|
#define EXMC_REGION_3 EXMC_BANK0_NORSRAM_REGION3
|
|
|
|
#define EXMC_SDRAM_DEV_0 EXMC_SDRAM_DEVICE0
|
|
#define EXMC_SDRAM_DEV_1 EXMC_SDRAM_DEVICE1
|
|
|
|
enum class ExmcPort : uint8_t {
|
|
_0 = 0,
|
|
MAX
|
|
};
|
|
|
|
class ExmcBus {
|
|
public:
|
|
static ExmcBus &instance();
|
|
|
|
ExmcBus(const ExmcBus &) = delete;
|
|
ExmcBus &operator=(const ExmcBus &) = delete;
|
|
|
|
RetCode init();
|
|
RetCode deinit();
|
|
|
|
static RetCode sdram_pin_init();
|
|
static RetCode norsram_lcd_pin_init();
|
|
|
|
private:
|
|
ExmcBus();
|
|
~ExmcBus();
|
|
|
|
bool initialized_ = false;
|
|
};
|
|
|
|
#endif
|