mram2 2.0.0.0
Public function

Functions

void mram2_cfg_setup (mram2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t mram2_init (mram2_t *ctx, mram2_cfg_t *cfg)
 Initialization function.
 
uint8_t mram2_rdsr (mram2_t *ctx)
 Read Status Register function.
 
void mram2_wren (mram2_t *ctx)
 Write Enable function.
 
void mram2_wrdi (mram2_t *ctx)
 Write Disable function.
 
void mram2_wrsr (mram2_t *ctx, uint8_t stat_reg)
 Write Status Register function.
 
void mram2_read (mram2_t *ctx, uint32_t mem_adr, uint8_t *rd_data, uint8_t n_bytes)
 Read Data Bytes function.
 
void mram2_fread (mram2_t *ctx, uint32_t mem_adr, uint8_t mode, uint8_t *rd_data, uint8_t n_bytes)
 Fast Read Data Bytes function.
 
void mram2_write (mram2_t *ctx, uint32_t mem_adr, uint8_t *wr_data, uint8_t n_bytes)
 Write Data Bytes function.
 
void mram2_sleep (mram2_t *ctx)
 Enter Sleep Mode function.
 
void mram2_wake (mram2_t *ctx)
 Exit Sleep Mode function.
 
uint32_t mram2_tdet (mram2_t *ctx)
 Tamper Detect (TDET) function.
 
void mram2_tdetx (mram2_t *ctx)
 Tamper Detect Exit function.
 
void mram2_rdid (mram2_t *ctx, uint8_t *rd_id)
 Read ID function.
 
void mram2_write_protect (mram2_t *ctx, uint8_t state)
 Write Protect function.
 
void mram2_hold (mram2_t *ctx, uint8_t state)
 Hold function.
 

Detailed Description

Function Documentation

◆ mram2_cfg_setup()

void mram2_cfg_setup ( mram2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ mram2_fread()

void mram2_fread ( mram2_t * ctx,
uint32_t mem_adr,
uint8_t mode,
uint8_t * rd_data,
uint8_t n_bytes )

Fast Read Data Bytes function.

Parameters
ctxClick object.
mem_adr24-bit memory address entry
mode8-bit XIP operation option
rd_datadata read
n_bytesnumber of bytes to read

The Fast Read Data Bytes function allows data bytes to be continuously read starting at an initial address at the highest frequency.

◆ mram2_hold()

void mram2_hold ( mram2_t * ctx,
uint8_t state )

Hold function.

Parameters
ctxClick object.
statevalue that defines whether Hold is enabled or not

Function is used to hold or un-hold the device.

◆ mram2_init()

err_t mram2_init ( mram2_t * ctx,
mram2_cfg_t * cfg )

Initialization function.

Parameters
mram2Click object.
cfgClick configuration structure.

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

◆ mram2_rdid()

void mram2_rdid ( mram2_t * ctx,
uint8_t * rd_id )

Read ID function.

Parameters
ctxClick object.
rd_idinformation that identify the device

The Read Device ID function oututs the information that identify the device.

◆ mram2_rdsr()

uint8_t mram2_rdsr ( mram2_t * ctx)

Read Status Register function.

Parameters
ctxClick object.
Returns
8-bit data representing current status

Function is used to read Status register.

◆ mram2_read()

void mram2_read ( mram2_t * ctx,
uint32_t mem_adr,
uint8_t * rd_data,
uint8_t n_bytes )

Read Data Bytes function.

Parameters
ctxClick object.
mem_adr24-bit memory address entry
rd_datadata read
n_bytesnumber of bytes to read

The Read Data Bytes function allows data bytes to be continuously read starting at an initial address.

◆ mram2_sleep()

void mram2_sleep ( mram2_t * ctx)

Enter Sleep Mode function.

Parameters
ctxClick object.

Function is used to place the device into sleep mode.

◆ mram2_tdet()

uint32_t mram2_tdet ( mram2_t * ctx)

Tamper Detect (TDET) function.

Parameters
ctxClick object.
Returns
tamper detect result

The Tamper Detect function is used to check whether the memory contents have been corrupted by exposure to external magnetic fields.

Note
Any 1�s, of the tamper detect result, present in the 32-bit string indicate probable corruption of the memory contents.
After running a TDET function, any other function can be run as the next function, except another TDET function.

◆ mram2_tdetx()

void mram2_tdetx ( mram2_t * ctx)

Tamper Detect Exit function.

Parameters
ctxClick object.

Function is used to exit the Tamper Detect.

Note
If another TDET function is to be run, then the Tamper Detect Exit function must be run first to reset the device.

◆ mram2_wake()

void mram2_wake ( mram2_t * ctx)

Exit Sleep Mode function.

Parameters
ctxClick object.

Function is used to wake up the device from the sleep mode.

◆ mram2_wrdi()

void mram2_wrdi ( mram2_t * ctx)

Write Disable function.

Parameters
ctxClick object.

Function is used to disable write operation.

◆ mram2_wren()

void mram2_wren ( mram2_t * ctx)

Write Enable function.

Parameters
ctxClick object.

Function is used to enable write operation.

◆ mram2_write()

void mram2_write ( mram2_t * ctx,
uint32_t mem_adr,
uint8_t * wr_data,
uint8_t n_bytes )

Write Data Bytes function.

Parameters
ctxClick object.
mem_adr24-bit memory address entry
wr_data8-bit write data
n_bytesnumber of bytes to read

The Write Data Bytes function allows data bytes to be written sequentially.

Note
Write Data Bytes function will not be work if used before Write Enable function and if Write protect is enabled.

◆ mram2_write_protect()

void mram2_write_protect ( mram2_t * ctx,
uint8_t state )

Write Protect function.

Parameters
ctxClick object.
statevalue that defines whether write protect is enabled or not

Function is used to eable or disable Write protect.

◆ mram2_wrsr()

void mram2_wrsr ( mram2_t * ctx,
uint8_t stat_reg )

Write Status Register function.

Parameters
ctxClick object.
stat_reg8-bit input walue

Function is used to change settings in Status register.

Note
Write Status Register function will not be work if used before Write Enable function and if Write protect is enabled.
QPI Mode Bit, Bit 6, and the WEL Bit, Bit 0, are set by other commands and cannot be changed by this command.