|
flash13 2.2.0
|
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. | |
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.
| void flash13_cfg_setup | ( | flash13_cfg_t * | cfg | ) |
Flash 13 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See flash13_cfg_t object definition for detailed explanation. |
| 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.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| 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.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t flash13_soft_reset | ( | flash13_t * | ctx | ) |
Flash 13 soft reset function.
This function executes the soft reset command.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |
| [in] | cmd | : Command byte. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See flash13_t object definition for detailed explanation. |