flash10
2.1.0.0
|
API for configuring and manipulating Flash 10 Click driver. More...
Modules | |
Flash 10 Registers List | |
List of registers of Flash 10 Click driver. | |
Flash 10 Registers Settings | |
Settings for registers of Flash 10 Click driver. | |
Flash 10 MikroBUS Map | |
MikroBUS pin mapping of Flash 10 Click driver. | |
Functions | |
void | flash10_cfg_setup (flash10_cfg_t *cfg) |
Flash 10 configuration object setup function. More... | |
err_t | flash10_init (flash10_t *ctx, flash10_cfg_t *cfg) |
Flash 10 initialization function. More... | |
err_t | flash10_write_cmd (flash10_t *ctx, uint8_t cmd) |
Flash 10 write cmd function. More... | |
err_t | flash10_write_cmd_data (flash10_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
Flash 10 write cmd data function. More... | |
err_t | flash10_read_cmd_data (flash10_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len) |
Flash 10 read cmd data function. More... | |
err_t | flash10_write_cmd_address_data (flash10_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len) |
Flash 10 write cmd address data function. More... | |
err_t | flash10_read_cmd_address_data (flash10_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len) |
Flash 10 read cmd address data function. More... | |
err_t | flash10_memory_write (flash10_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len) |
Flash 10 memory write function. More... | |
err_t | flash10_memory_read (flash10_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len) |
Flash 10 memory read function. More... | |
err_t | flash10_erase_memory (flash10_t *ctx, uint8_t erase_cmd, uint32_t address) |
Flash 10 erase memory function. More... | |
err_t | flash10_check_communication (flash10_t *ctx) |
Flash 10 check communication function. More... | |
err_t | flash10_write_protect (flash10_t *ctx) |
Flash 10 write protect function. More... | |
err_t | flash10_write_enable (flash10_t *ctx) |
Flash 10 write enable function. More... | |
err_t | flash10_soft_reset (flash10_t *ctx) |
Flash 10 soft reset function. More... | |
err_t | flash10_write_status (flash10_t *ctx, uint8_t status_reg_num, uint8_t status) |
Flash 10 write status function. More... | |
err_t | flash10_read_status (flash10_t *ctx, uint8_t status_reg_num, uint8_t *status) |
Flash 10 read status function. More... | |
void | flash10_set_wp_pin (flash10_t *ctx, uint8_t state) |
Flash 10 set wp pin function. More... | |
void | flash10_set_rst_pin (flash10_t *ctx, uint8_t state) |
Flash 10 set rst pin function. More... | |
API for configuring and manipulating Flash 10 Click driver.
void flash10_cfg_setup | ( | flash10_cfg_t * | cfg | ) |
Flash 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See flash10_cfg_t object definition for detailed explanation. |
err_t flash10_check_communication | ( | flash10_t * | ctx | ) |
Flash 10 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash10_erase_memory | ( | flash10_t * | ctx, |
uint8_t | erase_cmd, | ||
uint32_t | address | ||
) |
Flash 10 erase memory function.
This function erases the selected amount of memory which contains the selected address.
[in] | ctx | : Click context object. See flash10_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 FLASH10_CMD_CHIP_ERASE command. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash10_init | ( | flash10_t * | ctx, |
flash10_cfg_t * | cfg | ||
) |
Flash 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See flash10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash10_memory_read | ( | flash10_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint32_t | len | ||
) |
Flash 10 memory read function.
This function reads a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x3FFFFF]. |
[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 flash10_memory_write | ( | flash10_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint32_t | len | ||
) |
Flash 10 memory write function.
This function writes a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x3FFFFF]. |
[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 flash10_read_cmd_address_data | ( | flash10_t * | ctx, |
uint8_t | cmd, | ||
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint32_t | len | ||
) |
Flash 10 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 flash10_t object definition for detailed explanation. |
[in] | cmd | : Command byte. |
[in] | address | : Memory address (up to 0x3FFFFF). |
[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 flash10_read_cmd_data | ( | flash10_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Flash 10 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 flash10_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. err_t flash10_read_status | ( | flash10_t * | ctx, |
uint8_t | status_reg_num, | ||
uint8_t * | status | ||
) |
Flash 10 read status function.
This function reads data from the selected status register.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | status_reg_num | : Status register number (1-5). |
[out] | status | : Status data read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void flash10_set_rst_pin | ( | flash10_t * | ctx, |
uint8_t | state | ||
) |
Flash 10 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void flash10_set_wp_pin | ( | flash10_t * | ctx, |
uint8_t | state | ||
) |
Flash 10 set wp pin function.
This function sets the WP pin logic state.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t flash10_soft_reset | ( | flash10_t * | ctx | ) |
Flash 10 soft reset function.
This function executes the soft reset command.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash10_write_cmd | ( | flash10_t * | ctx, |
uint8_t | cmd | ||
) |
Flash 10 write cmd function.
This function writes a desired command by using SPI serial interface.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | cmd | : Command byte. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash10_write_cmd_address_data | ( | flash10_t * | ctx, |
uint8_t | cmd, | ||
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint32_t | len | ||
) |
Flash 10 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 flash10_t object definition for detailed explanation. |
[in] | cmd | : Command byte. |
[in] | address | : Memory address (up to 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 flash10_write_cmd_data | ( | flash10_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Flash 10 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 flash10_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 flash10_write_enable | ( | flash10_t * | ctx | ) |
Flash 10 write enable function.
This function disables memory write-protect via the WP pin and WRITE ENABLE command.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
err_t flash10_write_protect | ( | flash10_t * | ctx | ) |
Flash 10 write protect function.
This function write protects the entire memory via the WP pin and WRITE DISABLE command.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
err_t flash10_write_status | ( | flash10_t * | ctx, |
uint8_t | status_reg_num, | ||
uint8_t | status | ||
) |
Flash 10 write status function.
This function writes data to the selected status register.
[in] | ctx | : Click context object. See flash10_t object definition for detailed explanation. |
[in] | status_reg_num | : Status register number (1-5). |
[in] | status | : Status data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.