fram2 2.0.0.0
Public function

Functions

void fram2_cfg_setup (fram2_cfg_t *cfg)
 Config Object Initialization function.
 
FRAM2_RETVAL fram2_init (fram2_t *ctx, fram2_cfg_t *cfg)
 Initialization function.
 
void fram2_default_cfg (fram2_t *ctx)
 Click Default Configuration function.
 
void fram2_generic_transfer (fram2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void fram2_write_enable (fram2_t *ctx)
 Enable write operation.
 
void fram2_write_disable (fram2_t *ctx)
 Disable write operation.
 
uint8_t fram2_read_status (fram2_t *ctx)
 Read Fram click status.
 
void fram2_write_status (fram2_t *ctx, uint8_t value)
 Write Fram click status.
 
void fram2_read (fram2_t *ctx, uint32_t address, uint8_t *buffer, uint8_t count)
 Read from FRAM click memory.
 
void fram2_write (fram2_t *ctx, uint32_t address, uint8_t *buffer, uint8_t counter)
 Write to FRAM click memory.
 

Detailed Description

Function Documentation

◆ fram2_cfg_setup()

void fram2_cfg_setup ( fram2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ fram2_default_cfg()

void fram2_default_cfg ( fram2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration i.e enable write operation for FRAM 2 click.

◆ fram2_generic_transfer()

void fram2_generic_transfer ( fram2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ fram2_init()

FRAM2_RETVAL fram2_init ( fram2_t * ctx,
fram2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ fram2_read()

void fram2_read ( fram2_t * ctx,
uint32_t address,
uint8_t * buffer,
uint8_t count )

Read from FRAM click memory.

Parameters
ctxClick object.
addressDesired starting address (0x0000 to FRAM_MEM_SIZE).
bufferPointer to read buffer.
countNumber of bytes to be read.

@description This function reads content from address and saves it to buffer.

◆ fram2_read_status()

uint8_t fram2_read_status ( fram2_t * ctx)

Read Fram click status.

Parameters
ctxClick object.
Returns
Content of FRAM status register.

@description This function reads content of FRAM status register.

◆ fram2_write()

void fram2_write ( fram2_t * ctx,
uint32_t address,
uint8_t * buffer,
uint8_t counter )

Write to FRAM click memory.

Parameters
ctxClick object.
addressAddress to write to (0x0000 to FRAM_MEM_SIZE).
bufferPointer to write buffer.
counterNumber of bytes to be written.

@description This function writes content from buffer to address.

◆ fram2_write_disable()

void fram2_write_disable ( fram2_t * ctx)

Disable write operation.

Parameters
ctxClick object.

@description This function sends write disable command to the click.

◆ fram2_write_enable()

void fram2_write_enable ( fram2_t * ctx)

Enable write operation.

Parameters
ctxClick object.

@description This function sends write enable command to the click.

◆ fram2_write_status()

void fram2_write_status ( fram2_t * ctx,
uint8_t value )

Write Fram click status.

Parameters
ctxClick object.
valueValue to be written.

@description This function writes value to FRAM status register.