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_i2c_master.h"
66#define FRAM3_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define FRAM3_RETVAL uint8_t
78#define FRAM3_INIT_ERROR 0xFF
85#define FRAM3_SLAVE_ADDR 0x50
92#define FRAM3_MAX_ADDR 0x6F
93#define FRAM3_MAX_BUF_SIZE 16
100#define FRAM3_CMD_AES_RNG_GEN 0x1D
101#define FRAM3_CMD_AES_CHALLENGE_RESPONSE_A 0x1B
102#define FRAM3_CMD_AES_CHALLENGE_RESPONSE_B 0x1E
103#define FRAM3_CMD_ID_READ 0x63
104#define FRAM3_CMD_AES_ID_READ_MAC_A 0x8B
105#define FRAM3_CMD_AES_ID_READ_MAC_B 0x8E
106#define FRAM3_CMD_COUNTER_READ 0x66
107#define FRAM3_CMD_COUNTER_INC 0x65
108#define FRAM3_CMD_AES_COUNTER_READ_MAC_A 0x2B
109#define FRAM3_CMD_AES_COUNTER_READ_MAC_B 0x2E
110#define FRAM3_CMD_AES_COUNTER_INC_MAC_A 0x4B
111#define FRAM3_CMD_AES_COUNTER_INC_MAC_B 0x4E
112#define FRAM3_CMD_OTW_FRAM_READ 0x2D
113#define FRAM3_CMD_OTW_FRAM_WRITE 0x27
114#define FRAM3_CMD_PROTECT_AREA_CONF 0xCA
115#define FRAM3_CMD_PROTECT_AREA_READ 0x8D
116#define FRAM3_CMD_PROTECT_AREA_WRITE 0x87
117#define FRAM3_CMD_MEMORY_RESET 0xA5
118#define FRAM3_CMD_FRAM_READ 0x4D
119#define FRAM3_CMD_FRAM_WRITE 0x47
120#define FRAM3_CMD_ID_WRITE 0xC3
121#define FRAM3_CMD_FUNC_CONF_WRITE 0xA6
122#define FRAM3_CMD_SEC_KEY_WRITE 0xA9
123#define FRAM3_CMD_PASSWORD_CHG 0xC9
124#define FRAM3_CMD_MIXING_CONST_WRITE 0xCC
125#define FRAM3_CMD_LIFE_CYCLE_CHG 0x6C
126#define FRAM3_CMD_STATUS_READ 0x6A
133#define FRAM3_SUCCESS 0xAA
134#define FRAM3_ERROR 0xBB
#define FRAM3_RETVAL
Definition fram3.h:75
void fram3_generic_read(fram3_t *ctx, uint8_t *tx_buf, uint8_t *data_buf, uint8_t len)
Generic read function.
void fram3_cfg_setup(fram3_cfg_t *cfg)
Config Object Initialization function.
void fram3_generic_write(fram3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
uint8_t fram3_read_free_access_memory(fram3_t *ctx, uint8_t start_addr, uint8_t *data_buf, uint8_t n_buf_size)
Memory read function.
uint8_t fram3_write_free_access_memory(fram3_t *ctx, uint8_t start_addr, uint8_t *data_buf, uint8_t n_buf_size)
Memory write function.
FRAM3_RETVAL fram3_init(fram3_t *ctx, fram3_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition fram3.h:163
uint32_t i2c_speed
Definition fram3.h:171
pin_name_t scl
Definition fram3.h:166
pin_name_t sda
Definition fram3.h:167
uint8_t i2c_address
Definition fram3.h:172
Click ctx object definition.
Definition fram3.h:148
i2c_master_t i2c
Definition fram3.h:151
uint8_t slave_address
Definition fram3.h:155