flash10 2.1.0.0
flash10.h File Reference

This file contains API for Flash 10 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  flash10_t
 Flash 10 Click context object. More...
 
struct  flash10_cfg_t
 Flash 10 Click configuration object. More...
 

Macros

#define FLASH10_CMD_READ_ARRAY   0x03
 Flash 10 read commands list.
 
#define FLASH10_CMD_FAST_READ_ARRAY   0x0B
 
#define FLASH10_CMD_BLOCK_ERASE_4KB   0x20
 Flash 10 program/erase commands list.
 
#define FLASH10_CMD_BLOCK_ERASE_32KB   0x52
 
#define FLASH10_CMD_BLOCK_ERASE_64KB   0xD8
 
#define FLASH10_CMD_CHIP_ERASE   0x60
 
#define FLASH10_CMD_BYTE_PAGE_PROGRAM   0x02
 
#define FLASH10_CMD_SEQUENTIAL_PROGRAM   0xAD
 
#define FLASH10_CMD_ERASE_PROGRAM_SUSPEND   0x75
 
#define FLASH10_CMD_ERASE_PROGRAM_RESUME   0x7A
 
#define FLASH10_CMD_WRITE_ENABLE   0x06
 Flash 10 protection commands list.
 
#define FLASH10_CMD_WRITE_DISABLE   0x04
 
#define FLASH10_CMD_VOLATILE_STATUS   0x50
 
#define FLASH10_CMD_INDIVIDUAL_BLOCK_LOCK   0x36
 
#define FLASH10_CMD_INDIVIDUAL_BLOCK_UNLOCK   0x39
 
#define FLASH10_CMD_READ_BLOCK_LOCK   0x3C
 
#define FLASH10_CMD_GLOBAL_BLOCK_LOCK   0x7E
 
#define FLASH10_CMD_GLOBAL_BLOCK_UNLOCK   0x98
 
#define FLASH10_CMD_PROGRAM_OTP_SECURITY   0x9B
 Flash 10 security register commands list.
 
#define FLASH10_CMD_READ_OTP_SECURITY   0x4B
 
#define FLASH10_CMD_READ_STATUS_1   0x05
 Flash 10 security register commands list.
 
#define FLASH10_CMD_READ_STATUS_2   0x35
 
#define FLASH10_CMD_READ_STATUS_3   0x15
 
#define FLASH10_CMD_READ_STATUS_4   0x65
 
#define FLASH10_CMD_READ_STATUS_5   0x65
 
#define FLASH10_CMD_WRITE_STATUS_1   0x01
 
#define FLASH10_CMD_WRITE_STATUS_2   0x31
 
#define FLASH10_CMD_WRITE_STATUS_3   0x11
 
#define FLASH10_CMD_WRITE_STATUS_4   0x71
 
#define FLASH10_CMD_WRITE_STATUS_5   0x71
 
#define FLASH10_CMD_READ_STATUS   0x65
 
#define FLASH10_CMD_WRITE_STATUS   0x71
 
#define FLASH10_CMD_STATUS_LOCK   0x6F
 
#define FLASH10_CMD_DEEP_POWER_DOWN   0xB9
 Flash 10 power down commands list.
 
#define FLASH10_CMD_ULTRA_DEEP_POWER_DOWN   0x79
 
#define FLASH10_CMD_RESUME_FROM_DPD   0xAB
 
#define FLASH10_CMD_ENABLE_RESET   0x66
 Flash 10 reset commands list.
 
#define FLASH10_CMD_RESET_DEVICE   0x99
 
#define FLASH10_CMD_TERMINATE   0xF0
 
#define FLASH10_CMD_MANUFACTURER_ID   0x90
 Flash 10 manufacturer/device commands list.
 
#define FLASH10_CMD_JEDEC_ID   0x9F
 
#define FLASH10_CMD_READ_SFDP   0x5A
 Flash 10 miscellaneous commands list.
 
#define FLASH10_STATUS_REG_1   1
 Flash 10 status register numbers.
 
#define FLASH10_STATUS_REG_2   2
 
#define FLASH10_STATUS_REG_3   3
 
#define FLASH10_STATUS_REG_4   4
 
#define FLASH10_STATUS_REG_5   5
 
#define FLASH10_STATUS1_SRP0   0x80
 Flash 10 status register 1 settings.
 
#define FLASH10_STATUS1_BPSIZE   0x40
 
#define FLASH10_STATUS1_TB   0x20
 
#define FLASH10_STATUS1_WEL   0x02
 
#define FLASH10_STATUS1_BSY   0x01
 
#define FLASH10_MIN_ADDRESS   0x000000
 Flash 10 memory address range.
 
#define FLASH10_MAX_ADDRESS   0x3FFFFFul
 
#define FLASH10_PAGE_SIZE   256
 
#define FLASH10_MANUFACTURER_ID   0x1F
 Flash 10 device ID.
 
#define FLASH10_DEVICE_ID   0x47
 
#define FLASH10_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define FLASH10_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define FLASH10_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  flash10_return_value_t { FLASH10_OK = 0 , FLASH10_ERROR = -1 }
 Flash 10 Click return value data. More...
 

Functions

void flash10_cfg_setup (flash10_cfg_t *cfg)
 Flash 10 configuration object setup function.
 
err_t flash10_init (flash10_t *ctx, flash10_cfg_t *cfg)
 Flash 10 initialization function.
 
err_t flash10_write_cmd (flash10_t *ctx, uint8_t cmd)
 Flash 10 write cmd function.
 
err_t flash10_write_cmd_data (flash10_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 Flash 10 write cmd data function.
 
err_t flash10_read_cmd_data (flash10_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Flash 10 read cmd data function.
 
err_t flash10_write_cmd_address_data (flash10_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 10 write cmd address data function.
 
err_t flash10_read_cmd_address_data (flash10_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 10 read cmd address data function.
 
err_t flash10_memory_write (flash10_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 10 memory write function.
 
err_t flash10_memory_read (flash10_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 10 memory read function.
 
err_t flash10_erase_memory (flash10_t *ctx, uint8_t erase_cmd, uint32_t address)
 Flash 10 erase memory function.
 
err_t flash10_check_communication (flash10_t *ctx)
 Flash 10 check communication function.
 
err_t flash10_write_protect (flash10_t *ctx)
 Flash 10 write protect function.
 
err_t flash10_write_enable (flash10_t *ctx)
 Flash 10 write enable function.
 
err_t flash10_soft_reset (flash10_t *ctx)
 Flash 10 soft reset function.
 
err_t flash10_write_status (flash10_t *ctx, uint8_t status_reg_num, uint8_t status)
 Flash 10 write status function.
 
err_t flash10_read_status (flash10_t *ctx, uint8_t status_reg_num, uint8_t *status)
 Flash 10 read status function.
 
void flash10_set_wp_pin (flash10_t *ctx, uint8_t state)
 Flash 10 set wp pin function.
 
void flash10_set_rst_pin (flash10_t *ctx, uint8_t state)
 Flash 10 set rst pin function.
 

Detailed Description

This file contains API for Flash 10 Click Driver.

Enumeration Type Documentation

◆ flash10_return_value_t

Flash 10 Click return value data.

Predefined enum values for driver return values.

Enumerator
FLASH10_OK 
FLASH10_ERROR