eeprom5 2.0.0.0
EEPROM 5 Click Driver

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

Topics

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

Functions

void eeprom5_cfg_setup (eeprom5_cfg_t *cfg)
 EEPROM 5 configuration object setup function.
 
err_t eeprom5_init (eeprom5_t *ctx, eeprom5_cfg_t *cfg)
 EEPROM 5 initialization function.
 
void eeprom5_generic_write (eeprom5_t *ctx, uint32_t addr, uint8_t tx_data)
 EEPROM 5 data writing function.
 
uint8_t eeprom5_generic_read (eeprom5_t *ctx, uint32_t addr)
 EEPROM 5 data reading function.
 
void eeprom5_set_hold (eeprom5_t *ctx, uint8_t en_hold)
 Enable hold operation function.
 
void eeprom5_set_write_protect (eeprom5_t *ctx, uint8_t en_wr_prot)
 Enable write protect function.
 
void eeprom5_send_cmd (eeprom5_t *ctx, uint8_t cmd)
 Send command function.
 
void eeprom5_enable_memory_write (eeprom5_t *ctx, uint8_t en_wr_mem)
 Enable memory write function.
 
void eeprom5_get_status (eeprom5_t *ctx, status_data_t *stat_data)
 Get status function.
 
void eeprom5_set_status (eeprom5_t *ctx, status_data_t stat_data)
 Set status function.
 
void eeprom5_read_memory (eeprom5_t *ctx, uint32_t addr, uint8_t *p_rx_data, uint8_t n_bytes)
 Read EEPROM memory function.
 
void eeprom5_write_memory (eeprom5_t *ctx, uint32_t addr, uint8_t *p_tx_data, uint8_t n_bytes)
 Write EEPROM memory function.
 
uint8_t eeprom5_read_ident_page (eeprom5_t *ctx, uint16_t addr)
 Read identification page function.
 
void eeprom5_write_ident_page (eeprom5_t *ctx, uint16_t addr, uint8_t ident_data)
 Write dentification page function.
 
uint8_t eeprom5_read_lock_status (eeprom5_t *ctx)
 Reads the identification page lock status function.
 
void eeprom5_lock_id (eeprom5_t *ctx, uint8_t lock_id)
 Lock ID function.
 

Detailed Description

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

◆ eeprom5_cfg_setup()

void eeprom5_cfg_setup ( eeprom5_cfg_t * cfg)

EEPROM 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ eeprom5_enable_memory_write()

void eeprom5_enable_memory_write ( eeprom5_t * ctx,
uint8_t en_wr_mem )

Enable memory write function.

The function enable write depending on the function argument of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]en_wr_mem: Write enabled or disabled.
Returns
Nothing.

◆ eeprom5_generic_read()

uint8_t eeprom5_generic_read ( eeprom5_t * ctx,
uint32_t addr )

EEPROM 5 data reading function.

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

Parameters
[in]ctx: Click context object. See eeprom5_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.

◆ eeprom5_generic_write()

void eeprom5_generic_write ( eeprom5_t * ctx,
uint32_t addr,
uint8_t tx_data )

EEPROM 5 data writing function.

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

Parameters
[in]ctx: Click context object. See eeprom5_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.

◆ eeprom5_get_status()

void eeprom5_get_status ( eeprom5_t * ctx,
status_data_t * stat_data )

Get status function.

The function read status data of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[out]stat_data: Pointer to the memory location where status data be stored.
Returns
Nothing.

◆ eeprom5_init()

err_t eeprom5_init ( eeprom5_t * ctx,
eeprom5_cfg_t * cfg )

EEPROM 5 initialization function.

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

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

◆ eeprom5_lock_id()

void eeprom5_lock_id ( eeprom5_t * ctx,
uint8_t lock_id )

Lock ID function.

The function lock ID instruction permanently locks the Identification page in read-only mode of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]lock_id: 8-bit data to be written.
Returns
Nothing.

◆ eeprom5_read_ident_page()

uint8_t eeprom5_read_ident_page ( eeprom5_t * ctx,
uint16_t addr )

Read identification page function.

The function read the identification page of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]addr: 9-bit register address.
Returns
8-bit read data.

◆ eeprom5_read_lock_status()

uint8_t eeprom5_read_lock_status ( eeprom5_t * ctx)

Reads the identification page lock status function.

The function read the the identification page lock status of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
Returns
Identification page lock status data.

◆ eeprom5_read_memory()

void eeprom5_read_memory ( eeprom5_t * ctx,
uint32_t addr,
uint8_t * p_rx_data,
uint8_t n_bytes )

Read EEPROM memory function.

The function read a sequential data starting from the targeted 19-bit register address of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]addr: 19-bit memory address.
[out]p_rx_data: Pointer to the memory location where data be stored.
[in]n_bytes: Number of bytes to be read.
Returns
Nothing.

◆ eeprom5_send_cmd()

void eeprom5_send_cmd ( eeprom5_t * ctx,
uint8_t cmd )

Send command function.

The function sends the desired command to the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]cmd: 8-bit commands instruction.
Returns
Nothing.

◆ eeprom5_set_hold()

void eeprom5_set_hold ( eeprom5_t * ctx,
uint8_t en_hold )

Enable hold operation function.

The function enable hold operation by sets the states of the HLD ( PWM ) pin depending on the function argument.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
en_hold: Pause or resume any serial communications with the device.
Returns
Nothing.

◆ eeprom5_set_status()

void eeprom5_set_status ( eeprom5_t * ctx,
status_data_t stat_data )

Set status function.

The function write status data of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[out]stat_data: Pointer to the memory location where status data be stored.
Returns
Nothing.

◆ eeprom5_set_write_protect()

void eeprom5_set_write_protect ( eeprom5_t * ctx,
uint8_t en_wr_prot )

Enable write protect function.

The function enables write protect, purpose of this input signal is to freeze the size of the area of memory that is protected against Write instructions.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]en_write_protect: The contents of memory registers will be protected or not.
Returns
Nothing.

◆ eeprom5_write_ident_page()

void eeprom5_write_ident_page ( eeprom5_t * ctx,
uint16_t addr,
uint8_t ident_data )

Write dentification page function.

The function writes the identification page of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]addr: 19-bit register address.
[in]ident_data: 8-bit data to be written.
Returns
Nothing.

◆ eeprom5_write_memory()

void eeprom5_write_memory ( eeprom5_t * ctx,
uint32_t addr,
uint8_t * p_tx_data,
uint8_t n_bytes )

Write EEPROM memory function.

The function writes a sequential data starting of the targeted 19-bit register address of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.

Parameters
[in]ctx: Click context object. See eeprom5_t object definition for detailed explanation.
[in]addr: 19-bit memory address.
[in]p_tx_data: Pointer to the data to be written.
[in]n_bytes: Number of bytes to be written.
Returns
Nothing.