eeram3 2.0.0.0
EERAM 3 Click Driver

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

Topics

 EERAM 3 Opcode Commands List
 List of Opcode Commands of EERAM 3 Click driver.
 
 EERAM 3 Registers Settings
 Settings for registers of EERAM 3 Click driver.
 
 EERAM 3 MikroBUS Map
 MikroBUS pin mapping of EERAM 3 Click driver.
 

Functions

void eeram3_cfg_setup (eeram3_cfg_t *cfg)
 EERAM 3 configuration object setup function.
 
err_t eeram3_init (eeram3_t *ctx, eeram3_cfg_t *cfg)
 EERAM 3 initialization function.
 
void eeram3_default_cfg (eeram3_t *ctx)
 EERAM 3 default configuration function.
 
err_t eeram3_write_opcode (eeram3_t *ctx, uint8_t opcode)
 EERAM 3 write opcode function.
 
err_t eeram3_read_opcode (eeram3_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len)
 EERAM 3 read opcode function.
 
void eeram3_set_hld_pin (eeram3_t *ctx, uint8_t state)
 EERAM 3 set HLD pin function.
 
err_t eeram3_enable_write (eeram3_t *ctx)
 EERAM 3 enable write function.
 
err_t eeram3_disable_write (eeram3_t *ctx)
 EERAM 3 disable write function.
 
err_t eeram3_set_block_protection (eeram3_t *ctx, uint8_t block_protect)
 EERAM 3 set block protection function.
 
err_t eeram3_write_status (eeram3_t *ctx, uint8_t status)
 EERAM 3 write status function.
 
err_t eeram3_read_status (eeram3_t *ctx, uint8_t *status)
 EERAM 3 read status function.
 
err_t eeram3_enter_hibernate_mode (eeram3_t *ctx)
 EERAM 3 enter hibernate mode function.
 
void eeram3_wakeup_from_hibernate (eeram3_t *ctx)
 EERAM 3 wake up from hibernate function.
 
err_t eeram3_memory_write (eeram3_t *ctx, uint16_t address, uint8_t *data_in, uint16_t len)
 EERAM 3 memory write function.
 
err_t eeram3_memory_read (eeram3_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len)
 EERAM 3 memory read function.
 
err_t eeram3_memory_secure_write (eeram3_t *ctx, uint16_t address, uint8_t *data_in, uint8_t len)
 EERAM 3 memory write function.
 
err_t eeram3_memory_secure_read (eeram3_t *ctx, uint16_t address, uint8_t *data_out, uint8_t len)
 EERAM 3 memory secure read function.
 
err_t eeram3_read_last_written_address (eeram3_t *ctx, uint16_t *address)
 EERAM 3 read last written address function.
 
err_t eeram3_nv_user_space_write (eeram3_t *ctx, uint16_t data_in)
 EERAM 3 nv user space write function.
 
err_t eeram3_nv_user_space_read (eeram3_t *ctx, uint16_t *data_out)
 EERAM 3 nv user space read function.
 
err_t eeram3_store_data (eeram3_t *ctx)
 EERAM 3 store data function.
 
err_t eeram3_recall_data (eeram3_t *ctx)
 EERAM 3 recall data function.
 
err_t eeram3_autostore_enable (eeram3_t *ctx)
 EERAM 3 autostore enable function.
 
err_t eeram3_autostore_disable (eeram3_t *ctx)
 EERAM 3 autostore disable function.
 

Detailed Description

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

◆ eeram3_autostore_disable()

err_t eeram3_autostore_disable ( eeram3_t * ctx)

EERAM 3 autostore disable function.

This function disables Auto Store feature.

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

◆ eeram3_autostore_enable()

err_t eeram3_autostore_enable ( eeram3_t * ctx)

EERAM 3 autostore enable function.

This function enables Auto Store feature.

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

◆ eeram3_cfg_setup()

void eeram3_cfg_setup ( eeram3_cfg_t * cfg)

EERAM 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ eeram3_default_cfg()

void eeram3_default_cfg ( eeram3_t * ctx)

EERAM 3 default configuration function.

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

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ eeram3_disable_write()

err_t eeram3_disable_write ( eeram3_t * ctx)

EERAM 3 disable write function.

This function disables write by issuing the WRDI command and checking the WEL bit.

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

◆ eeram3_enable_write()

err_t eeram3_enable_write ( eeram3_t * ctx)

EERAM 3 enable write function.

This function enables write by issuing the WREN command and checking the WEL bit.

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

◆ eeram3_enter_hibernate_mode()

err_t eeram3_enter_hibernate_mode ( eeram3_t * ctx)

EERAM 3 enter hibernate mode function.

This function enters to the hibernate mode by issuing the HIBERNATE command.

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

◆ eeram3_init()

err_t eeram3_init ( eeram3_t * ctx,
eeram3_cfg_t * cfg )

EERAM 3 initialization function.

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

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

◆ eeram3_memory_read()

err_t eeram3_memory_read ( eeram3_t * ctx,
uint16_t address,
uint8_t * data_out,
uint16_t len )

EERAM 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 eeram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x7FFF].
[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.

◆ eeram3_memory_secure_read()

err_t eeram3_memory_secure_read ( eeram3_t * ctx,
uint16_t address,
uint8_t * data_out,
uint8_t len )

EERAM 3 memory secure read function.

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

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x7FFF].
[out]data_out: Read data output.
[in]len: Number of data bytes [up to 64 bytes].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Address must be aligned to a 64-byte boundary.

◆ eeram3_memory_secure_write()

err_t eeram3_memory_secure_write ( eeram3_t * ctx,
uint16_t address,
uint8_t * data_in,
uint8_t len )

EERAM 3 memory write function.

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

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x7FFF].
[in]data_in: Data to be written.
[in]len: Number of data bytes [up to 64 bytes].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Address must be aligned to a 64-byte boundary.

◆ eeram3_memory_write()

err_t eeram3_memory_write ( eeram3_t * ctx,
uint16_t address,
uint8_t * data_in,
uint16_t len )

EERAM 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 eeram3_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x7FFF].
[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.

◆ eeram3_nv_user_space_read()

err_t eeram3_nv_user_space_read ( eeram3_t * ctx,
uint16_t * data_out )

EERAM 3 nv user space read function.

This function reads two bytes of data from the nonvolatile user space.

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[out]data_out: Read data output.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ eeram3_nv_user_space_write()

err_t eeram3_nv_user_space_write ( eeram3_t * ctx,
uint16_t data_in )

EERAM 3 nv user space write function.

This function writes two bytes of data to the nonvolatile user space.

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

◆ eeram3_read_last_written_address()

err_t eeram3_read_last_written_address ( eeram3_t * ctx,
uint16_t * address )

EERAM 3 read last written address function.

This function reads the last successfully written address.

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[out]address: Last written memory address [0x0000-0x7FFF].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ eeram3_read_opcode()

err_t eeram3_read_opcode ( eeram3_t * ctx,
uint8_t opcode,
uint8_t * data_out,
uint8_t len )

EERAM 3 read opcode function.

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

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

◆ eeram3_read_status()

err_t eeram3_read_status ( eeram3_t * ctx,
uint8_t * status )

EERAM 3 read status function.

This function reads the Status register.

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

◆ eeram3_recall_data()

err_t eeram3_recall_data ( eeram3_t * ctx)

EERAM 3 recall data function.

This function executes the RECALL command which copies EEPROM data to SRAM array.

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

◆ eeram3_set_block_protection()

err_t eeram3_set_block_protection ( eeram3_t * ctx,
uint8_t block_protect )

EERAM 3 set block protection function.

This function sets the block protection bits of the Status register.

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[in]block_protect:
  • 0x00 - None,
  • 0x04 - Upper quarter,
  • 0x08 - Upper half,
  • 0x0C - All.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ eeram3_set_hld_pin()

void eeram3_set_hld_pin ( eeram3_t * ctx,
uint8_t state )

EERAM 3 set HLD pin function.

This function sets the HOLD (HLD) pin logic state.

Parameters
[in]ctx: Click context object. See eeram3_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ eeram3_store_data()

err_t eeram3_store_data ( eeram3_t * ctx)

EERAM 3 store data function.

This function executes the STORE command which stores SRAM data to EEPROM array.

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

◆ eeram3_wakeup_from_hibernate()

void eeram3_wakeup_from_hibernate ( eeram3_t * ctx)

EERAM 3 wake up from hibernate function.

This function wakes up from hibernate mode by toggling the CS pin.

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

◆ eeram3_write_opcode()

err_t eeram3_write_opcode ( eeram3_t * ctx,
uint8_t opcode )

EERAM 3 write opcode function.

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

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

◆ eeram3_write_status()

err_t eeram3_write_status ( eeram3_t * ctx,
uint8_t status )

EERAM 3 write status function.

This function writes a desired data to the Status register.

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