sram3 2.0.0.0
SRAM 3 Click Driver

API for configuring and manipulating SRAM 3 Click driver. More...

Topics

 SRAM 3 Registers List
 List of registers of SRAM 3 Click driver.
 
 SRAM 3 Registers Settings
 Settings for registers of SRAM 3 Click driver.
 
 SRAM 3 MikroBUS Map
 MikroBUS pin mapping of SRAM 3 Click driver.
 

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

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

◆ sram3_cfg_setup()

void sram3_cfg_setup ( sram3_cfg_t * cfg)

SRAM 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ sram3_disable_pdis()

void sram3_disable_pdis ( sram3_t * ctx)

SRAM 3 set up disable function.

Function which set up disable old status.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_disable_write()

void sram3_disable_write ( sram3_t * ctx)

SRAM 3 disabling writing to memory function.

Function for disabling writing to memory, status register or user serial.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_enable_pdis()

void sram3_enable_pdis ( sram3_t * ctx)

SRAM 3 set up enable function.

Function which set up enable old status.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_enable_write()

void sram3_enable_write ( sram3_t * ctx)

SRAM 3 enabling writing to memory function.

This function is for enabling writing to memory, status register or user serial.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_generic_read()

err_t sram3_generic_read ( sram3_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

SRAM 3 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 sram3_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.

◆ sram3_generic_write()

err_t sram3_generic_write ( sram3_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

SRAM 3 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 sram3_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.

◆ sram3_hibernate_start()

void sram3_hibernate_start ( sram3_t * ctx)

SRAM 3 changing function.

Function that puts SRAM3 click to hibernate mode.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_hibernate_stop()

void sram3_hibernate_stop ( sram3_t * ctx)

SRAM 3 changing function.

Function that ends SRAM3 click to hibernate mode.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_hold()

void sram3_hold ( sram3_t * ctx)

SRAM 3 changing pin state function.

Function that sets hold pin active.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_init()

err_t sram3_init ( sram3_t * ctx,
sram3_cfg_t * cfg )

SRAM 3 initialization function.

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

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

◆ sram3_protect_memory()

void sram3_protect_memory ( sram3_t * ctx,
uint8_t protect_range )

SRAM 3 secures memory function.

Function which secures part of memory from writing.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]protect_range: Part of memory to be protected
Returns
Nothing.
Note
None.

◆ sram3_read()

void sram3_read ( sram3_t * ctx,
uint32_t mem_adr,
uint8_t * read_buf,
uint8_t buf_size )

SRAM 3 reading data function.

Function that reads data from memory.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]mem_adr: Address to read from.
[in]read_buf: Buffer to store data.
[in]buf_size: Size of data.
Returns
Nothing.
Note
None.

◆ sram3_read_serial()

void sram3_read_serial ( sram3_t * ctx,
uint8_t * buf )

SRAM 3 reading number function.

Function that reads serial number of click.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]buf: Buffer to be written to.
Returns
Nothing.
Note
None.

◆ sram3_read_status()

uint8_t sram3_read_status ( sram3_t * ctx)

SRAM 3 reading function.

Function wich reads data from status register.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Value of status register.
Note
None.

◆ sram3_recall()

void sram3_recall ( sram3_t * ctx)

SRAM 3 relocation data function.

Function that moves data from FLASH to SRAM.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_release_hold()

void sram3_release_hold ( sram3_t * ctx)

SRAM 3 changing pin state function.

Function that sets hold pin inactive.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_secure_read()

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.

Function for secure reading data from memory.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]mem_adr: Address to read from.
[in]read_buf: Buffer to store data.
[in]buf_size: Buffer size.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ sram3_secure_write()

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.

Function for secure writing data to memory function.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]mem_adr: Address to read from.
[in]write_buf: Data to be written.
[in]buf_size: Buffer size.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ sram3_store()

void sram3_store ( sram3_t * ctx)

SRAM 3 relocation data function.

Function that moves data from SRAM to FLASH

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ sram3_write()

void sram3_write ( sram3_t * ctx,
uint32_t mem_adr,
uint8_t * write_buf,
uint8_t buf_size )

SRAM 3 writing data function.

Function for writing data memory.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]mem_adr: Address to read from.
[in]write_buf: Data to be written.
[in]buf_size: Size of data.
Returns
Nothing.
Note
None.

◆ sram3_write_serial()

void sram3_write_serial ( sram3_t * ctx,
uint8_t * buf )

SRAM 3 writing number function.

Function that writes serial number of click.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]buf: Buffer to be written to.
Returns
Nothing.
Note
None.

◆ sram3_write_status()

void sram3_write_status ( sram3_t * ctx,
uint8_t status )

SRAM 3 writing function.

Function which writes data to status register.

Parameters
[in]ctx: Click context object. See sram3_t object definition for detailed explanation.
[in]status: Value to be written to status register.
Returns
Nothing.
Note
None.