eeprom9 2.1.0.0
EEPROM 9 Click Driver

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

Topics

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

Functions

void eeprom9_cfg_setup (eeprom9_cfg_t *cfg)
 EEPROM 9 configuration object setup function.
 
err_t eeprom9_init (eeprom9_t *ctx, eeprom9_cfg_t *cfg)
 EEPROM 9 initialization function.
 
err_t eeprom9_generic_write (eeprom9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 EEPROM 9 data writing function.
 
err_t eeprom9_generic_read (eeprom9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 EEPROM 9 data reading function.
 
void eeprom9_set_hold (eeprom9_t *ctx, uint8_t en_hold)
 EEPROM 9 set hold pin state function.
 
void eeprom9_set_write_protection (eeprom9_t *ctx, uint8_t en_wp)
 EEPROM 9 set write protection state function.
 
err_t eeprom9_send_cmd (eeprom9_t *ctx, uint8_t cmd)
 EEPROM 9 send command function.
 
err_t eeprom9_set_write_enable (eeprom9_t *ctx, uint8_t en_write)
 EEPROM 9 enable write function.
 
err_t eeprom9_read_memory (eeprom9_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t len)
 EEPROM 9 memory reading function.
 
err_t eeprom9_write_memory (eeprom9_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t len)
 EEPROM 9 memory writing function.
 
err_t eeprom5_get_status_reg (eeprom9_t *ctx, uint8_t *status_data)
 EEPROM 9 read status function.
 
err_t eeprom9_chip_erase (eeprom9_t *ctx)
 EEPROM 9 chip memory erase function.
 
err_t eeprom9_block_erase (eeprom9_t *ctx, uint32_t block_addr)
 EEPROM 9 memory block erase function.
 
err_t eeprom9_sector_erase (eeprom9_t *ctx, uint32_t sector_addr)
 EEPROM 9 memory sector erase function.
 
err_t eeprom9_page_erase (eeprom9_t *ctx, uint32_t page_addr)
 EEPROM 9 memory page erase function.
 
err_t eeprom9_read_identification (eeprom9_t *ctx, id_data_t *id_data)
 EEPROM 9 read identification function.
 

Detailed Description

API for configuring and manipulating EEPROM 9 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_get_status_reg()

err_t eeprom5_get_status_reg ( eeprom9_t * ctx,
uint8_t * status_data )

EEPROM 9 read status function.

This function is used to read the status register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[out]status_data: Status register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To use this function memory writing needs to be enabled.

◆ eeprom9_block_erase()

err_t eeprom9_block_erase ( eeprom9_t * ctx,
uint32_t block_addr )

EEPROM 9 memory block erase function.

This function is used to erase the memory block specified by the memory address.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]block_addr: Block memory address.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To use this function memory writing needs to be enabled.

◆ eeprom9_cfg_setup()

void eeprom9_cfg_setup ( eeprom9_cfg_t * cfg)

EEPROM 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ eeprom9_chip_erase()

err_t eeprom9_chip_erase ( eeprom9_t * ctx)

EEPROM 9 chip memory erase function.

This function is used to erase the whole content of the memory.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To use this function memory writing needs to be enabled.

◆ eeprom9_generic_read()

err_t eeprom9_generic_read ( eeprom9_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

EEPROM 9 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 eeprom9_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.

◆ eeprom9_generic_write()

err_t eeprom9_generic_write ( eeprom9_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

EEPROM 9 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 eeprom9_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.

◆ eeprom9_init()

err_t eeprom9_init ( eeprom9_t * ctx,
eeprom9_cfg_t * cfg )

EEPROM 9 initialization function.

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

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

◆ eeprom9_page_erase()

err_t eeprom9_page_erase ( eeprom9_t * ctx,
uint32_t page_addr )

EEPROM 9 memory page erase function.

This function is used to erase the memory page specified by the memory address.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]page_addr: Page memory address.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To use this function memory writing needs to be enabled.

◆ eeprom9_read_identification()

err_t eeprom9_read_identification ( eeprom9_t * ctx,
id_data_t * id_data )

EEPROM 9 read identification function.

This function reads an identification value by using SPI serial interface.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[out]id_data: Id data values.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom9_read_memory()

err_t eeprom9_read_memory ( eeprom9_t * ctx,
uint32_t mem_addr,
uint8_t * data_out,
uint8_t len )

EEPROM 9 memory reading function.

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

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]mem_addr: Start memory 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.

◆ eeprom9_sector_erase()

err_t eeprom9_sector_erase ( eeprom9_t * ctx,
uint32_t sector_addr )

EEPROM 9 memory sector erase function.

This function is used to erase the memory sector specified by the memory address.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]sector_addr: Sector memory address.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To use this function memory writing needs to be enabled.

◆ eeprom9_send_cmd()

err_t eeprom9_send_cmd ( eeprom9_t * ctx,
uint8_t cmd )

EEPROM 9 send command function.

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

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]cmd: Command to be sent.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom9_set_hold()

void eeprom9_set_hold ( eeprom9_t * ctx,
uint8_t en_hold )

EEPROM 9 set hold pin state function.

This function sets a hold pin level.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]en_hold: Hold state.
Returns
Nothing.
Note
None.

◆ eeprom9_set_write_enable()

err_t eeprom9_set_write_enable ( eeprom9_t * ctx,
uint8_t en_write )

EEPROM 9 enable write function.

This function writes a command to enable or disable writing into memory by using SPI serial interface.

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

◆ eeprom9_set_write_protection()

void eeprom9_set_write_protection ( eeprom9_t * ctx,
uint8_t en_wp )

EEPROM 9 set write protection state function.

This function sets a hold pin level.

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]en_wp: Write protection state.
Returns
Nothing.
Note
None.

◆ eeprom9_write_memory()

err_t eeprom9_write_memory ( eeprom9_t * ctx,
uint32_t mem_addr,
uint8_t * data_in,
uint8_t len )

EEPROM 9 memory writing function.

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

Parameters
[in]ctx: Click context object. See eeprom9_t object definition for detailed explanation.
[in]mem_addr: Start memory 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
To use this function memory writing needs to be enabled.