dram 2.1.0.0
DRAM Click Driver

API for configuring and manipulating DRAM Click driver. More...

Topics

 DRAM Registers List
 List of registers of DRAM Click driver.
 
 DRAM Registers Settings
 Settings for registers of DRAM Click driver.
 
 DRAM MikroBUS Map
 MikroBUS pin mapping of DRAM Click driver.
 

Functions

void dram_cfg_setup (dram_cfg_t *cfg)
 DRAM configuration object setup function.
 
err_t dram_init (dram_t *ctx, dram_cfg_t *cfg)
 DRAM initialization 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_memory_read (dram_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 DRAM memory read 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.
 
err_t dram_reset (dram_t *ctx)
 DRAM reset function.
 
err_t dram_toggle_wrap_boundary (dram_t *ctx)
 DRAM toggle wrap boundary function.
 
err_t dram_read_id (dram_t *ctx, uint8_t *device_id)
 DRAM read id function.
 
err_t dram_check_communication (dram_t *ctx)
 DRAM check communication function.
 
void dram_set_io3_pin (dram_t *ctx, uint8_t state)
 DRAM set io3 pin function.
 
void dram_set_io2_pin (dram_t *ctx, uint8_t state)
 DRAM set io2 pin function.
 

Detailed Description

API for configuring and manipulating DRAM Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ dram_cfg_setup()

void dram_cfg_setup ( dram_cfg_t * cfg)

DRAM configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See dram_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ dram_check_communication()

err_t dram_check_communication ( dram_t * ctx)

DRAM check communication function.

This function checks the communication by reading the device ID bytes and verifying the manufacturer ID.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_init()

err_t dram_init ( dram_t * ctx,
dram_cfg_t * cfg )

DRAM initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See dram_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_memory_read()

err_t dram_memory_read ( dram_t * ctx,
uint32_t address,
uint8_t * data_out,
uint32_t len )

DRAM memory read function.

This function reads a desired number of data bytes starting from the selected memory address.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x7FFFFF].
[out]data_out: Read data output.
[in]len: Number of data bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_memory_read_fast()

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 function reads a desired number of data bytes starting from the selected memory address performing fast read feature.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x7FFFFF].
[out]data_out: Read data output.
[in]len: Number of data bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_memory_write()

err_t dram_memory_write ( dram_t * ctx,
uint32_t address,
uint8_t * data_in,
uint32_t len )

DRAM memory write function.

This function writes a desired number of data bytes starting from the selected memory address.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x7FFFFF].
[in]data_in: Data to be written.
[in]len: Number of data bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_read_id()

err_t dram_read_id ( dram_t * ctx,
uint8_t * device_id )

DRAM read id function.

This function reads the device ID (8 bytes).

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[out]device_id: Device ID (8 bytes).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_reset()

err_t dram_reset ( dram_t * ctx)

DRAM reset function.

This function resets the device by putting the device in SPI standby mode which is also the default mode after power-up.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dram_set_io2_pin()

void dram_set_io2_pin ( dram_t * ctx,
uint8_t state )

DRAM set io2 pin function.

This function sets the IO2 pin logic state.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
Used for QUAD SPI which is not supported by the driver.

◆ dram_set_io3_pin()

void dram_set_io3_pin ( dram_t * ctx,
uint8_t state )

DRAM set io3 pin function.

This function sets the IO3 pin logic state.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
Used for QUAD SPI which is not supported by the driver.

◆ dram_toggle_wrap_boundary()

err_t dram_toggle_wrap_boundary ( dram_t * ctx)

DRAM toggle wrap boundary function.

This function switches the device’s wrapped boundary between Linear Burst which crosses the 1K page boundary (CA[9:0]) and Wrap 32 (CA[4:0]) bytes. Default setting is Linear Burst.

Parameters
[in]ctx: Click context object. See dram_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.