flash6 2.0.0.0
Public function

Functions

void flash6_cfg_setup (flash6_cfg_t *cfg)
 Config Object Initialization function.
 
FLASH6_RETVAL flash6_init (flash6_t *ctx, flash6_cfg_t *cfg)
 Initialization function.
 
void flash6_generic_transfer (flash6_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void flash6_read_data (flash6_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint16_t len)
 Generic funcion for reading.
 
void flash6_write_data (flash6_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint8_t len)
 Generic funcion for writing.
 
void flash6_send_cmd (flash6_t *ctx, uint8_t cmd_data)
 Function for sending one Byte od data.
 
uint8_t flash6_get_manufacture_device_id (flash6_t *ctx, uint8_t *manufacture_id, uint8_t *device_id)
 Funcion for checking manufacture and device id.
 
void flash6_erase_memory_segment (flash6_t *ctx, uint8_t segment, uint32_t start_addr)
 Function for eraseing segment.
 
uint8_t flash6_read_status_reg (flash6_t *ctx, uint8_t status_cmd)
 Function for reading status register.
 
void flash6_write_status_reg (flash6_t *ctx, uint8_t status_cmd, uint8_t status_data)
 Function for writing status register.
 
void flash6_write_memory_data (flash6_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Function used for writing in memory.
 
void flash6_read_memory_data (flash6_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Function used for reading from memory.
 
void flash6_software_reset (flash6_t *ctx)
 Function for reseting device.
 

Detailed Description

Function Documentation

◆ flash6_cfg_setup()

void flash6_cfg_setup ( flash6_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.

◆ flash6_erase_memory_segment()

void flash6_erase_memory_segment ( flash6_t * ctx,
uint8_t segment,
uint32_t start_addr )

Function for eraseing segment.

Parameters
ctxClick object.
segmentSegment to be deleted
page_addrAddress for start erase
Note
segment can be: - Sector Erase (4KB)
  • Block Erase (32KB)
  • Block Erase (64KB)

◆ flash6_generic_transfer()

void flash6_generic_transfer ( flash6_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
blockTransfer block structure.

@description Generic SPI transfer, for sending and receiving packages

◆ flash6_get_manufacture_device_id()

uint8_t flash6_get_manufacture_device_id ( flash6_t * ctx,
uint8_t * manufacture_id,
uint8_t * device_id )

Funcion for checking manufacture and device id.

Parameters
ctxClick object.
manufacture_id
device_id
Returns
either FLASH5_DEVICE_ERROR or FLASH5_DEVICE_OK.

◆ flash6_init()

FLASH6_RETVAL flash6_init ( flash6_t * ctx,
flash6_cfg_t * cfg )

Initialization function.

Parameters
flash6Click object.
cfgClick configuration structure.

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

◆ flash6_read_data()

void flash6_read_data ( flash6_t * ctx,
uint8_t reg_addr,
uint8_t * data_buf,
uint16_t len )

Generic funcion for reading.

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

◆ flash6_read_memory_data()

void flash6_read_memory_data ( flash6_t * ctx,
uint32_t addr,
uint8_t * data_buf,
uint16_t buf_size )

Function used for reading from memory.

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

◆ flash6_read_status_reg()

uint8_t flash6_read_status_reg ( flash6_t * ctx,
uint8_t status_cmd )

Function for reading status register.

Parameters
ctxClick object.
status_cmdCommand status

◆ flash6_send_cmd()

void flash6_send_cmd ( flash6_t * ctx,
uint8_t cmd_data )

Function for sending one Byte od data.

Parameters
cmd_dataByte to be sent

◆ flash6_software_reset()

void flash6_software_reset ( flash6_t * ctx)

Function for reseting device.

Parameters
ctxClick object.

◆ flash6_write_data()

void flash6_write_data ( flash6_t * ctx,
uint8_t reg_addr,
uint8_t * data_buf,
uint8_t len )

Generic funcion for writing.

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

◆ flash6_write_memory_data()

void flash6_write_memory_data ( flash6_t * ctx,
uint32_t addr,
uint8_t * data_buf,
uint16_t buf_size )

Function used for writing in memory.

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

◆ flash6_write_status_reg()

void flash6_write_status_reg ( flash6_t * ctx,
uint8_t status_cmd,
uint8_t status_data )

Function for writing status register.

Parameters
ctxClick object.
status_cmdCommand status
status_dataInput status