eeram2 2.0.0.0
Public function

Functions

void eeram2_cfg_setup (eeram2_cfg_t *cfg)
 Config Object Initialization function.
 
EERAM2_RETVAL eeram2_init (eeram2_t *ctx, eeram2_cfg_t *cfg)
 Initialization function.
 
void eeram2_generic_transfer (eeram2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void eeram2_set_on_hold_status (eeram2_t *ctx, uint8_t en_hold)
 Set On-hold status function.
 
void eeram2_set_command (eeram2_t *ctx, uint8_t command)
 Set command function.
 
void eeram2_set_write_status (eeram2_t *ctx, uint8_t en_write)
 Set write status function.
 
void eeram2_set_status (eeram2_t *ctx, uint8_t tx_data)
 Set status register function.
 
uint8_t eeram2_get_status (eeram2_t *ctx)
 Read status register function.
 
uint8_t eeram2_write_byte (eeram2_t *ctx, uint32_t reg, uint8_t tx_data)
 Write the data byte into SRAM function.
 
uint8_t eeram2_read_byte (eeram2_t *ctx, uint32_t reg)
 Read the data byte from SRAM function.
 
uint8_t eeram2_write_continuous (eeram2_t *ctx, uint32_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
 Continuous write the data into SRAM function.
 
uint8_t eeram2_read_continuous (eeram2_t *ctx, uint32_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
 Continuous read the data into SRAM function.
 
uint8_t eeram2_read_nonvolatile (eeram2_t *ctx, uint8_t *p_rx_data)
 Nonvolatile user space write function.
 
uint8_t eeram2_write_nonvolatile (eeram2_t *ctx, uint8_t *p_tx_data)
 Nonvolatile user space read function.
 
uint8_t eeram2_secure_write (eeram2_t *ctx, uint16_t reg, uint8_t *p_tx_data)
 Secure SRAM write function.
 
uint8_t eeram2_secure_read (eeram2_t *ctx, uint16_t reg, uint8_t *p_rx_data)
 Secure SRAM read function.
 

Detailed Description

Function Documentation

◆ eeram2_cfg_setup()

void eeram2_cfg_setup ( eeram2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ eeram2_generic_transfer()

void eeram2_generic_transfer ( eeram2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ eeram2_get_status()

uint8_t eeram2_get_status ( eeram2_t * ctx)

Read status register function.

Parameters
ctxClick object.
Returns
status bit [ 7 ] : Reserved, Must be set to 0. bit [ 6 ] : AutoStore Enable bit;
  • 0 : AutoStore is enabled (factory default).
  • 1 : AutoStore is disabled. bit [ 5 ] : Reserved, Must be set to 0. bit [ 4 ] : Secure Write Monitoring bit � Read-Only;
  • 0 : No error reported in Secure Write.
  • 1 : The last secure write operation has failed. bit [ 3:2 ] : Block Protection bits;
  • 0 : ( Lvl 0 ) No SRAM array write protection (factory default).
  • 1 : ( Lvl 1 ) Upper quarter SRAM memory array protection.
  • 2 : ( Lvl 2 ) Upper half SRAM memory array protection.
  • 3 : ( Lvl 3 ) Entire SRAM memory array protection. bit [ 1 ] : Write Enable Latch bit � Read-Only;
  • 0 : Device is not write-enabled.
  • 1 : WREN has been executed and device is enabled for writing. bit [ 0 ] : Ready/Busy Status bit � Read-Only;
  • 0 : Device is ready for standard SRAM Read/Write commands.
  • 1 : Device is busy with an internal store or recall operation.

@description Function set status register of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_init()

EERAM2_RETVAL eeram2_init ( eeram2_t * ctx,
eeram2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ eeram2_read_byte()

uint8_t eeram2_read_byte ( eeram2_t * ctx,
uint32_t reg )

Read the data byte from SRAM function.

Parameters
ctxClick object.
reg24-bit register address.
Returns
8-bit read data.

@description Function read the data byte of the desired register address of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_read_continuous()

uint8_t eeram2_read_continuous ( eeram2_t * ctx,
uint32_t reg,
uint8_t * p_rx_data,
uint8_t n_bytes )

Continuous read the data into SRAM function.

Parameters
ctxClick object.
reg24-bit register address.
p_rx_datapointer to the memory location where data be stored.
n_bytesnumber of bytes to be read.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR reading;
  • 1 ( EERAM2_SUCCESS ) : Successful reading;

@description Function read a sequential data starting from the targeted register address of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_read_nonvolatile()

uint8_t eeram2_read_nonvolatile ( eeram2_t * ctx,
uint8_t * p_rx_data )

Nonvolatile user space write function.

Parameters
ctxClick object.
p_tx_datapointer to the data to be written.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR writing;
  • 1 ( EERAM2_SUCCESS ) : Successful writing;

@description Function writes a nonvolatile user space of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_secure_read()

uint8_t eeram2_secure_read ( eeram2_t * ctx,
uint16_t reg,
uint8_t * p_rx_data )

Secure SRAM read function.

Parameters
ctxClick object.
p_tx_datapointer to the memory location where data be stored.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR reading;
  • 1 ( EERAM2_SUCCESS ) : Successful reading;

@description Function read data from the secure SRAM memory space of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_secure_write()

uint8_t eeram2_secure_write ( eeram2_t * ctx,
uint16_t reg,
uint8_t * p_tx_data )

Secure SRAM write function.

Parameters
ctxClick object.
p_tx_datapointer to the data to be written.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR writing;
  • 1 ( EERAM2_SUCCESS ) : Successful writing;

@description Function secure SRAM write, which add another layer of protection to data of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_set_command()

void eeram2_set_command ( eeram2_t * ctx,
uint8_t command )

Set command function.

Parameters
ctxClick object.
command8-bit Commands Opcode.

@description Function set command to the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_set_on_hold_status()

void eeram2_set_on_hold_status ( eeram2_t * ctx,
uint8_t en_hold )

Set On-hold status function.

Parameters
ctxClick object.
en_hold
  • 0x00 ( EERAM2_HOLD_DISABLE ) : Pause the SPI communication with the device.
  • 0x01 ( EERAM2_HOLD_ENABLE ) : Resume the SPI communication.

@description Function sets the states of the HLD ( PWM ) pin depending on the function argument.

◆ eeram2_set_status()

void eeram2_set_status ( eeram2_t * ctx,
uint8_t tx_data )

Set status register function.

Parameters
ctxClick object.
tx_databit [ 6 ] :
  • EERAM2_STATUS_ASE_DISABLE : AutoStore is disabled.
  • EERAM2_STATUS_ASE_ENABLE : AutoStore is enabled (factory default). bit [ 3:2 ] :
  • EERAM2_STATUS_BP_LVL_0 : No SRAM array write protection (factory default).
  • EERAM2_STATUS_BP_LVL_1 : Upper quarter SRAM memory array protection.
  • EERAM2_STATUS_BP_LVL_2 : Upper half SRAM memory array protection.
  • EERAM2_STATUS_BP_LVL_3 : Entire SRAM memory array protection.

@description Function set status register of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_set_write_status()

void eeram2_set_write_status ( eeram2_t * ctx,
uint8_t en_write )

Set write status function.

Parameters
ctxClick object.
en_write
  • 0x00 ( EERAM2_WRITE_DISABLE ) : Write enable instruction.
  • 0x01 ( EERAM2_WRITE_ENABLE ) : Write disable instruction.

@description Function set write enable instruction of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_write_byte()

uint8_t eeram2_write_byte ( eeram2_t * ctx,
uint32_t reg,
uint8_t tx_data )

Write the data byte into SRAM function.

Parameters
ctxClick object.
reg24-bit register address.
tx_data8-bit write data.
Returns
  • 0 ( EERAM2_ERROR ) : Write error;
  • 1 ( EERAM2_SUCCESS ) : Successful writing;

@description Function write the data byte to the desired register address of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_write_continuous()

uint8_t eeram2_write_continuous ( eeram2_t * ctx,
uint32_t reg,
uint8_t * p_tx_data,
uint8_t n_bytes )

Continuous write the data into SRAM function.

Parameters
ctxClick object.
reg24-bit register address.
p_tx_datapointer to the data to be written.
n_bytesnumber of bytes to be written.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR writing;
  • 1 ( EERAM2_SUCCESS ) : Successful writing;

@description Function writes a sequential data starting to the targeted register address of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.

◆ eeram2_write_nonvolatile()

uint8_t eeram2_write_nonvolatile ( eeram2_t * ctx,
uint8_t * p_tx_data )

Nonvolatile user space read function.

Parameters
ctxClick object.
p_tx_datapointer to the memory location where data be stored.
Returns
  • 0 ( EERAM2_ERROR ) : ERROR reading;
  • 1 ( EERAM2_SUCCESS ) : Successful reading;

@description Function read a nonvolatile user space of the 48LM01 1-Mbit SPI Serial EERAM on the EERAM 2 click board.