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"
68#define FRAM_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.hld = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.wp = MIKROBUS( mikrobus, MIKROBUS_PWM )
81#define FRAM_RETVAL uint8_t
84#define FRAM_INIT_ERROR 0xFF
96#define FRAM_WRITE 0x02
103#define FRAM_WPEN 0x80
108#define FRAM_MEM_SIZE 0x8000
#define FRAM_RETVAL
Definition fram.h:81
void fram_read(fram_t *ctx, uint16_t address, uint8_t *buffer, uint16_t count)
Fram read function.
void fram_write(fram_t *ctx, uint16_t address, uint8_t *buffer, uint16_t count)
Fram write function.
void fram_generic_transfer(fram_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
uint8_t fram_read_status(fram_t *ctx)
Fram click Read Status function.
void fram_write_status(fram_t *ctx, uint8_t value)
Fram click Write Status function.
void fram_erase_all(fram_t *ctx)
Fram erase all function.
FRAM_RETVAL fram_init(fram_t *ctx, fram_cfg_t *cfg)
Initialization function.
void fram_cfg_setup(fram_cfg_t *cfg)
Config Object Initialization function.
void fram_init_f(fram_t *ctx)
Fram click init function.
void fram_write_enable(fram_t *ctx)
Fram click Write Enable function.
void fram_write_disable(fram_t *ctx)
Fram click Write Disable function.
Click configuration structure definition.
Definition fram.h:140
pin_name_t hld
Definition fram.h:150
spi_master_chip_select_polarity_t cs_polarity
Definition fram.h:157
pin_name_t sck
Definition fram.h:145
spi_master_mode_t spi_mode
Definition fram.h:156
pin_name_t mosi
Definition fram.h:144
uint32_t spi_speed
Definition fram.h:155
pin_name_t wp
Definition fram.h:151
pin_name_t miso
Definition fram.h:143
pin_name_t cs
Definition fram.h:146
Click ctx object definition.
Definition fram.h:122
digital_out_t cs
Definition fram.h:125
digital_out_t hld
Definition fram.h:126
spi_master_t spi
Definition fram.h:131
pin_name_t chip_select
Definition fram.h:132
digital_out_t wp
Definition fram.h:127