eeram3 2.0.0.0
eeram3.h File Reference

This file contains API for EERAM 3 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  eeram3_t
 EERAM 3 Click context object. More...
 
struct  eeram3_cfg_t
 EERAM 3 Click configuration object. More...
 

Macros

#define EERAM3_OPCODE_WREN   0x06
 EERAM 3 Opcode Commands list.
 
#define EERAM3_OPCODE_WRDI   0x04
 
#define EERAM3_OPCODE_WRITE   0x02
 
#define EERAM3_OPCODE_READ   0x03
 
#define EERAM3_OPCODE_RDLSWA   0x0A
 
#define EERAM3_OPCODE_SECURE_WRITE   0x12
 
#define EERAM3_OPCODE_SECURE_READ   0x13
 
#define EERAM3_OPCODE_WRSR   0x01
 
#define EERAM3_OPCODE_RDSR   0x05
 
#define EERAM3_OPCODE_STORE   0x08
 
#define EERAM3_OPCODE_RECALL   0x09
 
#define EERAM3_OPCODE_WRNUR   0xC2
 
#define EERAM3_OPCODE_RDNUR   0xC3
 
#define EERAM3_OPCODE_HIBERNATE   0xB9
 
#define EERAM3_RDY_BIT_MASK   0x01
 EERAM 3 status register bits mask.
 
#define EERAM3_WEL_BIT_MASK   0x02
 
#define EERAM3_BLOCK_PROTECT_BITS_MASK   0x0C
 
#define EERAM3_BLOCK_PROTECT_NONE   0x00
 
#define EERAM3_BLOCK_PROTECT_UPPER_QUARTER   0x04
 
#define EERAM3_BLOCK_PROTECT_UPPER_HALF   0x08
 
#define EERAM3_BLOCK_PROTECT_ALL   0x0C
 
#define EERAM3_SWM_BIT_MASK   0x10
 
#define EERAM3_PRO_BIT_MASK   0x20
 
#define EERAM3_ASE_BIT_MASK   0x40
 
#define EERAM3_MIN_ADDRESS   0x0000
 EERAM 3 memory address range.
 
#define EERAM3_MAX_ADDRESS   0x7FFF
 
#define EERAM3_MAX_PAGE_ADDRESS   0x3F
 
#define EERAM3_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define EERAM3_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define EERAM3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  eeram3_return_value_t { EERAM3_OK = 0 , EERAM3_ERROR = -1 }
 EERAM 3 Click return value data. More...
 

Functions

void eeram3_cfg_setup (eeram3_cfg_t *cfg)
 EERAM 3 configuration object setup function.
 
err_t eeram3_init (eeram3_t *ctx, eeram3_cfg_t *cfg)
 EERAM 3 initialization function.
 
void eeram3_default_cfg (eeram3_t *ctx)
 EERAM 3 default configuration function.
 
err_t eeram3_write_opcode (eeram3_t *ctx, uint8_t opcode)
 EERAM 3 write opcode function.
 
err_t eeram3_read_opcode (eeram3_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len)
 EERAM 3 read opcode function.
 
void eeram3_set_hld_pin (eeram3_t *ctx, uint8_t state)
 EERAM 3 set HLD pin function.
 
err_t eeram3_enable_write (eeram3_t *ctx)
 EERAM 3 enable write function.
 
err_t eeram3_disable_write (eeram3_t *ctx)
 EERAM 3 disable write function.
 
err_t eeram3_set_block_protection (eeram3_t *ctx, uint8_t block_protect)
 EERAM 3 set block protection function.
 
err_t eeram3_write_status (eeram3_t *ctx, uint8_t status)
 EERAM 3 write status function.
 
err_t eeram3_read_status (eeram3_t *ctx, uint8_t *status)
 EERAM 3 read status function.
 
err_t eeram3_enter_hibernate_mode (eeram3_t *ctx)
 EERAM 3 enter hibernate mode function.
 
void eeram3_wakeup_from_hibernate (eeram3_t *ctx)
 EERAM 3 wake up from hibernate function.
 
err_t eeram3_memory_write (eeram3_t *ctx, uint16_t address, uint8_t *data_in, uint16_t len)
 EERAM 3 memory write function.
 
err_t eeram3_memory_read (eeram3_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len)
 EERAM 3 memory read function.
 
err_t eeram3_memory_secure_write (eeram3_t *ctx, uint16_t address, uint8_t *data_in, uint8_t len)
 EERAM 3 memory write function.
 
err_t eeram3_memory_secure_read (eeram3_t *ctx, uint16_t address, uint8_t *data_out, uint8_t len)
 EERAM 3 memory secure read function.
 
err_t eeram3_read_last_written_address (eeram3_t *ctx, uint16_t *address)
 EERAM 3 read last written address function.
 
err_t eeram3_nv_user_space_write (eeram3_t *ctx, uint16_t data_in)
 EERAM 3 nv user space write function.
 
err_t eeram3_nv_user_space_read (eeram3_t *ctx, uint16_t *data_out)
 EERAM 3 nv user space read function.
 
err_t eeram3_store_data (eeram3_t *ctx)
 EERAM 3 store data function.
 
err_t eeram3_recall_data (eeram3_t *ctx)
 EERAM 3 recall data function.
 
err_t eeram3_autostore_enable (eeram3_t *ctx)
 EERAM 3 autostore enable function.
 
err_t eeram3_autostore_disable (eeram3_t *ctx)
 EERAM 3 autostore disable function.
 

Detailed Description

This file contains API for EERAM 3 Click Driver.

Enumeration Type Documentation

◆ eeram3_return_value_t

EERAM 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
EERAM3_OK 
EERAM3_ERROR