mram3 2.0.0.0
MRAM 3 Click Driver

API for configuring and manipulating MRAM 3 Click driver. More...

Topics

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

Functions

void mram3_cfg_setup (mram3_cfg_t *cfg)
 MRAM 3 configuration object setup function.
 
err_t mram3_init (mram3_t *ctx, mram3_cfg_t *cfg)
 MRAM 3 initialization function.
 
err_t mram3_default_cfg (mram3_t *ctx)
 MRAM 3 default configuration function.
 
err_t mram3_write_cmd (mram3_t *ctx, uint8_t cmd)
 MRAM 3 write cmd function.
 
err_t mram3_write_cmd_data (mram3_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 MRAM 3 write cmd data function.
 
err_t mram3_read_cmd_data (mram3_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 MRAM 3 read cmd data function.
 
err_t mram3_write_cmd_address_data (mram3_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len)
 MRAM 3 write cmd address data function.
 
err_t mram3_read_cmd_address_data (mram3_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len)
 MRAM 3 read cmd address data function.
 
err_t mram3_memory_write (mram3_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len)
 MRAM 3 memory write function.
 
err_t mram3_memory_read (mram3_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 MRAM 3 memory read function.
 
err_t mram3_aug_memory_write (mram3_t *ctx, uint8_t address, uint8_t *data_in, uint8_t len)
 MRAM 3 aug memory write function.
 
err_t mram3_aug_memory_read (mram3_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len)
 MRAM 3 aug memory read function.
 
err_t mram3_check_communication (mram3_t *ctx)
 MRAM 3 check communication function.
 
err_t mram3_write_protect (mram3_t *ctx)
 MRAM 3 write protect function.
 
err_t mram3_write_enable (mram3_t *ctx)
 MRAM 3 write enable function.
 
err_t mram3_soft_reset (mram3_t *ctx)
 MRAM 3 soft reset function.
 
err_t mram3_write_status (mram3_t *ctx, uint8_t status)
 MRAM 3 write status function.
 
err_t mram3_read_status (mram3_t *ctx, uint8_t *status)
 MRAM 3 read status function.
 

Detailed Description

API for configuring and manipulating MRAM 3 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

◆ mram3_aug_memory_read()

err_t mram3_aug_memory_read ( mram3_t * ctx,
uint8_t address,
uint8_t * data_out,
uint8_t len )

MRAM 3 aug memory read function.

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

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x00-0xFF].
[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.

◆ mram3_aug_memory_write()

err_t mram3_aug_memory_write ( mram3_t * ctx,
uint8_t address,
uint8_t * data_in,
uint8_t len )

MRAM 3 aug memory write function.

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

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x00-0xFF].
[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.

◆ mram3_cfg_setup()

void mram3_cfg_setup ( mram3_cfg_t * cfg)

MRAM 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ mram3_check_communication()

err_t mram3_check_communication ( mram3_t * ctx)

MRAM 3 check communication function.

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

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

◆ mram3_default_cfg()

err_t mram3_default_cfg ( mram3_t * ctx)

MRAM 3 default configuration function.

This function executes a default configuration of MRAM 3 click board.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ mram3_init()

err_t mram3_init ( mram3_t * ctx,
mram3_cfg_t * cfg )

MRAM 3 initialization function.

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

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

◆ mram3_memory_read()

err_t mram3_memory_read ( mram3_t * ctx,
uint32_t address,
uint8_t * data_out,
uint32_t len )

MRAM 3 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 mram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x1FFFF].
[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.

◆ mram3_memory_write()

err_t mram3_memory_write ( mram3_t * ctx,
uint32_t address,
uint8_t * data_in,
uint32_t len )

MRAM 3 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 mram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x1FFFF].
[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.

◆ mram3_read_cmd_address_data()

err_t mram3_read_cmd_address_data ( mram3_t * ctx,
uint8_t cmd,
uint32_t address,
uint8_t * data_out,
uint32_t len )

MRAM 3 read cmd address data function.

This function reads a desired number of data bytes starting from a desired address of the selected instruction command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]cmd: Instruction command opcode.
[in]address: Memory address (up to 0x1FFFF).
[out]data_out: Output read data.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mram3_read_cmd_data()

err_t mram3_read_cmd_data ( mram3_t * ctx,
uint8_t cmd,
uint8_t * data_out,
uint8_t len )

MRAM 3 read cmd data function.

This function reads a desired number of data bytes from the selected instruction command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]cmd: Instruction command opcode.
[out]data_out: Output read data.
[in]len: Number of bytes to be read (up to 8).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mram3_read_status()

err_t mram3_read_status ( mram3_t * ctx,
uint8_t * status )

MRAM 3 read status function.

This function reads data from the status register.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[out]status: Status data read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mram3_soft_reset()

err_t mram3_soft_reset ( mram3_t * ctx)

MRAM 3 soft reset function.

This function executes the soft reset command.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ mram3_write_cmd()

err_t mram3_write_cmd ( mram3_t * ctx,
uint8_t cmd )

MRAM 3 write cmd function.

This function writes a desired instruction command by using SPI serial interface.

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

◆ mram3_write_cmd_address_data()

err_t mram3_write_cmd_address_data ( mram3_t * ctx,
uint8_t cmd,
uint32_t address,
uint8_t * data_in,
uint32_t len )

MRAM 3 write cmd address data function.

This function writes a desired number of data bytes starting from a desired address of the selected instruction command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]cmd: Instruction command opcode.
[in]address: Memory address (up to 0x1FFFF).
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mram3_write_cmd_data()

err_t mram3_write_cmd_data ( mram3_t * ctx,
uint8_t cmd,
uint8_t * data_in,
uint8_t len )

MRAM 3 write cmd data function.

This function writes a desired number of data bytes to the selected instruction command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]cmd: Instruction command opcode.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written (up to 8).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mram3_write_enable()

err_t mram3_write_enable ( mram3_t * ctx)

MRAM 3 write enable function.

This function disables memory write-protect via the WP pin and WREN command.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ mram3_write_protect()

err_t mram3_write_protect ( mram3_t * ctx)

MRAM 3 write protect function.

This function write protects the entire memory via the WP pin and WRDI command.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ mram3_write_status()

err_t mram3_write_status ( mram3_t * ctx,
uint8_t status )

MRAM 3 write status function.

This function writes data to the status register.

Parameters
[in]ctx: Click context object. See mram3_t object definition for detailed explanation.
[in]status: Status data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.