39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define EEPROM12_REG_IDENTIFICATION_PAGE 0x0000u
74#define EEPROM12_REG_IDENTIFICATION_PAGE_LOCK 0x0200u
75#define EEPROM12_REG_CONFIG_DEVICE_ADDRESS 0xC000u
93#define EEPROM12_MEMORY_ADDRESS_MIN 0x0000u
94#define EEPROM12_MEMORY_ADDRESS_MAX 0x7FFFu
95#define EEPROM12_PAGE_SIZE 64
96#define EEPROM12_PAGE_MAX 512
102#define EEPROM12_CDA_DAL_BIT_MASK 0x01
103#define EEPROM12_CDA_CEA_BIT_MASK 0x07
109#define EEPROM12_DEFAULT_CHIP_ENABLE_ADDRESS 0x00
116#define EEPROM12_DEVICE_ADDRESS_MEMORY 0x50
117#define EEPROM12_DEVICE_ADDRESS_PAGE 0x58
135#define EEPROM12_MAP_MIKROBUS( cfg, mikrobus ) \
136 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
137 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
138 cfg.wc = MIKROBUS( mikrobus, MIKROBUS_PWM )
eeprom12_return_value_t
EEPROM 12 Click return value data.
Definition eeprom12.h:183
@ EEPROM12_ERROR
Definition eeprom12.h:185
@ EEPROM12_OK
Definition eeprom12.h:184
void eeprom12_cfg_setup(eeprom12_cfg_t *cfg)
EEPROM 12 configuration object setup function.
err_t eeprom12_memory_read(eeprom12_t *ctx, uint16_t mem_addr, uint8_t *data_out, uint8_t len)
EEPROM 12 memory read function.
err_t eeprom12_memory_page_write(eeprom12_t *ctx, uint16_t page_addr, uint8_t *data_in, uint8_t len)
EEPROM 12 memory page write function.
err_t eeprom12_id_page_read(eeprom12_t *ctx, uint16_t id_page_addr, uint8_t *data_out)
EEPROM 12 identification page read function.
void eeprom12_write_disable(eeprom12_t *ctx)
EEPROM 12 write disable function.
err_t eeprom12_id_page_write(eeprom12_t *ctx, uint16_t id_page_addr, uint8_t *data_in)
EEPROM 12 identification page write function.
err_t eeprom12_read_lock_status(eeprom12_t *ctx, uint8_t *lock_status)
EEPROM 12 read lock status function.
err_t eeprom12_memory_write(eeprom12_t *ctx, uint16_t mem_addr, uint8_t *data_in, uint8_t len)
EEPROM 12 memory write function.
void eeprom12_write_enable(eeprom12_t *ctx)
EEPROM 12 write enable function.
err_t eeprom12_memory_page_read(eeprom12_t *ctx, uint16_t page_addr, uint8_t *data_out, uint8_t len)
EEPROM 12 memory page read function.
err_t eeprom12_generic_read(eeprom12_t *ctx, uint16_t reg, uint8_t *data_out, uint8_t len)
EEPROM 12 I2C reading function.
err_t eeprom12_generic_write(eeprom12_t *ctx, uint16_t reg, uint8_t *data_in, uint8_t len)
EEPROM 12 I2C writing function.
err_t eeprom12_init(eeprom12_t *ctx, eeprom12_cfg_t *cfg)
EEPROM 12 initialization function.
err_t eeprom12_config_dev_addr(eeprom12_t *ctx, uint8_t cda, uint8_t dal)
EEPROM 12 configuate device address function.
EEPROM 12 Click configuration object.
Definition eeprom12.h:167
uint32_t i2c_speed
Definition eeprom12.h:173
pin_name_t wc
Definition eeprom12.h:171
pin_name_t scl
Definition eeprom12.h:168
pin_name_t sda
Definition eeprom12.h:169
uint8_t i2c_address
Definition eeprom12.h:174
EEPROM 12 Click context object.
Definition eeprom12.h:148
digital_out_t wc
Definition eeprom12.h:150
uint8_t chip_en_addr
Definition eeprom12.h:158
i2c_master_t i2c
Definition eeprom12.h:153
uint8_t slave_address
Definition eeprom12.h:156