reram 2.0.0.0
Public Function

Functions

void reram_cfg_setup (reram_cfg_t *cfg)
 Configuration Object Setup function.
 
reram_err_t reram_init (reram_t *ctx, reram_cfg_t *cfg)
 Click Initialization function.
 
void reram_default_cfg (reram_t *ctx)
 Click Default Configuration function.
 
reram_err_t reram_send_cmd (reram_t *ctx, uint8_t cmd_code)
 Command Send function.
 
uint8_t reram_read_status (reram_t *ctx)
 Status Read function.
 
void reram_write_status (reram_t *ctx, uint8_t data_in)
 Status Write function.
 
reram_err_t reram_read_memory (reram_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint16_t n_bytes)
 Memory Read function.
 
reram_err_t reram_write_memory (reram_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint16_t n_bytes)
 Memory Write function.
 
uint32_t reram_read_id (reram_t *ctx)
 ID Read function.
 
void reram_set_hold_pin (reram_t *ctx, reram_pin_state_t state)
 Hold Pin Set function.
 
void reram_set_write_protect_pin (reram_t *ctx, reram_pin_state_t state)
 Write Protect Pin Set function.
 
void reram_wake_up (reram_t *ctx)
 Wake Up function.
 

Detailed Description

Function Documentation

◆ reram_cfg_setup()

void reram_cfg_setup ( reram_cfg_t * cfg)

Configuration Object Setup function.

Parameters
cfgClick configuration structure.

@description This function initializes all used pins to unconnected state.

◆ reram_default_cfg()

void reram_default_cfg ( reram_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes a default configuration for ReRAM Click.

◆ reram_init()

reram_err_t reram_init ( reram_t * ctx,
reram_cfg_t * cfg )

Click Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0x0 - Ok, 0xFC - Driver init error.

@description This function initializes all peripherals and pins used by ReRAM Click.

◆ reram_read_id()

uint32_t reram_read_id ( reram_t * ctx)

ID Read function.

Parameters
ctxClick object.
Returns
Device ID.

@description This function returns the 32-bit device ID.

◆ reram_read_memory()

reram_err_t reram_read_memory ( reram_t * ctx,
uint32_t mem_addr,
uint8_t * data_out,
uint16_t n_bytes )

Memory Read function.

Parameters
ctxClick object.
mem_addrMemory address.
data_outMemory where data be stored.
n_bytesNumber of bytes to be read.
Returns
0x0 - Ok, 0xFE - Memory address error, 0xFF - Nbytes error.

@description This function reads a selected block of memory, starting from the selected address.

◆ reram_read_status()

uint8_t reram_read_status ( reram_t * ctx)

Status Read function.

Parameters
ctxClick object.
Returns
Status byte.

@description This function reads status byte.

◆ reram_send_cmd()

reram_err_t reram_send_cmd ( reram_t * ctx,
uint8_t cmd_code )

Command Send function.

Parameters
ctxClick object.
cmd_codeCommand to be sent.
Returns
0x0 - Ok, 0xFD - Command error.

@description This function allows user to send a desired command to the device.

◆ reram_set_hold_pin()

void reram_set_hold_pin ( reram_t * ctx,
reram_pin_state_t state )

Hold Pin Set function.

Parameters
ctxClick object.
statePin state to be set.

@description This function sets Hold pin to the desired state.

◆ reram_set_write_protect_pin()

void reram_set_write_protect_pin ( reram_t * ctx,
reram_pin_state_t state )

Write Protect Pin Set function.

Parameters
ctxClick object.
statePin state to be set.

@description This function sets Write Protect pin to the desired state.

◆ reram_wake_up()

void reram_wake_up ( reram_t * ctx)

Wake Up function.

Parameters
ctxClick object.

@description This function executes a device wake up sequence.

◆ reram_write_memory()

reram_err_t reram_write_memory ( reram_t * ctx,
uint32_t mem_addr,
uint8_t * data_in,
uint16_t n_bytes )

Memory Write function.

Parameters
ctxClick object.
mem_addrMemory address.
data_inData to be written.
n_bytesNumber of bytes to be written.
Returns
0x0 - Ok, 0xFE - Memory address error, 0xFF - Nbytes error.

@description This function writes data to the selected memory block, starting from the selected address.

◆ reram_write_status()

void reram_write_status ( reram_t * ctx,
uint8_t data_in )

Status Write function.

Parameters
ctxClick object.
data_inData to be written.

@description This function writes data byte to Status register.