flash5 2.0.0.0
|
Functions | |
void | flash5_cfg_setup (flash5_cfg_t *cfg) |
Config Object Initialization function. | |
FLASH5_RETVAL | flash5_init (flash5_t *ctx, flash5_cfg_t *cfg) |
Initialization function. | |
void | flash5_generic_transfer (flash5_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | flash5_read_data (flash5_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint16_t n_buf_size) |
Generic funcion for reading. | |
void | flash5_write_data (flash5_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint16_t n_buf_size) |
Generic funcion for writing. | |
void | flash5_send_cmd (flash5_t *ctx, uint8_t cmd_data) |
Function for sending one Byte od data. | |
uint8_t | flash5_set_wp_pin (flash5_t *ctx, uint8_t status) |
Sets wp pin to one state. | |
uint8_t | flash5_set_hold_pin (flash5_t *ctx, uint8_t status) |
Sets hold pin to one state. | |
uint8_t | flash5_device_id_check (flash5_t *ctx) |
Funcion for checking device id. | |
void | flash5_page_read (flash5_t *ctx, uint16_t page_num) |
Function for setting page read. | |
void | flash5_execute_load (flash5_t *ctx, uint16_t page_num) |
Function for executing page load. | |
void | flash5_page_read_memory (flash5_t *ctx, uint16_t column_addr, uint8_t *data_buf, uint16_t buf_size) |
Function for reading one page. | |
void | flash5_continous_read_memory (flash5_t *ctx, uint8_t *data_buf, uint16_t buf_size) |
Function for continous reading. | |
void | flash5_page_load_memory (flash5_t *ctx, uint16_t column_addr, uint8_t *data_buf, uint16_t buf_size) |
Function for loading one page. | |
uint8_t | flash5_read_status_data (flash5_t *ctx, uint8_t status_cmd, uint8_t status_addr) |
Function for reading status data. | |
void | flash5_write_status_data (flash5_t *ctx, uint8_t status_cmd, uint8_t status_addr, uint8_t status_data) |
Function for writing status data. | |
void | flash5_software_reset (flash5_t *ctx) |
Function for reseting device. | |
void | flash5_erase_page_data (flash5_t *ctx, uint16_t page_addr) |
Function for eraseing one page. | |
void flash5_cfg_setup | ( | flash5_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void flash5_continous_read_memory | ( | flash5_t * | ctx, |
uint8_t * | data_buf, | ||
uint16_t | buf_size ) |
Function for continous reading.
ctx | Click object. |
data_buf | Pointer to output array |
buf_size | Size of iutput array |
uint8_t flash5_device_id_check | ( | flash5_t * | ctx | ) |
Funcion for checking device id.
ctx | Click object. |
void flash5_erase_page_data | ( | flash5_t * | ctx, |
uint16_t | page_addr ) |
Function for eraseing one page.
ctx | Click object. |
page_addr | Page to be erased |
void flash5_execute_load | ( | flash5_t * | ctx, |
uint16_t | page_num ) |
Function for executing page load.
ctx | Click object. |
page_num | Address of page |
void flash5_generic_transfer | ( | flash5_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
FLASH5_RETVAL flash5_init | ( | flash5_t * | ctx, |
flash5_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void flash5_page_load_memory | ( | flash5_t * | ctx, |
uint16_t | column_addr, | ||
uint8_t * | data_buf, | ||
uint16_t | buf_size ) |
Function for loading one page.
ctx | Click object. |
column_addr | Address from which data will be written |
data_buf | Pointer to input array |
buf_size | Size of iutput array |
void flash5_page_read | ( | flash5_t * | ctx, |
uint16_t | page_num ) |
Function for setting page read.
ctx | Click object. |
page_num | Address of page |
void flash5_page_read_memory | ( | flash5_t * | ctx, |
uint16_t | column_addr, | ||
uint8_t * | data_buf, | ||
uint16_t | buf_size ) |
Function for reading one page.
ctx | Click object. |
column_addr | Address from which data will be read |
data_buf | Pointer to output array |
buf_size | Size of iutput array |
void flash5_read_data | ( | flash5_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_buf, | ||
uint16_t | n_buf_size ) |
Generic funcion for reading.
ctx | Click object. |
reg_addr | Registar of reading buf |
data_buf | Pointer to array of output data |
n_buf_size | Size of array of output data |
uint8_t flash5_read_status_data | ( | flash5_t * | ctx, |
uint8_t | status_cmd, | ||
uint8_t | status_addr ) |
Function for reading status data.
ctx | Click object. |
status_cmd | Command status |
status_addr | Address of status |
void flash5_send_cmd | ( | flash5_t * | ctx, |
uint8_t | cmd_data ) |
Function for sending one Byte od data.
ctx | Click object. |
cmd_data | Byte to be sent |
uint8_t flash5_set_hold_pin | ( | flash5_t * | ctx, |
uint8_t | status ) |
Sets hold pin to one state.
ctx | Click object. |
status | Registar of sending target |
uint8_t flash5_set_wp_pin | ( | flash5_t * | ctx, |
uint8_t | status ) |
Sets wp pin to one state.
ctx | Click object. |
status | Registar of sending target |
void flash5_software_reset | ( | flash5_t * | ctx | ) |
Function for reseting device.
ctx | Click object. |
void flash5_write_data | ( | flash5_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_buf, | ||
uint16_t | n_buf_size ) |
Generic funcion for writing.
ctx | Click object. |
reg_addr | Registar of writing buf |
data_buf | Pointer to array of input data |
n_buf_size | Size of array of input data |
void flash5_write_status_data | ( | flash5_t * | ctx, |
uint8_t | status_cmd, | ||
uint8_t | status_addr, | ||
uint8_t | status_data ) |
Function for writing status data.
ctx | Click object. |
status_cmd | Command status |
status_addr | Address of status |
status_data | Input status |