reram2 2.0.0.0
reram2.h File Reference

This file contains API for ReRAM 2 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  reram2_t
 ReRAM 2 Click context object. More...
 
struct  reram2_cfg_t
 ReRAM 2 Click configuration object. More...
 
struct  reram2_status_t
 ReRAM 2 Click status object. More...
 
struct  reram2_dev_id_t
 ReRAM 2 Click status object. More...
 

Macros

#define RERAM2_CMD_WREN   0x06
 ReRAM 2 description commands.
 
#define RERAM2_CMD_WRDI   0x04
 
#define RERAM2_CMD_RDSR   0x05
 
#define RERAM2_CMD_WRSR   0x01
 
#define RERAM2_CMD_READ   0x03
 
#define RERAM2_CMD_WRITE   0x02
 
#define RERAM2_CMD_RDID   0x9F
 
#define RERAM2_CMD_RDUID   0x83
 
#define RERAM2_CMD_SLEEP   0xB9
 
#define RERAM2_CMD_PWDN   0xE2
 
#define RERAM2_DEVICE_ID   0x047FAA03
 ReRAM 2 Device ID values.
 
#define RERAM2_MANUFACTURER_ID   0x04
 
#define RERAM2_CONTINUATION_CODE   0x7F
 
#define RERAM2_PRODUCT_ID   0xAA03
 
#define RERAM2_HOLD_ENABLE   0x00
 ReRAM 2 Hold pin state.
 
#define RERAM2_HOLD_DISABLE   0x01
 
#define RERAM2_WP_ENABLE   0x00
 ReRAM 2 Write protect pin state.
 
#define RERAM2_WP_DISABLE   0x01
 
#define RERAM2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define RERAM2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define RERAM2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  reram2_return_value_t { RERAM2_OK = 0 , RERAM2_ERROR = -1 }
 ReRAM 2 Click return value data. More...
 

Functions

void reram2_cfg_setup (reram2_cfg_t *cfg)
 ReRAM 2 configuration object setup function.
 
err_t reram2_init (reram2_t *ctx, reram2_cfg_t *cfg)
 ReRAM 2 initialization function.
 
err_t reram2_default_cfg (reram2_t *ctx)
 ReRAM 2 default configuration function.
 
err_t reram2_generic_write (reram2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 ReRAM 2 data writing function.
 
err_t reram2_generic_read (reram2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 ReRAM 2 data reading function.
 
err_t reram2_set_hold (reram2_t *ctx, uint8_t en_hold)
 ReRAM 2 set hold function.
 
err_t reram2_set_write_protect (reram2_t *ctx, uint8_t en_wp)
 ReRAM 2 write protection function.
 
err_t reram2_wake_up (reram2_t *ctx)
 ReRAM 2 wake up function.
 
err_t reram2_send_command (reram2_t *ctx, uint8_t cmd)
 ReRAM 2 set command function.
 
err_t reram2_get_status (reram2_t *ctx, reram2_status_t *status)
 ReRAM 2 get status function.
 
err_t reram2_read_device_id (reram2_t *ctx, reram2_dev_id_t *dev_id)
 ReRAM 2 read device ID function.
 
err_t reram2_check_device_id (reram2_t *ctx)
 ReRAM 2 check device ID function.
 
err_t reram2_write_memory (reram2_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint16_t len)
 ReRAM 2 write memory function.
 
err_t reram2_read_memory (reram2_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint16_t len)
 ReRAM 2 read memory function.
 

Detailed Description

This file contains API for ReRAM 2 Click Driver.

Enumeration Type Documentation

◆ reram2_return_value_t

ReRAM 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
RERAM2_OK 
RERAM2_ERROR