flash11 2.1.0.0
|
API for configuring and manipulating Flash 11 Click driver. More...
Topics | |
Flash 11 command opcode list. | |
List of command opcode of Flash 11 Click driver. | |
Flash 11 Registers Settings | |
Settings for registers of Flash 11 Click driver. | |
Flash 11 MikroBUS Map | |
MikroBUS pin mapping of Flash 11 Click driver. | |
Functions | |
void | flash11_cfg_setup (flash11_cfg_t *cfg) |
Flash 11 configuration object setup function. | |
err_t | flash11_init (flash11_t *ctx, flash11_cfg_t *cfg) |
Flash 11 initialization function. | |
err_t | flash11_default_cfg (flash11_t *ctx) |
Flash 11 default configuration function. | |
err_t | flash11_generic_write (flash11_t *ctx, uint8_t opcode, uint8_t *data_in, uint8_t len) |
Flash 11 data writing function. | |
err_t | flash11_generic_read (flash11_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len) |
Flash 11 data reading function. | |
err_t | flash11_set_cmd (flash11_t *ctx, uint8_t opcode) |
Flash 11 set the command function. | |
err_t | flash11_write_cmd_addr_data (flash11_t *ctx, uint8_t opcode, uint32_t mem_addr, uint8_t *data_in, uint32_t len) |
Flash 11 write command adress data function. | |
err_t | flash11_read_cmd_addr_data (flash11_t *ctx, uint8_t opcode, uint32_t mem_addr, uint8_t *data_out, uint32_t len) |
Flash 11 read command adress data function. | |
err_t | flash11_sw_reset (flash11_t *ctx) |
Flash 11 sw reset function. | |
err_t | flash11_memory_write (flash11_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint32_t len) |
Flash 11 memory write function. | |
err_t | flash11_memory_read (flash11_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint32_t len) |
Flash 11 memory read function. | |
err_t | flash11_write_enable (flash11_t *ctx) |
Flash 11 write enable function. | |
err_t | flash11_write_disable (flash11_t *ctx) |
Flash 11 write disable function. | |
err_t | flash11_block_erase (flash11_t *ctx, uint8_t cmd_block_erase, uint32_t mem_addr) |
Flash 11 block erase function. | |
err_t | flash11_chip_erase (flash11_t *ctx) |
Flash 11 chip erase function. | |
err_t | flash11_set_status (flash11_t *ctx, uint8_t status_reg, uint8_t status) |
Flash 11 set status function. | |
err_t | flash11_get_status (flash11_t *ctx, uint8_t status_reg, uint8_t *status) |
Flash 11 gets the status function. | |
err_t | flash11_get_device_id (flash11_t *ctx, uint8_t *device_id) |
Flash 11 gets the device ID function. | |
void | flash11_hw_write_protect (flash11_t *ctx, uint8_t en_wp) |
Flash 11 hardware write protect function. | |
void | flash11_en_hold (flash11_t *ctx, uint8_t en_hold) |
Flash 11 enable hold function. | |
API for configuring and manipulating Flash 11 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t flash11_block_erase | ( | flash11_t * | ctx, |
uint8_t | cmd_block_erase, | ||
uint32_t | mem_addr ) |
Flash 11 block erase function.
This function erases the desired amount of memory starting from the selected memory address of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | cmd_block_erase | : Block erase command
|
[in] | mem_addr | : Flash memory address. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void flash11_cfg_setup | ( | flash11_cfg_t * | cfg | ) |
Flash 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See flash11_cfg_t object definition for detailed explanation. |
err_t flash11_chip_erase | ( | flash11_t * | ctx | ) |
Flash 11 chip erase function.
This function erases the entire memory array of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_default_cfg | ( | flash11_t * | ctx | ) |
Flash 11 default configuration function.
This function executes a default configuration of Flash 11 click board.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void flash11_en_hold | ( | flash11_t * | ctx, |
uint8_t | en_hold ) |
Flash 11 enable hold function.
This function is used for pausing communication of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | en_hold |
|
err_t flash11_generic_read | ( | flash11_t * | ctx, |
uint8_t | opcode, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Flash 11 data reading function.
This function reads a desired number of data bytes of the selected 8-bit opcode by using SPI serial interface.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | opcode | : Command opcode. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_generic_write | ( | flash11_t * | ctx, |
uint8_t | opcode, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Flash 11 data writing function.
This function writes a desired number of data bytes of the selected 8-bit opcode by using SPI serial interface.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | opcode | : Command opcode. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_get_device_id | ( | flash11_t * | ctx, |
uint8_t * | device_id ) |
Flash 11 gets the device ID function.
This function reads a Manufacturer ID of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | status_reg | : Read status register command. |
[out] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_get_status | ( | flash11_t * | ctx, |
uint8_t | status_reg, | ||
uint8_t * | status ) |
Flash 11 gets the status function.
This function reads data from the desired status register of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | status_reg | : Read status register command. |
[out] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void flash11_hw_write_protect | ( | flash11_t * | ctx, |
uint8_t | en_wp ) |
Flash 11 hardware write protect function.
This function is used for write-protection of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | en_wp |
|
err_t flash11_init | ( | flash11_t * | ctx, |
flash11_cfg_t * | cfg ) |
Flash 11 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See flash11_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_memory_read | ( | flash11_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_out, | ||
uint32_t | len ) |
Flash 11 memory read function.
This function reads a desired number of data bytes starting from the selected memory address of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | mem_addr | : Flash memory address (0x000000-0x3FFFFF). |
[in] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_memory_write | ( | flash11_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_in, | ||
uint32_t | len ) |
Flash 11 memory write function.
This function writes a desired number of data bytes starting from the selected memory address of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | mem_addr | : Flash memory address (0x000000-0x3FFFFF). |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_read_cmd_addr_data | ( | flash11_t * | ctx, |
uint8_t | opcode, | ||
uint32_t | mem_addr, | ||
uint8_t * | data_out, | ||
uint32_t | len ) |
Flash 11 read command adress data function.
This function writes a desired number of data bytes starting from a desired address of the selected command of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | opcode | : Command opcode. |
[in] | mem_addr | : Flash memory address (0x000000-0x3FFFFF). |
[in] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_set_cmd | ( | flash11_t * | ctx, |
uint8_t | opcode ) |
Flash 11 set the command function.
This function writes the desired command of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | opcode | : Command opcode. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_set_status | ( | flash11_t * | ctx, |
uint8_t | status_reg, | ||
uint8_t | status ) |
Flash 11 set status function.
This function writes data to the desired status register of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | status_reg | : Write status register command. |
[in] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_sw_reset | ( | flash11_t * | ctx | ) |
Flash 11 sw reset function.
This function performs the software reset of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_write_cmd_addr_data | ( | flash11_t * | ctx, |
uint8_t | opcode, | ||
uint32_t | mem_addr, | ||
uint8_t * | data_in, | ||
uint32_t | len ) |
Flash 11 write command adress data function.
This function writes a desired number of data bytes starting from a desired address of the selected command of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
[in] | opcode | : Command opcode. |
[in] | mem_addr | : Flash memory address (0x000000-0x3FFFFF). |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_write_disable | ( | flash11_t * | ctx | ) |
Flash 11 write disable function.
This function disables memory write-protect and sets the write disable command of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash11_write_enable | ( | flash11_t * | ctx | ) |
Flash 11 write enable function.
This function write protects the entire memory and sets the write enable command of the AT25SF321B, 32-Mbit SPI Serial Flash Memory with Dual I/O and Quad I/O Support on the Flash 11 Click board™.
[in] | ctx | : Click context object. See flash11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.