flash9 2.0.0.0
|
API for configuring and manipulating Flash 9 Click driver. More...
Topics | |
Flash 9 Instructions List | |
List of instructions of Flash 9 Click driver. | |
Flash 9 Registers Settings | |
Settings for registers of Flash 9 Click driver. | |
Flash 9 MikroBUS Map | |
MikroBUS pin mapping of Flash 9 Click driver. | |
Functions | |
void | flash9_cfg_setup (flash9_cfg_t *cfg) |
Flash 9 configuration object setup function. | |
err_t | flash9_init (flash9_t *ctx, flash9_cfg_t *cfg) |
Flash 9 initialization function. | |
err_t | flash9_default_cfg (flash9_t *ctx) |
Flash 9 default configuration function. | |
err_t | flash9_generic_write (flash9_t *ctx, uint8_t *data_in, uint16_t in_len) |
Flash 9 generic write function. | |
err_t | flash9_generic_read (flash9_t *ctx, uint8_t *data_in, uint8_t in_len, uint8_t *data_out, uint16_t out_len) |
Flash 9 generic read function. | |
err_t | flash9_write_register (flash9_t *ctx, uint8_t reg, uint8_t *data_in, uint16_t in_len) |
Flash 9 write register function. | |
err_t | flash9_read_register (flash9_t *ctx, uint8_t reg, uint8_t *data_out, uint16_t out_len) |
Flash 9 read register function. | |
err_t | flash9_write_command (flash9_t *ctx, uint8_t cmd) |
Flash 9 write command function. | |
void | flash9_set_wp_pin (flash9_t *ctx, uint8_t state) |
Flash 9 set wp pin function. | |
void | flash9_set_hld_pin (flash9_t *ctx, uint8_t state) |
Flash 9 set hld pin function. | |
void | flash9_set_rst_pin (flash9_t *ctx, uint8_t state) |
Flash 9 set rst pin function. | |
err_t | flash9_check_communication (flash9_t *ctx) |
Flash 9 check communication function. | |
err_t | flash9_erase_memory (flash9_t *ctx, uint8_t erase_cmd, uint32_t address) |
Flash 9 erase memory function. | |
err_t | flash9_read_status (flash9_t *ctx, uint8_t status_cmd, uint8_t *status) |
Flash 9 read status function. | |
err_t | flash9_write_status (flash9_t *ctx, uint8_t status_cmd, uint8_t status) |
Flash 9 write status function. | |
err_t | flash9_memory_write (flash9_t *ctx, uint32_t address, uint8_t *data_in, uint16_t len) |
Flash 9 memory write function. | |
err_t | flash9_memory_read (flash9_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len) |
Flash 9 memory read function. | |
err_t | flash9_memory_read_fast (flash9_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len) |
Flash 9 memory read fast function. | |
API for configuring and manipulating Flash 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void flash9_cfg_setup | ( | flash9_cfg_t * | cfg | ) |
Flash 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See flash9_cfg_t object definition for detailed explanation. |
err_t flash9_check_communication | ( | flash9_t * | ctx | ) |
Flash 9 check communication function.
This function checks the communication by reading and verifying the JEDEC ID.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t flash9_default_cfg | ( | flash9_t * | ctx | ) |
Flash 9 default configuration function.
This function executes a default configuration of Flash 9 click board.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t flash9_erase_memory | ( | flash9_t * | ctx, |
uint8_t | erase_cmd, | ||
uint32_t | address ) |
Flash 9 erase memory function.
This function erases the selected amount of memory which contains the selected address.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | erase_cmd | : Erase command (32-bit or 24-bit). |
[in] | address | : The sector or block of memory that contains this address will be erased. |
0
- Success, -1
- Error.err_t flash9_generic_read | ( | flash9_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | in_len, | ||
uint8_t * | data_out, | ||
uint16_t | out_len ) |
Flash 9 generic read function.
This function writes and then reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | in_len | : Number of bytes to be written. |
[out] | data_out | : Output read data. |
[in] | out_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t flash9_generic_write | ( | flash9_t * | ctx, |
uint8_t * | data_in, | ||
uint16_t | in_len ) |
Flash 9 generic write function.
This function writes a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | in_len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t flash9_init | ( | flash9_t * | ctx, |
flash9_cfg_t * | cfg ) |
Flash 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See flash9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t flash9_memory_read | ( | flash9_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint16_t | len ) |
Flash 9 memory read function.
This function reads a desired number of data bytes from the memory starting from the selected address.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | address | : Starting address (32-bit). |
[in] | data_out | : Output data read. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error.err_t flash9_memory_read_fast | ( | flash9_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint16_t | len ) |
Flash 9 memory read fast function.
This function reads a desired number of data bytes from the memory starting from the selected address performing the fast read command.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | address | : Starting address (32-bit). |
[in] | data_out | : Output data read. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error.err_t flash9_memory_write | ( | flash9_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint16_t | len ) |
Flash 9 memory write function.
This function writes a desired number of data bytes to the memory starting from the selected address.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | address | : Starting address (32-bit). |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes (up to 256). |
0
- Success, -1
- Error.err_t flash9_read_register | ( | flash9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint16_t | out_len ) |
Flash 9 read register function.
This function reads a desired number of data bytes from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
[in] | out_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t flash9_read_status | ( | flash9_t * | ctx, |
uint8_t | status_cmd, | ||
uint8_t * | status ) |
Flash 9 read status function.
This function reads the selected status.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | status_cmd | : Status command. |
[out] | status | : Status byte read. |
0
- Success, -1
- Error.void flash9_set_hld_pin | ( | flash9_t * | ctx, |
uint8_t | state ) |
Flash 9 set hld pin function.
This function sets the HLD pin logic state.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void flash9_set_rst_pin | ( | flash9_t * | ctx, |
uint8_t | state ) |
Flash 9 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void flash9_set_wp_pin | ( | flash9_t * | ctx, |
uint8_t | state ) |
Flash 9 set wp pin function.
This function sets the WP pin logic state.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t flash9_write_command | ( | flash9_t * | ctx, |
uint8_t | cmd ) |
Flash 9 write command function.
This function writes a desired command by using SPI serial interface.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | cmd | : Command byte. |
0
- Success, -1
- Error.err_t flash9_write_register | ( | flash9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint16_t | in_len ) |
Flash 9 write register function.
This function writes a desired number of data bytes to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
[in] | in_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t flash9_write_status | ( | flash9_t * | ctx, |
uint8_t | status_cmd, | ||
uint8_t | status ) |
Flash 9 write status function.
This function writes the selected status.
[in] | ctx | : Click context object. See flash9_t object definition for detailed explanation. |
[in] | status_cmd | : Status command. |
[in] | status | : Status byte to be written. |
0
- Success, -1
- Error.