sqiflash 2.0.0.0
sqiflash.h File Reference

This file contains API for SQI FLASH Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  sqiflash_t
 SQI FLASH Click context object. More...
 
struct  sqiflash_cfg_t
 SQI FLASH Click configuration object. More...
 

Macros

#define SQIFLASH_STATUS_WEL   0x02
 SQI FLASH description setting.
 
#define SQIFLASH_STATUS_WSE   0x04
 
#define SQIFLASH_STATUS_WSP   0x08
 
#define SQIFLASH_STATUS_WPLD   0x10
 
#define SQIFLASH_STATUS_SEC   0x20
 
#define SQIFLASH_STATUS_RES   0x40
 
#define SQIFLASH_STATUS_BUSY   0x80
 
#define SQIFLASH_CFG_RES   0x01
 
#define SQIFLASH_CFG_IOC   0x02
 
#define SQIFLASH_CFG_BPNV   0x08
 
#define SQIFLASH_CFG_WPEN   0x80
 
#define SQIFLASH_INSTR_NOP   0x00
 SQI FLASH Instructions.
 
#define SQIFLASH_INSTR_RSTEN   0x66
 
#define SQIFLASH_INSTR_RST   0x99
 
#define SQIFLASH_INSTR_EQIO   0x38
 
#define SQIFLASH_INSTR_RSTQIO   0xFF
 
#define SQIFLASH_INSTR_RDSR   0x05
 
#define SQIFLASH_INSTR_WRSR   0x01
 
#define SQIFLASH_INSTR_RDCR   0x35
 
#define SQIFLASH_INSTR_READ   0x03
 
#define SQIFLASH_INSTR_HS_READ   0x0B
 
#define SQIFLASH_INSTR_SQOR   0x6B
 
#define SQIFLASH_INSTR_SQIOR   0xEB
 
#define SQIFLASH_INSTR_SDOR   0x3B
 
#define SQIFLASH_INSTR_SDIOR   0xBB
 
#define SQIFLASH_INSTR_SB   0xC0
 
#define SQIFLASH_INSTR_RBSQI   0x0C
 
#define SQIFLASH_INSTR_RBSPI   0xEC
 
#define SQIFLASH_INSTR_JEDECID   0x9F
 
#define SQIFLASH_INSTR_QUAD_JID   0xAF
 
#define SQIFLASH_INSTR_SFDP   0x5A
 
#define SQIFLASH_INSTR_WREN   0x06
 
#define SQIFLASH_INSTR_WRDI   0x04
 
#define SQIFLASH_INSTR_SE   0x20
 
#define SQIFLASH_INSTR_BE   0xD8
 
#define SQIFLASH_INSTR_CE   0xC7
 
#define SQIFLASH_INSTR_PP   0x02
 
#define SQIFLASH_INSTR_SPI_QUAD   0x32
 
#define SQIFLASH_INSTR_WRSU   0xB0
 
#define SQIFLASH_INSTR_WRRE   0x30
 
#define SQIFLASH_INSTR_RBPR   0x72
 
#define SQIFLASH_INSTR_WBPR   0x42
 
#define SQIFLASH_INSTR_LBPR   0x8D
 
#define SQIFLASH_INSTR_NVWLDR   0xE8
 
#define SQIFLASH_INSTR_ULBPR   0x98
 
#define SQIFLASH_INSTR_RSID   0x88
 
#define SQIFLASH_INSTR_PSID   0xA5
 
#define SQIFLASH_INSTR_LSID   0x85
 
#define SQIFLASH_START_PAGE_ADDRESS   0x010000ul
 
#define SQIFLASH_END_PAGE_ADDRESS   0x7FFFFFul
 
#define SQIFLASH_FLASH_PAGE_SIZE   256
 
#define SQIFLASH_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define SQIFLASH_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define SQIFLASH_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  sqiflash_return_value_t { SQIFLASH_OK = 0 , SQIFLASH_ERROR = -1 }
 SQI FLASH Click return value data. More...
 

Functions

void sqiflash_cfg_setup (sqiflash_cfg_t *cfg)
 SQI FLASH configuration object setup function.
 
err_t sqiflash_init (sqiflash_t *ctx, sqiflash_cfg_t *cfg)
 SQI FLASH initialization function.
 
err_t sqiflash_generic_write (sqiflash_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 SQI FLASH data writing function.
 
err_t sqiflash_generic_read (sqiflash_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 SQI FLASH data reading function.
 
uint8_t sqiflash_busy (sqiflash_t *ctx)
 SQI FLASH Busy.
 
uint8_t sqiflash_get_status_reg (sqiflash_t *ctx)
 SQI FLASH Get Status Register.
 
uint8_t sqiflash_erase_status (sqiflash_t *ctx)
 SQI FLASH Erase Status.
 
uint8_t sqiflash_write_status (sqiflash_t *ctx)
 SQI FLASH Write Status.
 
uint8_t sqiflash_program_status (sqiflash_t *ctx)
 SQI FLASH Program Status.
 
uint8_t sqiflash_protect_status (sqiflash_t *ctx)
 SQI FLASH Protect Status.
 
void sqiflash_lock_security_id (sqiflash_t *ctx)
 SQI FLASH Lock Security Status.
 
uint8_t sqiflash_security_status (sqiflash_t *ctx)
 SQI FLASH Security Status.
 
void sqiflash_write_protect_enable (sqiflash_t *ctx)
 SQI FLASH Write Protect Enable .
 
void sqiflash_write_protect_disable (sqiflash_t *ctx)
 SQI FLASH Write Protect Disable.
 
void sqiflash_hold_enable (sqiflash_t *ctx)
 SQI FLASH Hold Enable.
 
void sqiflash_hold_disable (sqiflash_t *ctx)
 SQI FLASH Hold Disable.
 
void sqiflash_write_suspend (sqiflash_t *ctx)
 SQI FLASH Write Suspend.
 
void sqiflash_write_resume (sqiflash_t *ctx)
 SQI FLASH Write Resume.
 
void sqiflash_spi_get_security_id (sqiflash_t *ctx, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Get Security ID SPI.
 
void sqiflash_sqi_get_security_id (sqiflash_t *ctx, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Get Security ID SQI.
 
void sqiflash_set_security_id (sqiflash_t *ctx, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Set Security ID.
 
void sqiflash_write_disable (sqiflash_t *ctx)
 SQI FLASH Write Disable.
 
void sqiflash_spi_get_bpr (sqiflash_t *ctx, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Get Block Protection Register SPI.
 
void sqiflash_sqi_get_bpr (sqiflash_t *ctx, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Get Block Protection Register SQI.
 
void sqiflash_set_bpr (sqiflash_t *ctx, uint8_t *buffer)
 SQI FLASH Set Block Protection Register.
 
void sqiflash_lock_bpr (sqiflash_t *ctx)
 SQI FLASH Lock Block Protection Register.
 
void sqiflash_nonvolatile_write_lock (sqiflash_t *ctx, uint8_t *buffer)
 SQI FLASH Non-Volatile Write-Lock.
 
void sqiflash_global_block_unlock (sqiflash_t *ctx)
 SQI FLASH Global Block Unlock.
 
void sqiflash_read_generic (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Read.
 
void sqiflash_highspeed_r_read (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH High Speed Read.
 
void sqiflash_quad_write (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Quad Write.
 
void sqiflash_write_generic (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Write.
 
void sqiflash_quad_enable (sqiflash_t *ctx)
 SQI FLASH Quad Enable.
 
void sqiflash_quad_out_read (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Quad Output Read.
 
void sqiflash_quad_io_read (sqiflash_t *ctx, uint32_t address, uint8_t mode, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Quad I/O Read.
 
void sqiflash_quad_reset (sqiflash_t *ctx)
 SQI FLASH Quad Reset.
 
void sqiflash_set_burst (sqiflash_t *ctx, uint8_t length)
 SQI FLASH Set Burst.
 
void sqiflash_read_sqi_burst_wrap (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Read Burst with Wrap through SQI.
 
void sqiflash_read_spi_burst_wrap (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Read Burst with Wrap through SPI.
 
void sqiflash_read_dual_output (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Read Dual Output.
 
void sqiflash_read_dual_io (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH Read Dual I/O.
 
void sqiflash_sector_erase (sqiflash_t *ctx, uint32_t address)
 SQI FLASH Sector Erase.
 
void sqiflash_block_erase (sqiflash_t *ctx, uint32_t address)
 SQI FLASH Block Erase.
 
void sqiflash_chip_erase (sqiflash_t *ctx)
 SQI FLASH Chip Erase.
 
void sqiflash_get_sfdp_params (sqiflash_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count)
 SQI FLASH get Serial Flash Discoverable.
 
uint8_t sqiflash_quad_device_manufac (sqiflash_t *ctx)
 SQI FLASH Quad Device Manufacturer.
 
uint8_t sqiflash_quad_device_type (sqiflash_t *ctx)
 SQI FLASH Quad Device Type.
 
uint8_t sqiflash_quad_device_id (sqiflash_t *ctx)
 SQI FLASH Quad Device ID.
 
uint8_t sqiflash_device_manufac (sqiflash_t *ctx)
 SQI FLASH Device Manufacturer.
 
uint8_t sqiflash_device_type (sqiflash_t *ctx)
 SQI FLASH Device Type.
 
uint8_t sqiflash_device_id (sqiflash_t *ctx)
 SQI FLASH Device ID.
 
void sqiflash_reset (sqiflash_t *ctx)
 SQI FLASH Reset.
 
void sqiflash_write_status_reg (sqiflash_t *ctx, uint8_t s_reg)
 SQI FLASH Write Status Register.
 
uint8_t sqiflash_get_config_reg (sqiflash_t *ctx)
 SQI FLASH Get Config Register.
 
void sqiflash_write_enable (sqiflash_t *ctx)
 SQI FLASH Write Enable.
 

Detailed Description

This file contains API for SQI FLASH Click Driver.

Enumeration Type Documentation

◆ sqiflash_return_value_t

SQI FLASH Click return value data.

Predefined enum values for driver return values.

Enumerator
SQIFLASH_OK 
SQIFLASH_ERROR