flash12 2.1.0.0
flash12.h File Reference

This file contains API for Flash 12 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  flash12_t
 Flash 12 Click context object. More...
 
struct  flash12_cfg_t
 Flash 12 Click configuration object. More...
 

Macros

#define FLASH12_CMD_READ_ARRAY   0x03
 Flash 12 read command list.
 
#define FLASH12_CMD_FAST_READ_ARRAY   0x0B
 
#define FLASH12_CMD_BYTE_PAGE_PROGRAM   0x02
 Flash 12 program/erase and suspend command list.
 
#define FLASH12_CMD_PAGE_ERASE   0x81
 
#define FLASH12_CMD_BLOCK_ERASE_4KB   0x20
 
#define FLASH12_CMD_BLOCK_ERASE_32KB   0x52
 
#define FLASH12_CMD_BLOCK_ERASE_64KB   0xD8
 
#define FLASH12_CMD_CHIP_ERASE   0x60
 
#define FLASH12_CMD_ERASE_SECURITY_REG   0x44
 Flash 12 security command list.
 
#define FLASH12_CMD_PROGRAM_SECURITY_REG   0x42
 
#define FLASH12_CMD_READ_SECURITY_REG   0x48
 
#define FLASH12_CMD_READ_SERIAL_FLASH   0x5A
 
#define FLASH12_CMD_WRITE_ENABLE   0x06
 Flash 12 configuration command list.
 
#define FLASH12_CMD_VOLATILE_STATUS   0x50
 
#define FLASH12_CMD_WRITE_DISABLE   0x04
 
#define FLASH12_CMD_READ_STATUS_1   0x05
 Flash 12 status register command list.
 
#define FLASH12_CMD_WRITE_STATUS_1   0x01
 
#define FLASH12_CMD_READ_STATUS_2   0x35
 
#define FLASH12_CMD_ACT_STATUS_INT   0x25
 
#define FLASH12_CMD_DEEP_POWER_DOWN   0xB9
 Flash 12 ID and power command list.
 
#define FLASH12_CMD_RELEASE_PD_ID   0xAB
 
#define FLASH12_CMD_MANUFACTURER_ID   0x90
 
#define FLASH12_CMD_JEDEC_ID   0x9F
 
#define FLASH12_CMD_READ_UNIQUE_ID_NUM   0x4B
 
#define FLASH12_CMD_ENABLE_RESET   0x66
 Flash 12 other command list.
 
#define FLASH12_CMD_RESET_DEVICE   0x99
 
#define FLASH12_MANUFACTURER_ID   0x1F
 Flash 12 description setting.
 
#define FLASH12_DEVICE_ID   0x14
 
#define FLASH12_STATUS1_SRP0   0x80
 Flash 12 status register 1 settings.
 
#define FLASH12_STATUS1_BPSIZE   0x40
 
#define FLASH12_STATUS1_TB   0x20
 
#define FLASH12_STATUS1_WEL   0x02
 
#define FLASH12_STATUS1_BSY   0x01
 
#define FLASH12_MIN_ADDRESS   0x000000ul
 Flash 12 memory address range.
 
#define FLASH12_MAX_ADDRESS   0x07FFFFul
 
#define FLASH12_PAGE_SIZE   256
 
#define FLASH12_CMD_MAX_LEN   8
 
#define FLASH12_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define FLASH12_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define FLASH12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  flash12_return_value_t { FLASH12_OK = 0 , FLASH12_ERROR = -1 }
 Flash 12 Click return value data. More...
 

Functions

void flash12_cfg_setup (flash12_cfg_t *cfg)
 Flash 12 configuration object setup function.
 
err_t flash12_init (flash12_t *ctx, flash12_cfg_t *cfg)
 Flash 12 initialization function.
 
err_t flash12_default_cfg (flash12_t *ctx)
 Flash 12 default configuration function.
 
void flash12_hw_write_enable (flash12_t *ctx)
 Flash 12 hardware write enable function.
 
void flash12_hw_write_disable (flash12_t *ctx)
 Flash 12 hardware write disable function.
 
void flash12_hold_disable (flash12_t *ctx)
 Flash 12 hold disable function.
 
void flash12_hold_enable (flash12_t *ctx)
 Flash 12 hold enable function.
 
err_t flash12_write_cmd (flash12_t *ctx, uint8_t cmd)
 Flash 12 command writing function.
 
err_t flash12_write_cmd_data (flash12_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 Flash 12 command data writing function.
 
err_t flash12_read_cmd_data (flash12_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Flash 12 command data reading function.
 
err_t flash12_write_cmd_address_data (flash12_t *ctx, uint8_t cmd, uint32_t mem_addr, uint8_t *data_in, uint32_t len)
 Flash 12 command address data writing function.
 
err_t flash12_read_cmd_address_data (flash12_t *ctx, uint8_t cmd, uint32_t mem_addr, uint8_t *data_out, uint32_t len)
 Flash 12 command address data reading function.
 
err_t flash12_memory_write (flash12_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint32_t len)
 Flash 12 memory data writing function.
 
err_t flash12_memory_read (flash12_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint32_t len)
 Flash 12 memory data reading function.
 
err_t flash12_soft_reset (flash12_t *ctx)
 Flash 12 soft reset function.
 
err_t flash12_write_disable (flash12_t *ctx)
 Flash 12 write disable function.
 
err_t flash12_write_enable (flash12_t *ctx)
 Flash 12 write enable function.
 
err_t flash12_read_status (flash12_t *ctx, uint8_t reg_num, uint8_t *status)
 Flash 12 status reading function.
 
err_t flash12_write_status (flash12_t *ctx, uint8_t status)
 Flash 12 status writing function.
 
err_t flash12_erase_memory (flash12_t *ctx, uint8_t erase_cmd, uint32_t mem_addr)
 Flash 12 erase memory function.
 
err_t flash12_get_device_id (flash12_t *ctx, uint8_t *mfr_id, uint8_t *dev_id)
 Flash 12 device ID reading function.
 

Detailed Description

This file contains API for Flash 12 Click Driver.

Enumeration Type Documentation

◆ flash12_return_value_t

Flash 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
FLASH12_OK 
FLASH12_ERROR