reram2 2.0.0.0
ReRAM 2 Click Driver

API for configuring and manipulating ReRAM 2 Click driver. More...

Topics

 ReRAM 2 Command List
 List of commands of ReRAM 2 Click driver.
 
 ReRAM 2 Registers Settings
 Settings for registers of ReRAM 2 Click driver.
 
 ReRAM 2 MikroBUS Map
 MikroBUS pin mapping of ReRAM 2 Click driver.
 
 Reram2_cmd
 

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

API for configuring and manipulating ReRAM 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ reram2_cfg_setup()

void reram2_cfg_setup ( reram2_cfg_t * cfg)

ReRAM 2 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See reram2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ reram2_check_device_id()

err_t reram2_check_device_id ( reram2_t * ctx)

ReRAM 2 check device ID function.

This function check a device ID of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
Returns
  • 0 - OK,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_default_cfg()

err_t reram2_default_cfg ( reram2_t * ctx)

ReRAM 2 default configuration function.

This function executes a default configuration of ReRAM 2 click board.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ reram2_generic_read()

err_t reram2_generic_read ( reram2_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

ReRAM 2 data reading function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_generic_write()

err_t reram2_generic_write ( reram2_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

ReRAM 2 data writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_get_status()

err_t reram2_get_status ( reram2_t * ctx,
reram2_status_t * status )

ReRAM 2 get status function.

This function reads a status register of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[out]status: Click Status object.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_init()

err_t reram2_init ( reram2_t * ctx,
reram2_cfg_t * cfg )

ReRAM 2 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See reram2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_read_device_id()

err_t reram2_read_device_id ( reram2_t * ctx,
reram2_dev_id_t * dev_id )

ReRAM 2 read device ID function.

This function reads a device ID of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[out]dev_id: Click Device ID object.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_read_memory()

err_t reram2_read_memory ( reram2_t * ctx,
uint32_t mem_addr,
uint8_t * data_out,
uint16_t len )

ReRAM 2 read memory function.

This function burst reads memory a desired number address of data bytes starting from the selected memory address of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]mem_addr: Start memory address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_send_command()

err_t reram2_send_command ( reram2_t * ctx,
uint8_t cmd )

ReRAM 2 set command function.

This function writes a desired command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]cmd: Desired command.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ reram2_set_hold()

err_t reram2_set_hold ( reram2_t * ctx,
uint8_t en_hold )

ReRAM 2 set hold function.

This function set hold by setting the HO pin state of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]en_hold:
  • 0 ( RERAM2_HOLD_ENABLE ) - Enable hold and pause the serial communication,
  • 1 ( RERAM2_HOLD_DISABLE )- Disable hold and resume the serial communication.
Returns
  • 0 - Success,
Note
None.

◆ reram2_set_write_protect()

err_t reram2_set_write_protect ( reram2_t * ctx,
uint8_t en_wp )

ReRAM 2 write protection function.

This function set write protection by setting the WP pin state of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]en_wp:
  • 0 ( RERAM2_WP_ENABLE ) - Store operations,
  • 1 ( RERAM2_WP_DISABLE )- Resume the serial communication.
Returns
  • 0 - Success,
Note
None.

◆ reram2_wake_up()

err_t reram2_wake_up ( reram2_t * ctx)

ReRAM 2 wake up function.

This function performs device wake-up of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
Returns
  • 0 - Success,
Note
None.

◆ reram2_write_memory()

err_t reram2_write_memory ( reram2_t * ctx,
uint32_t mem_addr,
uint8_t * data_in,
uint16_t len )

ReRAM 2 write memory function.

This function burst write memory a desired number address of data bytes starting from the selected memory address of the MB85AS8MT Resistive Random Access Memory on the ReRAM 2 board™.

Parameters
[in]ctx: Click context object. See reram2_t object definition for detailed explanation.
[in]mem_addr: Start memory address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.