fram3 2.0.0.0
fram3.h File Reference

This file contains API for FRAM 3 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  fram3_t
 Click ctx object definition. More...
 
struct  fram3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define FRAM3_MAP_MIKROBUS(cfg, mikrobus)
 
#define FRAM3_RETVAL   uint8_t
 
#define FRAM3_OK   0x00
 
#define FRAM3_INIT_ERROR   0xFF
 
#define FRAM3_SLAVE_ADDR   0x50
 
#define FRAM3_MAX_ADDR   0x6F
 
#define FRAM3_MAX_BUF_SIZE   16
 
#define FRAM3_CMD_AES_RNG_GEN   0x1D
 
#define FRAM3_CMD_AES_CHALLENGE_RESPONSE_A   0x1B
 
#define FRAM3_CMD_AES_CHALLENGE_RESPONSE_B   0x1E
 
#define FRAM3_CMD_ID_READ   0x63
 
#define FRAM3_CMD_AES_ID_READ_MAC_A   0x8B
 
#define FRAM3_CMD_AES_ID_READ_MAC_B   0x8E
 
#define FRAM3_CMD_COUNTER_READ   0x66
 
#define FRAM3_CMD_COUNTER_INC   0x65
 
#define FRAM3_CMD_AES_COUNTER_READ_MAC_A   0x2B
 
#define FRAM3_CMD_AES_COUNTER_READ_MAC_B   0x2E
 
#define FRAM3_CMD_AES_COUNTER_INC_MAC_A   0x4B
 
#define FRAM3_CMD_AES_COUNTER_INC_MAC_B   0x4E
 
#define FRAM3_CMD_OTW_FRAM_READ   0x2D
 
#define FRAM3_CMD_OTW_FRAM_WRITE   0x27
 
#define FRAM3_CMD_PROTECT_AREA_CONF   0xCA
 
#define FRAM3_CMD_PROTECT_AREA_READ   0x8D
 
#define FRAM3_CMD_PROTECT_AREA_WRITE   0x87
 
#define FRAM3_CMD_MEMORY_RESET   0xA5
 
#define FRAM3_CMD_FRAM_READ   0x4D
 
#define FRAM3_CMD_FRAM_WRITE   0x47
 
#define FRAM3_CMD_ID_WRITE   0xC3
 
#define FRAM3_CMD_FUNC_CONF_WRITE   0xA6
 
#define FRAM3_CMD_SEC_KEY_WRITE   0xA9
 
#define FRAM3_CMD_PASSWORD_CHG   0xC9
 
#define FRAM3_CMD_MIXING_CONST_WRITE   0xCC
 
#define FRAM3_CMD_LIFE_CYCLE_CHG   0x6C
 
#define FRAM3_CMD_STATUS_READ   0x6A
 
#define FRAM3_SUCCESS   0xAA
 
#define FRAM3_ERROR   0xBB
 

Functions

void fram3_cfg_setup (fram3_cfg_t *cfg)
 Config Object Initialization function.
 
FRAM3_RETVAL fram3_init (fram3_t *ctx, fram3_cfg_t *cfg)
 Initialization function.
 
void fram3_generic_write (fram3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void fram3_generic_read (fram3_t *ctx, uint8_t *tx_buf, uint8_t *data_buf, uint8_t len)
 Generic read 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.
 

Detailed Description

This file contains API for FRAM 3 Click driver.