eeprom13 2.1.0.0
eeprom13.h File Reference

This file contains API for EEPROM 13 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  eeprom13_t
 EEPROM 13 Click context object. More...
 
struct  eeprom13_cfg_t
 EEPROM 13 Click configuration object. More...
 

Macros

#define EEPROM13_REG_DEV_TYPE_IDENTIFIER   0xE000u
 EEPROM 13 description register.
 
#define EEPROM13_REG_CFG_DEVICE_ADDRESS   0xC000u
 
#define EEPROM13_REG_SW_WRITE_PROTECTION   0xA000u
 
#define EEPROM13_REG_IDENTIFICATION_PAGE   0x0000u
 
#define EEPROM13_REG_IDENTIFICATION_PAGE_LOCK   0x6000u
 
#define EEPROM13_MEMORY_ADDRESS_MIN   0x00000000ul
 EEPROM 13 mamory data values.
 
#define EEPROM13_MEMORY_ADDRESS_MAX   0x0001FFFFul
 
#define EEPROM13_MEMORY_ADDRESS_16_BIT_MASK   0x00010000ul
 
#define EEPROM13_MEMORY_ADDRESS_16_BIT   0x01
 
#define EEPROM13_PAGE_SIZE   256
 
#define EEPROM13_PAGE_MAX   512
 
#define EEPROM13_CDA_DAL_BIT_MASK   0x01
 EEPROM 13 configurable device address register data values.
 
#define EEPROM13_CDA_CEA_BIT_MASK   0x03
 
#define EEPROM13_SWP_WPL_MODIFIED   0x00
 EEPROM 13 software write protection register data values.
 
#define EEPROM13_SWP_WPL_FROZEN   0x01
 
#define EEPROM13_SWP_WPL_BIT_MASK   0x01
 
#define EEPROM13_SWP_BP_UPPER_QUARTE   0x00
 
#define EEPROM13_SWP_BP_UPPER_HALF   0x01
 
#define EEPROM13_SWP_BP_UPPER_THREE_QUARTE   0x02
 
#define EEPROM13_SWP_BP_WHOLE_MEM   0x03
 
#define EEPROM13_SWP_BP_BIT_MASK   0x06
 
#define EEPROM13_SWP_WPA_WRITE_ENABLE   0x00
 
#define EEPROM13_SWP_WPA_BLOCK_WRITE   0x01
 
#define EEPROM13_SWP_WPA_BIT_MASK   0x08
 
#define EEPROM13_DEFAULT_CHIP_ENABLE_ADDRESS   0x00
 EEPROM 13 default chip enable address.
 
#define EEPROM13_DEVICE_ADDRESS_MEMORY   0x50
 EEPROM 13 device address setting.
 
#define EEPROM13_DEVICE_ADDRESS_PAGE   0x58
 
#define EEPROM13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  eeprom13_return_value_t { EEPROM13_OK = 0 , EEPROM13_ERROR = -1 }
 EEPROM 13 Click return value data. More...
 

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

This file contains API for EEPROM 13 Click Driver.

Enumeration Type Documentation

◆ eeprom13_return_value_t

EEPROM 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
EEPROM13_OK 
EEPROM13_ERROR