flash12  2.1.0.0
Modules | Functions
Flash 12 Click Driver

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

Modules

 Flash 12 Command List
 List of commands of Flash 12 Click driver.
 
 Flash 12 Registers Settings
 Settings for registers of Flash 12 Click driver.
 
 Flash 12 MikroBUS Map
 MikroBUS pin mapping of Flash 12 Click driver.
 

Functions

void flash12_cfg_setup (flash12_cfg_t *cfg)
 Flash 12 configuration object setup function. More...
 
err_t flash12_init (flash12_t *ctx, flash12_cfg_t *cfg)
 Flash 12 initialization function. More...
 
err_t flash12_default_cfg (flash12_t *ctx)
 Flash 12 default configuration function. More...
 
void flash12_hw_write_enable (flash12_t *ctx)
 Flash 12 hardware write enable function. More...
 
void flash12_hw_write_disable (flash12_t *ctx)
 Flash 12 hardware write disable function. More...
 
void flash12_hold_disable (flash12_t *ctx)
 Flash 12 hold disable function. More...
 
void flash12_hold_enable (flash12_t *ctx)
 Flash 12 hold enable function. More...
 
err_t flash12_write_cmd (flash12_t *ctx, uint8_t cmd)
 Flash 12 command writing function. More...
 
err_t flash12_write_cmd_data (flash12_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 Flash 12 command data writing function. More...
 
err_t flash12_read_cmd_data (flash12_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Flash 12 command data reading function. More...
 
err_t flash12_write_cmd_address_data (flash12_t *ctx, uint8_t cmd, uint32_t mem_addr, uint8_t *data_in, uint32_t len)
 Flash 12 command address data writing function. More...
 
err_t flash12_read_cmd_address_data (flash12_t *ctx, uint8_t cmd, uint32_t mem_addr, uint8_t *data_out, uint32_t len)
 Flash 12 command address data reading function. More...
 
err_t flash12_memory_write (flash12_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint32_t len)
 Flash 12 memory data writing function. More...
 
err_t flash12_memory_read (flash12_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint32_t len)
 Flash 12 memory data reading function. More...
 
err_t flash12_soft_reset (flash12_t *ctx)
 Flash 12 soft reset function. More...
 
err_t flash12_write_disable (flash12_t *ctx)
 Flash 12 write disable function. More...
 
err_t flash12_write_enable (flash12_t *ctx)
 Flash 12 write enable function. More...
 
err_t flash12_read_status (flash12_t *ctx, uint8_t reg_num, uint8_t *status)
 Flash 12 status reading function. More...
 
err_t flash12_write_status (flash12_t *ctx, uint8_t status)
 Flash 12 status writing function. More...
 
err_t flash12_erase_memory (flash12_t *ctx, uint8_t erase_cmd, uint32_t mem_addr)
 Flash 12 erase memory function. More...
 
err_t flash12_get_device_id (flash12_t *ctx, uint8_t *mfr_id, uint8_t *dev_id)
 Flash 12 device ID reading function. More...
 

Detailed Description

API for configuring and manipulating Flash 12 Click driver.

Function Documentation

◆ flash12_cfg_setup()

void flash12_cfg_setup ( flash12_cfg_t cfg)

Flash 12 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ flash12_default_cfg()

err_t flash12_default_cfg ( flash12_t ctx)

Flash 12 default configuration function.

This function executes a default configuration of Flash 12 click board.

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

◆ flash12_erase_memory()

err_t flash12_erase_memory ( flash12_t ctx,
uint8_t  erase_cmd,
uint32_t  mem_addr 
)

Flash 12 erase memory function.

This function erases the selected amount of memory which contains the selected address by using SPI serial interface.

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

◆ flash12_get_device_id()

err_t flash12_get_device_id ( flash12_t ctx,
uint8_t *  mfr_id,
uint8_t *  dev_id 
)

Flash 12 device ID reading function.

This function reads a manufacturer and device ID by using SPI serial interface.

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[out]mfr_id: Manufacturer ID.
[out]dev_id: Device ID. Ignored for FLASH12_CMD_CHIP_ERASE command.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash12_hold_disable()

void flash12_hold_disable ( flash12_t ctx)

Flash 12 hold disable function.

This function is used to disable SPI communication pause of the AT25EU0041A, 4-Mbit, Ultra-Low Energy Serial Flash Memory on the Flash 12 Click board.

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

◆ flash12_hold_enable()

void flash12_hold_enable ( flash12_t ctx)

Flash 12 hold enable function.

This function is used to enable SPI communication pauses of the AT25EU0041A, 4-Mbit, Ultra-Low Energy Serial Flash Memory on the Flash 12 Click board.

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

◆ flash12_hw_write_disable()

void flash12_hw_write_disable ( flash12_t ctx)

Flash 12 hardware write disable function.

This function enabled hardware write protection of the entire memory of the AT25EU0041A, 4-Mbit, Ultra-Low Energy Serial Flash Memory on the Flash 12 Click board.

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

◆ flash12_hw_write_enable()

void flash12_hw_write_enable ( flash12_t ctx)

Flash 12 hardware write enable function.

This function disabled hardware write protection of the entire memory of the AT25EU0041A, 4-Mbit, Ultra-Low Energy Serial Flash Memory on the Flash 12 Click board.

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

◆ flash12_init()

err_t flash12_init ( flash12_t ctx,
flash12_cfg_t cfg 
)

Flash 12 initialization function.

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

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

◆ flash12_memory_read()

err_t flash12_memory_read ( flash12_t ctx,
uint32_t  mem_addr,
uint8_t *  data_out,
uint32_t  len 
)

Flash 12 memory data reading function.

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

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]mem_addr: Memory address [0x000000-0x07FFFF].
[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.

◆ flash12_memory_write()

err_t flash12_memory_write ( flash12_t ctx,
uint32_t  mem_addr,
uint8_t *  data_in,
uint32_t  len 
)

Flash 12 memory data writing function.

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

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]mem_addr: Memory address [0x000000-0x07FFFF].
[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.

◆ flash12_read_cmd_address_data()

err_t flash12_read_cmd_address_data ( flash12_t ctx,
uint8_t  cmd,
uint32_t  mem_addr,
uint8_t *  data_out,
uint32_t  len 
)

Flash 12 command address data reading function.

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

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]mem_addr: Memory address [0x000000-0x07FFFF].
[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.

◆ flash12_read_cmd_data()

err_t flash12_read_cmd_data ( flash12_t ctx,
uint8_t  cmd,
uint8_t *  data_out,
uint8_t  len 
)

Flash 12 command data reading function.

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

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]cmd: Command data.
[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.

◆ flash12_read_status()

err_t flash12_read_status ( flash12_t ctx,
uint8_t  reg_num,
uint8_t *  status 
)

Flash 12 status reading function.

This function reads a desired status register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]reg_num: Status register number.
[out]status: Status output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ flash12_soft_reset()

err_t flash12_soft_reset ( flash12_t ctx)

Flash 12 soft reset function.

This function executes the soft reset command by using SPI serial interface.

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

◆ flash12_write_cmd()

err_t flash12_write_cmd ( flash12_t ctx,
uint8_t  cmd 
)

Flash 12 command writing function.

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

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

◆ flash12_write_cmd_address_data()

err_t flash12_write_cmd_address_data ( flash12_t ctx,
uint8_t  cmd,
uint32_t  mem_addr,
uint8_t *  data_in,
uint32_t  len 
)

Flash 12 command address data writing 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 flash12_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]mem_addr: Memory address [0x000000-0x07FFFF].
[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.

◆ flash12_write_cmd_data()

err_t flash12_write_cmd_data ( flash12_t ctx,
uint8_t  cmd,
uint8_t *  data_in,
uint8_t  len 
)

Flash 12 command data writing function.

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

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]cmd: Command data.
[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.

◆ flash12_write_disable()

err_t flash12_write_disable ( flash12_t ctx)

Flash 12 write disable function.

This function write disable the entire memory via the hardware write disable function and write disable command.

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

◆ flash12_write_enable()

err_t flash12_write_enable ( flash12_t ctx)

Flash 12 write enable function.

This function write enable the entire memory via the hardware write enable function and write enable command.

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

◆ flash12_write_status()

err_t flash12_write_status ( flash12_t ctx,
uint8_t  status 
)

Flash 12 status writing function.

This function writes a desired data bytes to the write status register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See flash12_t object definition for detailed explanation.
[in]status: Status output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.