fram5 2.0.0.0
FRAM 5 Click Driver

API for configuring and manipulating FRAM 5 Click driver. More...

Topics

 FRAM 5 Registers Settings
 Settings for registers of FRAM 5 Click driver.
 
 FRAM 5 MikroBUS Map
 MikroBUS pin mapping of FRAM 5 Click driver.
 

Functions

void fram5_cfg_setup (fram5_cfg_t *cfg)
 FRAM 5 configuration object setup function.
 
err_t fram5_init (fram5_t *ctx, fram5_cfg_t *cfg)
 FRAM 5 initialization function.
 
err_t fram5_memory_write (fram5_t *ctx, uint32_t address, uint8_t *data_in, uint8_t len)
 FRAM 5 memory write function.
 
err_t fram5_memory_read (fram5_t *ctx, uint32_t address, uint8_t *data_out, uint8_t len)
 FRAM 5 memory read function.
 
err_t fram5_check_communication (fram5_t *ctx)
 FRAM 5 check communication function.
 
void fram5_write_protect (fram5_t *ctx)
 FRAM 5 write protect function.
 
void fram5_write_enable (fram5_t *ctx)
 FRAM 5 write enable function.
 

Detailed Description

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

◆ fram5_cfg_setup()

void fram5_cfg_setup ( fram5_cfg_t * cfg)

FRAM 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ fram5_check_communication()

err_t fram5_check_communication ( fram5_t * ctx)

FRAM 5 check communication function.

This function checks the communication by reading and verifying the device ID.

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

◆ fram5_init()

err_t fram5_init ( fram5_t * ctx,
fram5_cfg_t * cfg )

FRAM 5 initialization function.

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

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

◆ fram5_memory_read()

err_t fram5_memory_read ( fram5_t * ctx,
uint32_t address,
uint8_t * data_out,
uint8_t len )

FRAM 5 memory read function.

This function reads a desired number of data bytes starting from the selected memory address.

Parameters
[in]ctx: Click context object. See fram5_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x1FFFF].
[out]data_out: Read data output.
[in]len: Number of data bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fram5_memory_write()

err_t fram5_memory_write ( fram5_t * ctx,
uint32_t address,
uint8_t * data_in,
uint8_t len )

FRAM 5 memory write function.

This function writes a desired number of data bytes starting from the selected memory address.

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

◆ fram5_write_enable()

void fram5_write_enable ( fram5_t * ctx)

FRAM 5 write enable function.

This function disables memory write-protect by setting the WP pin to low logic state.

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

◆ fram5_write_protect()

void fram5_write_protect ( fram5_t * ctx)

FRAM 5 write protect function.

This function write protects the entire memory by setting the WP pin to high logic state.

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