flash3 2.0.0.0
Public function

Functions

void flash3_cfg_setup (flash3_cfg_t *cfg)
 Config Object Initialization function.
 
FLASH3_RETVAL flash3_init (flash3_t *ctx, flash3_cfg_t *cfg)
 Initialization function.
 
void flash3_generic_transfer (flash3_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void flash3_pause (flash3_t *ctx)
 Pause function.
 
void flash3_unpause (flash3_t *ctx)
 Unpause function.
 
void flash3_wr_prot_enable (flash3_t *ctx)
 Write Protect enable function.
 
void flash3_wr_prot_disable (flash3_t *ctx)
 Disable write function.
 
void flash3_setting (flash3_t *ctx)
 Initialisation function.
 
void flash3_write_enable (flash3_t *ctx)
 Enable write function.
 
void flash3_write_disable (flash3_t *ctx)
 Enable write function.
 
void flash3_write_cmd (flash3_t *ctx, uint8_t cmd)
 Write command function.
 
void flash3_write_adv_cmd (flash3_t *ctx, uint8_t cmd, uint8_t *arg, uint32_t cnt)
 Flash 3 Command Advanced function.
 
uint8_t flash3_rd_stat_reg (flash3_t *ctx)
 Reads Status Register function.
 
void flash3_wr_stat_reg (flash3_t *ctx, uint8_t status)
 Write Status Register function.
 
uint8_t flash3_rd_func_reg (flash3_t *ctx)
 Reads Function Register function.
 
void flash3_wr_func_reg (flash3_t *ctx, uint8_t function)
 Reads Function Register function.
 
void flash3_normal_read (flash3_t *ctx, uint32_t addr, uint8_t *buff, uint32_t cnt)
 Normal data read function.
 
void flash3_fast_read (flash3_t *ctx, uint32_t addr, uint8_t *buff, uint32_t cnt)
 Fast data read function.
 
void flash3_write (flash3_t *ctx, uint32_t addr, uint8_t *buff, uint32_t cnt)
 Fast data read function.
 
void flash3_chip_erase (flash3_t *ctx)
 Chip erase function.
 
void flash3_sector_erase (flash3_t *ctx, uint32_t address)
 Sector erase function.
 
void flash3_block32_erase (flash3_t *ctx, uint32_t address)
 Block 32 erase function.
 
void flash3_block64_erase (flash3_t *ctx, uint32_t address)
 Block 64 erase function.
 

Detailed Description

Function Documentation

◆ flash3_block32_erase()

void flash3_block32_erase ( flash3_t * ctx,
uint32_t address )

Block 32 erase function.

Parameters
ctxClick object.
addressFunction writes 8-bit data into function register.

@description This function can take as long as 750 milliseconds to finish erasing chosen block.

◆ flash3_block64_erase()

void flash3_block64_erase ( flash3_t * ctx,
uint32_t address )

Block 64 erase function.

Parameters
ctxClick object.
addressFunction writes 8-bit data into function register.

@description This function can take as long as 1.5 seconds to finish erasing chosen block.

◆ flash3_cfg_setup()

void flash3_cfg_setup ( flash3_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.

◆ flash3_chip_erase()

void flash3_chip_erase ( flash3_t * ctx)

Chip erase function.

Parameters
ctxClick object.

@description This function is used to erase the entire memory array of a Flash 3 device.

◆ flash3_fast_read()

void flash3_fast_read ( flash3_t * ctx,
uint32_t addr,
uint8_t * buff,
uint32_t cnt )

Fast data read function.

Parameters
ctxClick object.
addrFunction writes 8-bit data into function register.
buffdata array read from memory.
cnt32-bit data representing number of bytes user wants to read.

@description This function is used to read memory contents at a maximum frequency of 133MHz.

◆ flash3_generic_transfer()

void flash3_generic_transfer ( flash3_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

◆ flash3_init()

FLASH3_RETVAL flash3_init ( flash3_t * ctx,
flash3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ flash3_normal_read()

void flash3_normal_read ( flash3_t * ctx,
uint32_t addr,
uint8_t * buff,
uint32_t cnt )

Normal data read function.

Parameters
ctxClick object.
addrFunction writes 8-bit data into function register.
buffdata array read from memory.
cnt32-bit data representing number of bytes user wants to read.

@description This function is used to read memory contents at a maximum frequency of 50MHz.

◆ flash3_pause()

void flash3_pause ( flash3_t * ctx)

Pause function.

Parameters
ctxClick object.

@description This function pauses serial communication, without resetting the serial sequence.

◆ flash3_rd_func_reg()

uint8_t flash3_rd_func_reg ( flash3_t * ctx)

Reads Function Register function.

Parameters
ctxClick object.

@description This function is used to read function register.

◆ flash3_rd_stat_reg()

uint8_t flash3_rd_stat_reg ( flash3_t * ctx)

Reads Status Register function.

Parameters
ctxClick object.

@description This function is used to read status register.

◆ flash3_sector_erase()

void flash3_sector_erase ( flash3_t * ctx,
uint32_t address )

Sector erase function.

Parameters
ctxClick object.
addrFunction writes 8-bit data into function register.

@description This function is used to erase a chosen 4 Kbyte sector.

◆ flash3_setting()

void flash3_setting ( flash3_t * ctx)

Initialisation function.

Parameters
ctxClick object.

@description This function is used to set needed values to default.

◆ flash3_unpause()

void flash3_unpause ( flash3_t * ctx)

Unpause function.

Parameters
ctxClick object.

@description This function unpauses serial communication.

◆ flash3_wr_func_reg()

void flash3_wr_func_reg ( flash3_t * ctx,
uint8_t function )

Reads Function Register function.

Parameters
ctxClick object.
functionFunction writes 8-bit data into function register.

@description This function writes 8-bit data into function register.

◆ flash3_wr_prot_disable()

void flash3_wr_prot_disable ( flash3_t * ctx)

Disable write function.

Parameters
ctxClick object.

@description This function is used to to disable write function.

◆ flash3_wr_prot_enable()

void flash3_wr_prot_enable ( flash3_t * ctx)

Write Protect enable function.

Parameters
ctxClick object.

@description This function is used to enable write protect.

◆ flash3_wr_stat_reg()

void flash3_wr_stat_reg ( flash3_t * ctx,
uint8_t status )

Write Status Register function.

Parameters
ctxClick object.

@description This function writes 8-bit data into status register.

◆ flash3_write()

void flash3_write ( flash3_t * ctx,
uint32_t addr,
uint8_t * buff,
uint32_t cnt )

Fast data read function.

Parameters
ctxClick object.
addrFunction writes 8-bit data into function register.
buffdata array read from memory.
cnt32-bit data representing number of bytes user wants to read.

@description This function is used to read memory contents at a maximum frequency of 133MHz.

◆ flash3_write_adv_cmd()

void flash3_write_adv_cmd ( flash3_t * ctx,
uint8_t cmd,
uint8_t * arg,
uint32_t cnt )

Flash 3 Command Advanced function.

Parameters
ctxClick object.
cmd8-bit data representing command.
argdata representing required arguments.
cnt32-bit data representing number of bytes used for arguments.

@description This function is used to executes various commands that requires arguments.

◆ flash3_write_cmd()

void flash3_write_cmd ( flash3_t * ctx,
uint8_t cmd )

Write command function.

Parameters
ctxClick object.
cmd8-bit data representing command.

@description This function is used to executes various commands.

◆ flash3_write_disable()

void flash3_write_disable ( flash3_t * ctx)

Enable write function.

Parameters
ctxClick object.

@description This function is used to to enable write function.

◆ flash3_write_enable()

void flash3_write_enable ( flash3_t * ctx)

Enable write function.

Parameters
ctxClick object.

@description This function is used to to enable write function.