flash13 2.2.0
Loading...
Searching...
No Matches
Flash 13 Click Driver

API for configuring and manipulating Flash 13 Click driver. More...

Topics

 Flash 13 Registers List
 List of registers of Flash 13 Click driver.
 Flash 13 Registers Settings
 Settings for registers of Flash 13 Click driver.
 Flash 13 MikroBUS Map
 MikroBUS pin mapping of Flash 13 Click driver.

Functions

void flash13_cfg_setup (flash13_cfg_t *cfg)
 Flash 13 configuration object setup function.
err_t flash13_init (flash13_t *ctx, flash13_cfg_t *cfg)
 Flash 13 initialization function.
err_t flash13_write_cmd (flash13_t *ctx, uint8_t cmd)
 Flash 13 write cmd function.
err_t flash13_write_cmd_data (flash13_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 Flash 13 write cmd data function.
err_t flash13_read_cmd_data (flash13_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Flash 13 read cmd data function.
err_t flash13_write_cmd_address_data (flash13_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 13 write cmd address data function.
err_t flash13_read_cmd_address_data (flash13_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 13 read cmd address data function.
err_t flash13_memory_write (flash13_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 13 memory write function.
err_t flash13_memory_read (flash13_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 13 memory read function.
err_t flash13_erase_memory (flash13_t *ctx, uint8_t erase_cmd, uint32_t address)
 Flash 13 erase memory function.
err_t flash13_check_communication (flash13_t *ctx)
 Flash 13 check communication function.
err_t flash13_write_protect (flash13_t *ctx)
 Flash 13 write protect function.
err_t flash13_write_enable (flash13_t *ctx)
 Flash 13 write enable function.
err_t flash13_soft_reset (flash13_t *ctx)
 Flash 13 soft reset function.
void flash13_set_wp_pin (flash13_t *ctx, uint8_t state)
 Flash 13 set wp pin function.
void flash13_set_hold_pin (flash13_t *ctx, uint8_t state)
 Flash 13 set hold pin function.

Detailed Description

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

◆ flash13_cfg_setup()

void flash13_cfg_setup ( flash13_cfg_t * cfg)

Flash 13 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ flash13_check_communication()

err_t flash13_check_communication ( flash13_t * ctx)

Flash 13 check communication function.

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

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

◆ flash13_erase_memory()

err_t flash13_erase_memory ( flash13_t * ctx,
uint8_t erase_cmd,
uint32_t address )

Flash 13 erase memory function.

This function erases the selected amount of memory which contains the selected address.

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]erase_cmd: Erase command.
[in]address: The block of memory that contains this address will be erased. Ignored for FLASH13_CMD_CHIP_ERASE command.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash13_init()

err_t flash13_init ( flash13_t * ctx,
flash13_cfg_t * cfg )

Flash 13 initialization function.

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

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

◆ flash13_memory_read()

err_t flash13_memory_read ( flash13_t * ctx,
uint32_t address,
uint8_t * data_out,
uint32_t len )

Flash 13 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 flash13_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x1FFFFF].
[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.

◆ flash13_memory_write()

err_t flash13_memory_write ( flash13_t * ctx,
uint32_t address,
uint8_t * data_in,
uint32_t len )

Flash 13 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 flash13_t object definition for detailed explanation.
[in]address: Starting memory address [0x00000-0x1FFFFF].
[in]data_in: Data to be written.
[in]len: Number of data bytes (up to 256).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash13_read_cmd_address_data()

err_t flash13_read_cmd_address_data ( flash13_t * ctx,
uint8_t cmd,
uint32_t address,
uint8_t * data_out,
uint32_t len )

Flash 13 read cmd address data function.

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

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]address: Memory address (up to 0x1FFFFF).
[out]data_out: Output read data.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash13_read_cmd_data()

err_t flash13_read_cmd_data ( flash13_t * ctx,
uint8_t cmd,
uint8_t * data_out,
uint8_t len )

Flash 13 read cmd data function.

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

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]cmd: Command byte.
[out]data_out: Output read data.
[in]len: Number of bytes to be read (up to 8).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash13_set_hold_pin()

void flash13_set_hold_pin ( flash13_t * ctx,
uint8_t state )

Flash 13 set hold pin function.

This function sets the HOLD pin logic state.

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ flash13_set_wp_pin()

void flash13_set_wp_pin ( flash13_t * ctx,
uint8_t state )

Flash 13 set wp pin function.

This function sets the WP pin logic state.

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ flash13_soft_reset()

err_t flash13_soft_reset ( flash13_t * ctx)

Flash 13 soft reset function.

This function executes the soft reset command.

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

◆ flash13_write_cmd()

err_t flash13_write_cmd ( flash13_t * ctx,
uint8_t cmd )

Flash 13 write cmd function.

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

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

◆ flash13_write_cmd_address_data()

err_t flash13_write_cmd_address_data ( flash13_t * ctx,
uint8_t cmd,
uint32_t address,
uint8_t * data_in,
uint32_t len )

Flash 13 write cmd address data function.

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

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]address: Memory address (up to 0x1FFFFF).
[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.

◆ flash13_write_cmd_data()

err_t flash13_write_cmd_data ( flash13_t * ctx,
uint8_t cmd,
uint8_t * data_in,
uint8_t len )

Flash 13 write cmd data function.

This function writes a desired number of data bytes to the selected command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See flash13_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written (up to 8).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash13_write_enable()

err_t flash13_write_enable ( flash13_t * ctx)

Flash 13 write enable function.

This function disables memory write-protect via the WP pin and WRITE ENABLE command.

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

◆ flash13_write_protect()

err_t flash13_write_protect ( flash13_t * ctx)

Flash 13 write protect function.

This function write protects the entire memory via the WP pin and WRITE DISABLE command.

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