flash4 2.0.0.0
Public function

Functions

void flash4_cfg_setup (flash4_cfg_t *cfg)
 Config Object Initialization function.
 
FLASH4_RETVAL flash4_init (flash4_t *ctx, flash4_cfg_t *cfg)
 Initialization function. *.
 
void flash4_generic_transfer (flash4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void flash4_read_manufacturer_id (flash4_t *ctx, uint8_t *device_id)
 Read Manufacturer ID function.
 
void flash4_read_identification (flash4_t *ctx, uint8_t *out_data, uint8_t n_data)
 Read Identification function.
 
uint8_t flash4_read_electronic_id (flash4_t *ctx)
 Read Electronic Signature function.
 
void flash4_read_serial_flash_parameters (flash4_t *ctx, uint8_t *out_params, uint8_t c)
 Read Serial Flash Discoverable Parameters function.
 
uint8_t flash4_read_byte (flash4_t *ctx, uint8_t reg)
 Read byte from register function.
 
void flash4_write_byte (flash4_t *ctx, uint8_t reg, uint8_t data_buff)
 Write one byte to register function.
 
void flash4_write_command (flash4_t *ctx, uint8_t cmd)
 Write command function.
 
void flash4_write_reg (flash4_t *ctx, uint8_t status, uint8_t config)
 Write data to register function.
 
void flash4_read_ecc (flash4_t *ctx, uint8_t *out_ecc, uint8_t n_dummy)
 Read ECC Status Register function.
 
void flash4_read_auto_boot (flash4_t *ctx, uint8_t *out_ab)
 Read AutoBoot Register function.
 
void flash4_read_flash (flash4_t *ctx, uint8_t *out_data, uint32_t addr, uint8_t n_data)
 Read Flash function.
 
void flash4_read_flash_4 (flash4_t *ctx, uint8_t *out_data, uint32_t addr, uint8_t n_data)
 Read Flash with 4 byte address function.
 
void flash4_fast_read_flash (flash4_t *ctx, uint8_t *out_data, uint32_t addr, uint8_t n_data_dummy)
 Fast read Flash function.
 
void flash4_fast_read_flash_4 (flash4_t *ctx, uint8_t *out_data, uint8_t addr, uint8_t n_data)
 Fast read Flash with 4 byte address function.
 
void flash4_page_program_4 (flash4_t *ctx, uint8_t *in_data, uint32_t addr, uint8_t n_data)
 Write data to address with 4 byte address function.
 
void flash4_sector_erase (flash4_t *ctx, uint32_t addr)
 Sector Erase function.
 
void flash4_sector_erase_4 (flash4_t *ctx, uint32_t addr)
 Sector Erase for 4 bytes address function.
 
uint8_t flash4_check_wip (flash4_t *ctx)
 Function for wip.
 
uint8_t flash4_check_wel (flash4_t *ctx)
 Function for wel.
 
uint8_t flash4_check_ps (flash4_t *ctx)
 Function for ps.
 
uint8_t flash4_check_es (flash4_t *ctx)
 Function for es.
 
void flash4_reset (flash4_t *ctx)
 Function for reset.
 

Detailed Description

Function Documentation

◆ flash4_cfg_setup()

void flash4_cfg_setup ( flash4_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.

◆ flash4_check_es()

uint8_t flash4_check_es ( flash4_t * ctx)

Function for es.

Parameters
ctxClick object.

@description This function checks es.

◆ flash4_check_ps()

uint8_t flash4_check_ps ( flash4_t * ctx)

Function for ps.

Parameters
ctxClick object.

@description This function checks ps.

◆ flash4_check_wel()

uint8_t flash4_check_wel ( flash4_t * ctx)

Function for wel.

Parameters
ctxClick object.

@description This function checks wel.

◆ flash4_check_wip()

uint8_t flash4_check_wip ( flash4_t * ctx)

Function for wip.

Parameters
ctxClick object.

@description This function checks wip.

◆ flash4_fast_read_flash()

void flash4_fast_read_flash ( flash4_t * ctx,
uint8_t * out_data,
uint32_t addr,
uint8_t n_data_dummy )

Fast read Flash function.

Parameters
ctxClick object.
out_dataData output.
addrStart address.
n_data_dummyNumber of data.

@description This function reads flash performing fast read feature.

◆ flash4_fast_read_flash_4()

void flash4_fast_read_flash_4 ( flash4_t * ctx,
uint8_t * out_data,
uint8_t addr,
uint8_t n_data )

Fast read Flash with 4 byte address function.

Parameters
ctxClick object.
out_dataData output.
addrStart address.
n_dataNumber of data.

@description This function reads flash performing fast read Flash with 4 byte address feature.

◆ flash4_generic_transfer()

void flash4_generic_transfer ( flash4_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

◆ flash4_init()

FLASH4_RETVAL flash4_init ( flash4_t * ctx,
flash4_cfg_t * cfg )

Initialization function. *.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ flash4_page_program_4()

void flash4_page_program_4 ( flash4_t * ctx,
uint8_t * in_data,
uint32_t addr,
uint8_t n_data )

Write data to address with 4 byte address function.

Parameters
ctxClick object.
in_dataData output.
addrStart address.
n_dataNumber of data.

@description This function writes data to address with 4 byte address.

◆ flash4_read_auto_boot()

void flash4_read_auto_boot ( flash4_t * ctx,
uint8_t * out_ab )

Read AutoBoot Register function.

Parameters
ctxClick object.
out_abData output.

@description This function reads AutoBoot Register.

◆ flash4_read_byte()

uint8_t flash4_read_byte ( flash4_t * ctx,
uint8_t reg )

Read byte from register function.

Parameters
ctxClick object.
regRegister which will be read.

@description This function reads a single byte from register.

◆ flash4_read_ecc()

void flash4_read_ecc ( flash4_t * ctx,
uint8_t * out_ecc,
uint8_t n_dummy )

Read ECC Status Register function.

Parameters
ctxClick object.
out_eccData output.
n_dummyNumber of data(max 200 byte).

@description This function reads ECC Status Register.

◆ flash4_read_electronic_id()

uint8_t flash4_read_electronic_id ( flash4_t * ctx)

Read Electronic Signature function.

Parameters
ctxClick object.

@description This function reads Electronic Signature.

◆ flash4_read_flash()

void flash4_read_flash ( flash4_t * ctx,
uint8_t * out_data,
uint32_t addr,
uint8_t n_data )

Read Flash function.

Parameters
ctxClick object.
out_dataData output.
addrStart address.
n_dataNumber of data.

@description This function reads Flash.

◆ flash4_read_flash_4()

void flash4_read_flash_4 ( flash4_t * ctx,
uint8_t * out_data,
uint32_t addr,
uint8_t n_data )

Read Flash with 4 byte address function.

Parameters
ctxClick object.
out_dataData output.
addrStart address.
n_dataNumber of data.

@description This function reads Flash with 4 byte address.

◆ flash4_read_identification()

void flash4_read_identification ( flash4_t * ctx,
uint8_t * out_data,
uint8_t n_data )

Read Identification function.

Parameters
ctxClick object.
out_dataData output.
n_dataNumber of data.

@description This function reads Identification.

◆ flash4_read_manufacturer_id()

void flash4_read_manufacturer_id ( flash4_t * ctx,
uint8_t * device_id )

Read Manufacturer ID function.

Parameters
ctxClick object.
device_id[ 0 ] - Manufacturer ID and [ 1 ] - Device ID (hex).

@description Read manufacturer id.

◆ flash4_read_serial_flash_parameters()

void flash4_read_serial_flash_parameters ( flash4_t * ctx,
uint8_t * out_params,
uint8_t c )

Read Serial Flash Discoverable Parameters function.

Parameters
ctxClick object.
out_paramsData output.
n_dataNumber of data.

@description This function reads Serial Flash Discoverable Parameters.

◆ flash4_reset()

void flash4_reset ( flash4_t * ctx)

Function for reset.

Parameters
ctxClick object.

@description This function resets the device.

◆ flash4_sector_erase()

void flash4_sector_erase ( flash4_t * ctx,
uint32_t addr )

Sector Erase function.

Parameters
ctxClick object.
addrStart address.

@description This function erases sector.

◆ flash4_sector_erase_4()

void flash4_sector_erase_4 ( flash4_t * ctx,
uint32_t addr )

Sector Erase for 4 bytes address function.

Parameters
ctxClick object.
addrStart address.

@description This function erases sector for 4 bytes address.

◆ flash4_write_byte()

void flash4_write_byte ( flash4_t * ctx,
uint8_t reg,
uint8_t data_buff )

Write one byte to register function.

Parameters
ctxClick object.
regRegister in which the data will be written.
data_buffData which be written in the register.

@description This function writes one byte to register.

◆ flash4_write_command()

void flash4_write_command ( flash4_t * ctx,
uint8_t cmd )

Write command function.

Parameters
ctxClick object.
cmdCommand.

@description This function writes command.

◆ flash4_write_reg()

void flash4_write_reg ( flash4_t * ctx,
uint8_t status,
uint8_t config )

Write data to register function.

Parameters
ctxClick object.
statusCommand.
configConfig.

@description This function writes data to register.