flash5 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ flash5_cfg_setup()

void flash5_cfg_setup ( flash5_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ flash5_continous_read_memory()

void flash5_continous_read_memory ( flash5_t * ctx,
uint8_t * data_buf,
uint16_t buf_size )

Function for continous reading.

Parameters
ctxClick object.
data_bufPointer to output array
buf_sizeSize of iutput array
Note
When you do continous reading you should set execute load and page read

◆ flash5_device_id_check()

uint8_t flash5_device_id_check ( flash5_t * ctx)

Funcion for checking device id.

Parameters
ctxClick object.
Returns
either FLASH5_DEVICE_ERROR or FLASH5_DEVICE_OK.

◆ flash5_erase_page_data()

void flash5_erase_page_data ( flash5_t * ctx,
uint16_t page_addr )

Function for eraseing one page.

Parameters
ctxClick object.
page_addrPage to be erased

◆ flash5_execute_load()

void flash5_execute_load ( flash5_t * ctx,
uint16_t page_num )

Function for executing page load.

Parameters
ctxClick object.
page_numAddress of page

◆ flash5_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ flash5_init()

FLASH5_RETVAL flash5_init ( flash5_t * ctx,
flash5_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ flash5_page_load_memory()

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.

Parameters
ctxClick object.
column_addrAddress from which data will be written
data_bufPointer to input array
buf_sizeSize of iutput array

◆ flash5_page_read()

void flash5_page_read ( flash5_t * ctx,
uint16_t page_num )

Function for setting page read.

Parameters
ctxClick object.
page_numAddress of page

◆ flash5_page_read_memory()

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.

Parameters
ctxClick object.
column_addrAddress from which data will be read
data_bufPointer to output array
buf_sizeSize of iutput array

◆ flash5_read_data()

void flash5_read_data ( flash5_t * ctx,
uint8_t reg_addr,
uint8_t * data_buf,
uint16_t n_buf_size )

Generic funcion for reading.

Parameters
ctxClick object.
reg_addrRegistar of reading buf
data_bufPointer to array of output data
n_buf_sizeSize of array of output data

◆ flash5_read_status_data()

uint8_t flash5_read_status_data ( flash5_t * ctx,
uint8_t status_cmd,
uint8_t status_addr )

Function for reading status data.

Parameters
ctxClick object.
status_cmdCommand status
status_addrAddress of status
Returns
status of status_addr you inputed.

◆ flash5_send_cmd()

void flash5_send_cmd ( flash5_t * ctx,
uint8_t cmd_data )

Function for sending one Byte od data.

Parameters
ctxClick object.
cmd_dataByte to be sent

◆ flash5_set_hold_pin()

uint8_t flash5_set_hold_pin ( flash5_t * ctx,
uint8_t status )

Sets hold pin to one state.

Parameters
ctxClick object.
statusRegistar of sending target
Returns
either FLASH5_DEVICE_ERROR or FLASH5_DEVICE_OK.

◆ flash5_set_wp_pin()

uint8_t flash5_set_wp_pin ( flash5_t * ctx,
uint8_t status )

Sets wp pin to one state.

Parameters
ctxClick object.
statusRegistar of sending target
Returns
either FLASH5_DEVICE_ERROR or FLASH5_DEVICE_OK.

◆ flash5_software_reset()

void flash5_software_reset ( flash5_t * ctx)

Function for reseting device.

Parameters
ctxClick object.

◆ flash5_write_data()

void flash5_write_data ( flash5_t * ctx,
uint8_t reg_addr,
uint8_t * data_buf,
uint16_t n_buf_size )

Generic funcion for writing.

Parameters
ctxClick object.
reg_addrRegistar of writing buf
data_bufPointer to array of input data
n_buf_sizeSize of array of input data

◆ flash5_write_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.

Parameters
ctxClick object.
status_cmdCommand status
status_addrAddress of status
status_dataInput status