42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
67#define EEPROM2_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define EEPROM2_ERROR -1
void eeprom2_memory_disable(eeprom2_t *ctx)
Disable EEPROM memory.
void eeprom2_write(eeprom2_t *ctx, uint32_t memory_address, uint8_t value)
Generic write function.
void eeprom2_write_bytes(eeprom2_t *ctx, uint32_t memory_address, uint8_t *value, uint8_t count)
Function to write bytes.
void eeprom2_cfg_setup(eeprom2_cfg_t *cfg)
Config Object Initialization function.
void eeprom2_memory_enable(eeprom2_t *ctx)
Enable EEPROM memory.
uint8_t eeprom2_read(eeprom2_t *ctx, uint32_t memory_address)
Generic read function.
err_t eeprom2_init(eeprom2_t *ctx, eeprom2_cfg_t *cfg)
Initialization function.
void eeprom2_read_bytes(eeprom2_t *ctx, uint32_t memory_address, uint8_t *value, uint8_t count)
Function to read bytes.
Click configuration structure definition.
Definition eeprom2.h:107
spi_master_chip_select_polarity_t cs_polarity
Definition eeprom2.h:119
pin_name_t sck
Definition eeprom2.h:112
spi_master_mode_t spi_mode
Definition eeprom2.h:118
pin_name_t mosi
Definition eeprom2.h:111
uint32_t spi_speed
Definition eeprom2.h:117
pin_name_t miso
Definition eeprom2.h:110
pin_name_t cs
Definition eeprom2.h:113
Click ctx object definition.
Definition eeprom2.h:93
digital_out_t cs
Definition eeprom2.h:94
spi_master_t spi
Definition eeprom2.h:98
pin_name_t chip_select
Definition eeprom2.h:99