39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define DRAM_CMD_READ 0x03
75#define DRAM_CMD_FAST_READ 0x0B
76#define DRAM_CMD_WRITE 0x02
77#define DRAM_CMD_RESET_ENABLE 0x66
78#define DRAM_CMD_RESET 0x99
79#define DRAM_CMD_WRAP_BOUNDARY_TOGGLE 0xC0
80#define DRAM_CMD_READ_ID 0x9F
98#define DRAM_MIN_ADDRESS 0x000000
99#define DRAM_MAX_ADDRESS 0x7FFFFFul
105#define DRAM_MANUFACTURER_ID 0x0D
115#define DRAM_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
116#define DRAM_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
134#define DRAM_MAP_MIKROBUS( cfg, mikrobus ) \
135 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
136 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
137 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
138 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
139 cfg.io3 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
140 cfg.io2 = MIKROBUS( mikrobus, MIKROBUS_PWM );
dram_return_value_t
DRAM Click return value data.
Definition dram.h:190
@ DRAM_ERROR
Definition dram.h:192
@ DRAM_OK
Definition dram.h:191
void dram_set_io3_pin(dram_t *ctx, uint8_t state)
DRAM set io3 pin function.
err_t dram_memory_write(dram_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len)
DRAM memory write function.
err_t dram_reset(dram_t *ctx)
DRAM reset function.
void dram_set_io2_pin(dram_t *ctx, uint8_t state)
DRAM set io2 pin function.
err_t dram_read_id(dram_t *ctx, uint8_t *device_id)
DRAM read id function.
err_t dram_memory_read(dram_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
DRAM memory read function.
err_t dram_init(dram_t *ctx, dram_cfg_t *cfg)
DRAM initialization function.
void dram_cfg_setup(dram_cfg_t *cfg)
DRAM configuration object setup function.
err_t dram_toggle_wrap_boundary(dram_t *ctx)
DRAM toggle wrap boundary function.
err_t dram_check_communication(dram_t *ctx)
DRAM check communication function.
err_t dram_memory_read_fast(dram_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
DRAM memory read fast function.
This file contains SPI specific macros, functions, etc.
DRAM Click configuration object.
Definition dram.h:167
spi_master_chip_select_polarity_t cs_polarity
Definition dram.h:181
pin_name_t io2
Definition dram.h:176
pin_name_t sck
Definition dram.h:171
spi_master_mode_t spi_mode
Definition dram.h:180
pin_name_t mosi
Definition dram.h:170
uint32_t spi_speed
Definition dram.h:179
pin_name_t miso
Definition dram.h:169
pin_name_t io3
Definition dram.h:175
pin_name_t cs
Definition dram.h:172
DRAM Click context object.
Definition dram.h:150
spi_master_t spi
Definition dram.h:156
digital_out_t io3
Definition dram.h:152
digital_out_t io2
Definition dram.h:153
pin_name_t chip_select
Definition dram.h:158