sram3 2.0.0.0
sram3.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  sram3_t
 SRAM 3 Click context object. More...
 
struct  sram3_cfg_t
 SRAM 3 Click configuration object. More...
 

Macros

#define SRAM3_OPCODE_WREN   0x06
 SRAM 3 description setting.
 
#define SRAM3_OPCODE_WRDI   0x04
 
#define SRAM3_OPCODE_RDSR   0x05
 
#define SRAM3_OPCODE_WRSR   0x01
 
#define SRAM3_OPCODE_READ   0x03
 
#define SRAM3_OPCODE_SECURE_READ   0x13
 
#define SRAM3_OPCODE_WRITE   0x02
 
#define SRAM3_OPCODE_SECURE_WRITE   0x12
 
#define SRAM3_OPCODE_STORE   0x08
 
#define SRAM3_OPCODE_RECALL   0x09
 
#define SRAM3_OPCODE_WRSNR   0xC2
 
#define SRAM3_OPCODE_RDSNR   0xC3
 
#define SRAM3_OPCODE_HIBERNATE   0xB9
 
#define SRAM3_PROT_NONE   0x00
 SRAM 3 protection ranges.
 
#define SRAM3_PROT_QUART   0x04
 
#define SRAM3_PROT_HALF   0x08
 
#define SRAM3_PROT_ALL   0x0C
 
#define SRAM3_STATS_RDY_BIT   0x01
 SRAM 3 status register bits.
 
#define SRAM3_STATS_WEN_BIT   0x02
 
#define SRAM3_STATS_SWM_BIT   0x10
 
#define SRAM3_STATS_PDIS_BIT   0x40
 
#define SRAM3_SERIAL_LEN   0x10
 SRAM 3 some predefined buffer sizes.
 
#define SRAM3_SECURE_BUF_SIZE   0x80
 
#define SRAM3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  sram3_return_value_t { SRAM3_OK = 0 , SRAM3_ERROR = -1 }
 SRAM 3 Click return value data. More...
 

Functions

void sram3_cfg_setup (sram3_cfg_t *cfg)
 SRAM 3 configuration object setup function.
 
err_t sram3_init (sram3_t *ctx, sram3_cfg_t *cfg)
 SRAM 3 initialization function.
 
err_t sram3_generic_write (sram3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 SRAM 3 data writing function.
 
err_t sram3_generic_read (sram3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 SRAM 3 data reading function.
 
void sram3_enable_write (sram3_t *ctx)
 SRAM 3 enabling writing to memory function.
 
void sram3_disable_write (sram3_t *ctx)
 SRAM 3 disabling writing to memory function.
 
uint8_t sram3_read_status (sram3_t *ctx)
 SRAM 3 reading function.
 
void sram3_write_status (sram3_t *ctx, uint8_t status)
 SRAM 3 writing function.
 
void sram3_protect_memory (sram3_t *ctx, uint8_t protect_range)
 SRAM 3 secures memory function.
 
void sram3_enable_pdis (sram3_t *ctx)
 SRAM 3 set up enable function.
 
void sram3_disable_pdis (sram3_t *ctx)
 SRAM 3 set up disable function.
 
void sram3_recall (sram3_t *ctx)
 SRAM 3 relocation data function.
 
void sram3_store (sram3_t *ctx)
 SRAM 3 relocation data function.
 
void sram3_hibernate_start (sram3_t *ctx)
 SRAM 3 changing function.
 
void sram3_hibernate_stop (sram3_t *ctx)
 SRAM 3 changing function.
 
void sram3_hold (sram3_t *ctx)
 SRAM 3 changing pin state function.
 
void sram3_release_hold (sram3_t *ctx)
 SRAM 3 changing pin state function.
 
void sram3_read_serial (sram3_t *ctx, uint8_t *buf)
 SRAM 3 reading number function.
 
void sram3_write_serial (sram3_t *ctx, uint8_t *buf)
 SRAM 3 writing number function.
 
void sram3_read (sram3_t *ctx, uint32_t mem_adr, uint8_t *read_buf, uint8_t buf_size)
 SRAM 3 reading data function.
 
err_t sram3_secure_read (sram3_t *ctx, uint32_t mem_adr, uint8_t *read_buf, uint8_t buf_size)
 SRAM 3 secure reading data function.
 
void sram3_write (sram3_t *ctx, uint32_t mem_adr, uint8_t *write_buf, uint8_t buf_size)
 SRAM 3 writing data function.
 
err_t sram3_secure_write (sram3_t *ctx, uint32_t mem_adr, uint8_t *write_buf, uint8_t buf_size)
 SRAM 3 secure writing data function.
 

Detailed Description

This file contains API for SRAM 3 Click Driver.

Enumeration Type Documentation

◆ sram3_return_value_t

SRAM 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
SRAM3_OK 
SRAM3_ERROR