flash3 2.0.0.0
flash3.h File Reference

This file contains API for Flash 3 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  flash3_t
 Click ctx object definition. More...
 
struct  flash3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define FLASH3_MAP_MIKROBUS(cfg, mikrobus)
 
#define FLASH3_RETVAL   uint8_t
 
#define FLASH3_OK   0x00
 
#define FLASH3_INIT_ERROR   0xFF
 
#define FLASH3_STATUS_WIP   0x01
 
#define FLASH3_STATUS_WEL   0x02
 
#define FLASH3_STATUS_BP_0   0x04
 
#define FLASH3_STATUS_BP_1   0x08
 
#define FLASH3_STATUS_BP_2   0x10
 
#define FLASH3_STATUS_BP_3   0x20
 
#define FLASH3_STATUS_QE   0x40
 
#define FLASH3_STATUS_SRWD   0x80
 
#define FLASH3_FUNC_TBS   0x02
 
#define FLASH3_FUNC_PSUS   0x04
 
#define FLASH3_FUNC_ESUS   0x08
 
#define FLASH3_FUNC_IRL_0   0x10
 
#define FLASH3_FUNC_IRL_1   0x20
 
#define FLASH3_FUNC_IRL_2   0x40
 
#define FLASH3_FUNC_IRL_3   0x80
 
#define FLASH3_NOP   0x00
 
#define FLASH3_WRSR   0x01
 
#define FLASH3_PP   0x02
 
#define FLASH3_WRDI   0x04
 
#define FLASH3_RDSR   0x05
 
#define FLASH3_WREN   0x06
 
#define FLASH3_RDFR   0x48
 
#define FLASH3_WRFR   0x42
 
#define FLASH3_PERSUS   0x75
 
#define FLASH3_PERRSM   0x7A
 
#define FLASH3_DP   0xB9
 
#define FLASH3_RDID   0xAB
 
#define FLASH3_SRP   0xC0
 
#define FLASH3_RDJDID   0x9F
 
#define FLASH3_RDMDID   0x90
 
#define FLASH3_RDJDIDQ   0xAF
 
#define FLASH3_RDUID   0x4B
 
#define FLASH3_RDSFDP   0x5A
 
#define FLASH3_RSTEN   0x66
 
#define FLASH3_RST   0x99
 
#define FLASH3_IRER   0x64
 
#define FLASH3_IRP   0x62
 
#define FLASH3_IRRD   0x68
 
#define FLASH3_SECUN_LOCK   0x26
 
#define FLASH3_SECLOCK   0x24
 
#define FLASH3_SECTOR_ER   0xD7
 
#define FLASH3_BLOCK_ER32   0x52
 
#define FLASH3_BLOCK_ER64   0xD8
 
#define FLASH3_CHIP_ER   0xC7
 
#define FLASH3_NORMAL_RD   0x03
 
#define FLASH3_FAST_RD   0x0B
 

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

This file contains API for Flash 3 Click driver.