nvsram2 2.0.0.0
nvSRAM 2 Click Driver

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

Topics

 nvSRAM 2 Registers List
 List of registers of nvSRAM 2 Click driver.
 
 nvSRAM 2 MikroBUS Map
 MikroBUS pin mapping of nvSRAM 2 Click driver.
 
 Nvsram2_set
 

Functions

void nvsram2_cfg_setup (nvsram2_cfg_t *cfg)
 nvSRAM 2 configuration object setup function.
 
err_t nvsram2_init (nvsram2_t *ctx, nvsram2_cfg_t *cfg)
 nvSRAM 2 initialization function.
 
err_t nvsram2_default_cfg (nvsram2_t *ctx)
 nvSRAM 2 default configuration function.
 
err_t nvsram2_generic_write (nvsram2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 nvSRAM 2 data writing function.
 
err_t nvsram2_generic_read (nvsram2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 nvSRAM 2 data reading function.
 
void nvsram2_hold (nvsram2_t *ctx, uint8_t en_hold)
 nvSRAM 2 data enable hold operation function.
 
void nvsram2_set_cmd (nvsram2_t *ctx, uint8_t cmd)
 nvSRAM 2 send command function.
 
uint8_t nvsram2_read_status (nvsram2_t *ctx)
 nvSRAM 2 read status register function.
 
uint8_t nvsram2_fast_read_status (nvsram2_t *ctx)
 nvSRAM 2 fast read status register function.
 
void nvsram2_write_status (nvsram2_t *ctx, uint8_t data_byte)
 nvSRAM 2 write status register function.
 
void nvsram2_burst_read (nvsram2_t *ctx, uint32_t mem_addr, uint8_t *p_rx_data, uint8_t n_bytes)
 nvSRAM 2 burst read function.
 
void nvsram2_burst_write (nvsram2_t *ctx, uint32_t mem_addr, uint8_t *p_tx_data, uint8_t n_bytes)
 nvSRAM 2 burst write function.
 
uint32_t nvsram2_read_id (nvsram2_t *ctx)
 nvSRAM 2 read ID function.
 

Detailed Description

API for configuring and manipulating nvSRAM 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

◆ nvsram2_burst_read()

void nvsram2_burst_read ( nvsram2_t * ctx,
uint32_t mem_addr,
uint8_t * p_rx_data,
uint8_t n_bytes )

nvSRAM 2 burst read function.

The function reads a sequential data starting from the targeted 17-bit register address of the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
[in]mem_addr: 17-bit memory address.
[in]p_rx_data: Pointer to the memory address from which data is read.
[in]n_bytes: 8-bit number of bytes to be read.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_burst_write()

void nvsram2_burst_write ( nvsram2_t * ctx,
uint32_t mem_addr,
uint8_t * p_tx_data,
uint8_t n_bytes )

nvSRAM 2 burst write function.

The function writes a sequential data starting from the targeted 17-bit register address of the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
[in]mem_addr: 17-bit memory address.
[in]p_rx_data: Pointer to the memory address from which data is read.
[in]n_bytes: 8-bit number of bytes to be read.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_cfg_setup()

void nvsram2_cfg_setup ( nvsram2_cfg_t * cfg)

nvSRAM 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ nvsram2_default_cfg()

err_t nvsram2_default_cfg ( nvsram2_t * ctx)

nvSRAM 2 default configuration function.

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

Parameters
[in]ctx: Click context object. See nvsram2_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.

◆ nvsram2_fast_read_status()

uint8_t nvsram2_fast_read_status ( nvsram2_t * ctx)

nvSRAM 2 fast read status register function.

The function reads status register for faster SPI speeds from the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
Returns
8-bit status.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_generic_read()

err_t nvsram2_generic_read ( nvsram2_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

nvSRAM 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 nvsram2_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.

◆ nvsram2_generic_write()

err_t nvsram2_generic_write ( nvsram2_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

nvSRAM 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 nvsram2_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.

◆ nvsram2_hold()

void nvsram2_hold ( nvsram2_t * ctx,
uint8_t en_hold )

nvSRAM 2 data enable hold operation function.

The function enables hold operation by setting the state of the HOLD ( PWM ) pin depending on the function argument.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
[in]en_hold: Resume/pause serial communications with the device.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_init()

err_t nvsram2_init ( nvsram2_t * ctx,
nvsram2_cfg_t * cfg )

nvSRAM 2 initialization function.

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

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

◆ nvsram2_read_id()

uint32_t nvsram2_read_id ( nvsram2_t * ctx)

nvSRAM 2 read ID function.

The function performs the device ID read of the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
Returns
32-bit device ID.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_read_status()

uint8_t nvsram2_read_status ( nvsram2_t * ctx)

nvSRAM 2 read status register function.

The function reads status register from the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
Returns
8-bit status.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_set_cmd()

void nvsram2_set_cmd ( nvsram2_t * ctx,
uint8_t cmd )

nvSRAM 2 send command function.

The function sends desired command to the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
[in]cmd: 8-bit command.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.

◆ nvsram2_write_status()

void nvsram2_write_status ( nvsram2_t * ctx,
uint8_t data_byte )

nvSRAM 2 write status register function.

The function writes status data to the CY14B101Q2A memory on nvSRAM 2 click board.

Parameters
[in]ctx: Click context object. See nvsram2_t object definition for detailed explanation.
[in]data_byte: 8-bit write status data.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.