eeprom6 2.0.0.0
EEPROM 6 Click Driver

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

Topics

 EEPROM 6 Commands List
 List of commands of EEPROM 6 Click driver.
 
 EEPROM 6 Settings
 Settings of EEPROM 6 Click driver.
 
 EEPROM 6 MikroBUS Map
 MikroBUS pin mapping of EEPROM 6 Click driver.
 

Functions

void eeprom6_cfg_setup (eeprom6_cfg_t *cfg)
 EEPROM 6 configuration object setup function.
 
void eeprom6_gpio_selection (eeprom6_cfg_t *cfg, eeprom6_gpio_sel_t gpio_sel)
 EEPROM 6 driver interface setup function.
 
err_t eeprom6_init (eeprom6_t *ctx, eeprom6_cfg_t *cfg)
 EEPROM 6 initialization function.
 
err_t eeprom6_default_cfg (eeprom6_t *ctx)
 EEPROM 6 default configuration function.
 
err_t eeprom6_check_communication (eeprom6_t *ctx)
 EEPROM 6 check communication function.
 
err_t eeprom6_select_device (eeprom6_t *ctx)
 EEPROM 6 select device function.
 
err_t eeprom6_read_scratchpad (eeprom6_t *ctx, uint8_t *scratchpad, uint8_t scratchpad_len)
 EEPROM 6 read scratchpad function.
 
err_t eeprom6_write_scratchpad (eeprom6_t *ctx, uint8_t *scratchpad, uint8_t scratchpad_len)
 EEPROM 6 write scratchpad function.
 
err_t eeprom6_read_mem (eeprom6_t *ctx, uint16_t reg_adr, uint8_t *data_in, uint16_t n_len)
 EEPROM 6 read memory function.
 
err_t eeprom6_write_mem (eeprom6_t *ctx, uint16_t reg_adr, uint8_t *data_in, uint16_t n_len)
 EEPROM 6 write memory function.
 

Detailed Description

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

◆ eeprom6_cfg_setup()

void eeprom6_cfg_setup ( eeprom6_cfg_t * cfg)

EEPROM 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ eeprom6_check_communication()

err_t eeprom6_check_communication ( eeprom6_t * ctx)

EEPROM 6 check communication function.

This function checks the communication by reading the ROM address twice and comparing the two results, as well as verifying the family code byte.

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

◆ eeprom6_default_cfg()

err_t eeprom6_default_cfg ( eeprom6_t * ctx)

EEPROM 6 default configuration function.

This function executes a default configuration of EEPROM 6 click board.

Parameters
[in]ctx: Click context object. See eeprom6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ eeprom6_gpio_selection()

void eeprom6_gpio_selection ( eeprom6_cfg_t * cfg,
eeprom6_gpio_sel_t gpio_sel )

EEPROM 6 driver interface setup function.

This function sets a communication GPIO pin which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See eeprom6_cfg_t object definition for detailed explanation.
[in]gpio_sel: GPIO pin selection. See eeprom6_gpio_sel_t object definition for detailed explanation.
Returns
Nothing.
Note
This gpio selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ eeprom6_init()

err_t eeprom6_init ( eeprom6_t * ctx,
eeprom6_cfg_t * cfg )

EEPROM 6 initialization function.

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

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

◆ eeprom6_read_mem()

err_t eeprom6_read_mem ( eeprom6_t * ctx,
uint16_t reg_adr,
uint8_t * data_in,
uint16_t n_len )

EEPROM 6 read memory function.

This function reads a sequential data starting from the targeted 16-bit register address of the DS28EC20.

Parameters
[in]ctx: Click context object. See eeprom6_t object definition for detailed explanation.
[in]reg_adr: 16-bit memory address.
[in]data_in: Pointer to the memory location where data to be stored.
[in]n_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom6_read_scratchpad()

err_t eeprom6_read_scratchpad ( eeprom6_t * ctx,
uint8_t * scratchpad,
uint8_t scratchpad_len )

EEPROM 6 read scratchpad function.

This function reads a desired number of scratchpad bytes using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See eeprom6_t object definition for detailed explanation.
[out]scratchpad: Output read scratchpad.
[in]scratchpad_len: Scratchpad length in bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom6_select_device()

err_t eeprom6_select_device ( eeprom6_t * ctx)

EEPROM 6 select device function.

This function selects the device by performing a skip or match ROM commands depending on the address value set in the ctx->address.

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

◆ eeprom6_write_mem()

err_t eeprom6_write_mem ( eeprom6_t * ctx,
uint16_t reg_adr,
uint8_t * data_in,
uint16_t n_len )

EEPROM 6 write memory function.

This function writes a sequential data starting of the targeted 16-bit register address of the DS28EC20.

Parameters
[in]ctx: Click context object. See eeprom6_t object definition for detailed explanation.
[in]reg_adr: Target address to which data is copied from the scratchpad.
[in]data_in: Pointer to the data to be written.
[in]n_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom6_write_scratchpad()

err_t eeprom6_write_scratchpad ( eeprom6_t * ctx,
uint8_t * scratchpad,
uint8_t scratchpad_len )

EEPROM 6 write scratchpad function.

This function writes a desired number of scratchpad bytes using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See eeprom6_t object definition for detailed explanation.
[in]scratchpad: Scratchpad to be written.
[in]scratchpad_len: Scratchpad length in bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.