eeprom13 2.1.0.0
EEPROM 13 Click Driver

API for configuring and manipulating EEPROM 13 Click driver. More...

Topics

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

Functions

void eeprom13_cfg_setup (eeprom13_cfg_t *cfg)
 EEPROM 13 configuration object setup function.
 
err_t eeprom13_init (eeprom13_t *ctx, eeprom13_cfg_t *cfg)
 EEPROM 13 initialization function.
 
void eeprom13_hw_write_enable (eeprom13_t *ctx)
 EEPROM 13 hardware write enable function.
 
void eeprom13_hw_write_disable (eeprom13_t *ctx)
 EEPROM 13 hardware write enable function.
 
err_t eeprom13_generic_write (eeprom13_t *ctx, uint16_t reg, uint8_t *data_in, uint8_t len)
 EEPROM 13 I2C writing function.
 
err_t eeprom13_generic_read (eeprom13_t *ctx, uint16_t reg, uint8_t *data_out, uint8_t len)
 EEPROM 13 I2C reading function.
 
err_t eeprom13_memory_write (eeprom13_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t len)
 EEPROM 13 memory write function.
 
err_t eeprom13_memory_read (eeprom13_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t len)
 EEPROM 13 memory write function.
 
err_t eeprom13_memory_page_write (eeprom13_t *ctx, uint16_t page_addr, uint8_t *data_in, uint8_t len)
 EEPROM 13 memory page write function.
 
err_t eeprom13_memory_page_read (eeprom13_t *ctx, uint16_t page_addr, uint8_t *data_out, uint8_t len)
 EEPROM 13 memory page read function.
 
err_t eeprom13_id_page_write (eeprom13_t *ctx, uint16_t id_page_addr, uint8_t *data_in)
 EEPROM 13 identification page write function.
 
err_t eeprom13_id_page_read (eeprom13_t *ctx, uint16_t id_page_addr, uint8_t *data_out)
 EEPROM 13 identification page read function.
 
err_t eeprom13_config_dev_addr (eeprom13_t *ctx, uint8_t cda, uint8_t dal)
 EEPROM 13 configuate device address function.
 
err_t eeprom13_sw_write_protect (eeprom13_t *ctx, uint8_t wpa, uint8_t bp, uint8_t wpl)
 EEPROM 13 software write protection function.
 
err_t eeprom13_get_lock_status (eeprom13_t *ctx, uint8_t *lock_status)
 EEPROM 13 get lock/unlock status of the identification function.
 

Detailed Description

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

◆ eeprom13_cfg_setup()

void eeprom13_cfg_setup ( eeprom13_cfg_t * cfg)

EEPROM 13 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ eeprom13_config_dev_addr()

err_t eeprom13_config_dev_addr ( eeprom13_t * ctx,
uint8_t cda,
uint8_t dal )

EEPROM 13 configuate device address function.

This function writes a configurable device address register of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]cda: Configurable device address bits (0x00-0x03).
[in]dal: Device address lock bit:
  • 0 - Configurable device address can be modified,
  • 1 - Configurable device address cannot be modified.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
Updating the DAL bit from 0 to 1 is an irreversible action: the C2,C1 and DAL bits cannot be updated any more. If the write control input (WC) is driven high or if the DAL bit is set to 1, the write configurable device address command is not executed and the accompanying data byte is not acknowledged.

◆ eeprom13_generic_read()

err_t eeprom13_generic_read ( eeprom13_t * ctx,
uint16_t reg,
uint8_t * data_out,
uint8_t len )

EEPROM 13 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]reg: Start register address.
[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.

◆ eeprom13_generic_write()

err_t eeprom13_generic_write ( eeprom13_t * ctx,
uint16_t reg,
uint8_t * data_in,
uint8_t len )

EEPROM 13 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]reg: Start register address.
[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.

◆ eeprom13_get_lock_status()

err_t eeprom13_get_lock_status ( eeprom13_t * ctx,
uint8_t * lock_status )

EEPROM 13 get lock/unlock status of the identification function.

This function reads the lock/unlock status of the identification of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]lock_status: Lock/unlock status of the identification.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
Returns an acknowledge bit after the data byte if the identification page is unlocked, otherwise a NoAck bit if the identification page is locked (lock status).

◆ eeprom13_hw_write_disable()

void eeprom13_hw_write_disable ( eeprom13_t * ctx)

EEPROM 13 hardware write enable function.

This function enabled hardware write protection of the entire memory of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[out]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ eeprom13_hw_write_enable()

void eeprom13_hw_write_enable ( eeprom13_t * ctx)

EEPROM 13 hardware write enable function.

This function disabled hardware write protection of the entire memory of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[out]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ eeprom13_id_page_read()

err_t eeprom13_id_page_read ( eeprom13_t * ctx,
uint16_t id_page_addr,
uint8_t * data_out )

EEPROM 13 identification page read function.

This function reads a desired number of data bytes starting from the selected identification page address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]id_page_addr: Start identification page address (0-256).
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom13_id_page_write()

err_t eeprom13_id_page_write ( eeprom13_t * ctx,
uint16_t id_page_addr,
uint8_t * data_in )

EEPROM 13 identification page write function.

his function writes a desired number of data bytes starting from the selected identification page address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]id_page_addr: Start identification page address (0-256).
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom13_init()

err_t eeprom13_init ( eeprom13_t * ctx,
eeprom13_cfg_t * cfg )

EEPROM 13 initialization function.

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

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

◆ eeprom13_memory_page_read()

err_t eeprom13_memory_page_read ( eeprom13_t * ctx,
uint16_t page_addr,
uint8_t * data_out,
uint8_t len )

EEPROM 13 memory page read function.

his function reads a desired number of data bytes starting from the selected memory page address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]page_addr: Start memory page address (0-512).
[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.

◆ eeprom13_memory_page_write()

err_t eeprom13_memory_page_write ( eeprom13_t * ctx,
uint16_t page_addr,
uint8_t * data_in,
uint8_t len )

EEPROM 13 memory page write function.

This function writes a desired number of data bytes starting from the selected memory page address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]page_addr: Start memory page address (0-512).
[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.

◆ eeprom13_memory_read()

err_t eeprom13_memory_read ( eeprom13_t * ctx,
uint32_t mem_addr,
uint8_t * data_out,
uint8_t len )

EEPROM 13 memory write function.

This function reads a desired number of data bytes starting from the selected memory address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]mem_addr: Start memory address (0x00000000-0x0001FFFF).
[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.

◆ eeprom13_memory_write()

err_t eeprom13_memory_write ( eeprom13_t * ctx,
uint32_t mem_addr,
uint8_t * data_in,
uint8_t len )

EEPROM 13 memory write function.

This function writes a desired number of data bytes starting from the selected memory address of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]mem_addr: Start memory address (0x00000000-0x0001FFFF).
[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.

◆ eeprom13_sw_write_protect()

err_t eeprom13_sw_write_protect ( eeprom13_t * ctx,
uint8_t wpa,
uint8_t bp,
uint8_t wpl )

EEPROM 13 software write protection function.

This function software disable/enable write protection of the entire memory of the M24M01E-FMN6TP, 1-Mbit serial I�C bus EEPROM with configurable device address and preprogrammed device address on the EEPROM 13 Click board.

Parameters
[in]ctx: Click context object. See eeprom13_t object definition for detailed explanation.
[in]wpa: Write protect activation bit:
  • 0 - No write protection,
  • 1 - Write protection active.
[in]dal: Block protection bits:
  • 0 - The upper quarter of memory is write-protected,
  • 1 - The upper half of memory is write-protected,
  • 2 - The upper ¾ of memory is write-protected,
  • 3 - The upper whole memory is write-protected.
[in]wpl: write protection lock bit:
  • 0 - Can be modified,
  • 1 - Cannot be modified and therefore the write protection register is frozen.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
Updating the WPL bit from 0 to 1 is an irreversible action: the WPA, BP1, BP0 and WPL bits cannot be updated any more. If the write control input (WC) is driven high or if the WPL bit is set to 1, the write configurable device address command is not executed and the accompanying data byte is not acknowledged.