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"
63#define EEPROM8_WRITE_ENABLE 0
64#define EEPROM8_WRITE_PROTECT 1
84#define EEPROM8_BLOCK_ADDR_START 0x0000
85#define EEPROM8_BLOCK_ADDR_END 0xFFFFul
98#define EEPROM8_NBYTES_MIN 1
99#define EEPROM8_NBYTES_PAGE 128
107#define EEPROM8_SET_DEV_ADDR 0x50
125#define EEPROM8_MAP_MIKROBUS( cfg, mikrobus ) \
126 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
127 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
128 cfg.wp = MIKROBUS( mikrobus, MIKROBUS_PWM );
eeprom8_return_value_t
EEPROM 8 Click return value data.
Definition eeprom8.h:189
@ EEPROM8_ERROR
Definition eeprom8.h:191
@ EEPROM8_OK
Definition eeprom8.h:190
eeprom_i2c_address_selector_t
Click address (memory block) selection.
Definition eeprom8.h:139
@ EEPROM_I2C_ADDR_SEL_2
Definition eeprom8.h:142
@ EEPROM_I2C_ADDR_SEL_6
Definition eeprom8.h:146
@ EEPROM_I2C_ADDR_SEL_5
Definition eeprom8.h:145
@ EEPROM_I2C_ADDR_SEL_4
Definition eeprom8.h:144
@ EEPROM_I2C_ADDR_SEL_0
Definition eeprom8.h:140
@ EEPROM_I2C_ADDR_SEL_3
Definition eeprom8.h:143
@ EEPROM_I2C_ADDR_SEL_1
Definition eeprom8.h:141
@ EEPROM_I2C_ADDR_SEL_7
Definition eeprom8.h:147
err_t eeprom8_init(eeprom8_t *ctx, eeprom8_cfg_t *cfg)
EEPROM 8 initialization function.
err_t eeprom8_write_page(eeprom8_t *ctx, uint16_t reg_addr, uint8_t *data_in)
Page Write function.
err_t eeprom8_write_byte(eeprom8_t *ctx, uint16_t reg_addr, uint8_t data_in)
Byte Write function.
err_t eeprom8_read_current_byte(eeprom8_t *ctx, uint8_t *data_out)
Byte Read function.
err_t eeprom8_read_sequential(eeprom8_t *ctx, uint16_t reg_addr, uint16_t n_bytes, uint8_t *data_out)
Sequential Read function.
err_t eeprom8_read_random_byte(eeprom8_t *ctx, uint16_t reg_addr, uint8_t *data_out)
Random Byte Read function.
void eeprom8_write_enable(eeprom8_t *ctx)
Write Enable function.
void eeprom8_write_protect(eeprom8_t *ctx)
Write Protect function.
void eeprom8_cfg_setup(eeprom8_cfg_t *cfg)
EEPROM 8 configuration object setup function.
EEPROM 8 Click configuration object.
Definition eeprom8.h:173
uint32_t i2c_speed
Definition eeprom8.h:179
pin_name_t wp
Definition eeprom8.h:177
pin_name_t scl
Definition eeprom8.h:174
pin_name_t sda
Definition eeprom8.h:175
uint8_t i2c_address
Definition eeprom8.h:180
EEPROM 8 Click context object.
Definition eeprom8.h:156
i2c_master_t i2c
Definition eeprom8.h:161
uint8_t slave_address
Definition eeprom8.h:164
digital_out_t wp
Definition eeprom8.h:158