flash9 2.0.0.0
flash9.h File Reference

This file contains API for Flash 9 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  flash9_t
 Flash 9 Click context object. More...
 
struct  flash9_cfg_t
 Flash 9 Click configuration object. More...
 

Macros

#define FLASH9_CMD_READ_STATUS_REGISTER_1   0x05
 Flash 9 Following Upper/Lower Die Instruction.
 
#define FLASH9_CMD_READ_STATUS_REGISTER_2   0x35
 
#define FLASH9_CMD_READ_STATUS_REGISTER_3   0x15
 
#define FLASH9_CMD_READ_SFDP_REGISTER   0x5A
 
#define FLASH9_CMD_ERASE_PROGRAM_SUSPEND   0x75
 
#define FLASH9_CMD_ERASE_PROGRAM_RESUME   0x7A
 
#define FLASH9_CMD_WRITE_ENABLE   0x06
 Flash 9 Con-Current Instruction.
 
#define FLASH9_CMD_VOLATILE_SR_WRITE_ENABLE   0x50
 
#define FLASH9_CMD_WRITE_DISABLE   0x04
 
#define FLASH9_CMD_READ_UNIQUE_ID   0x4B
 
#define FLASH9_CMD_RELEASE_POWER_DOWN_ID   0xAB
 
#define FLASH9_CMD_MANUFACTURER_DEVICE_ID   0x90
 
#define FLASH9_CMD_JEDEC_ID   0x9F
 
#define FLASH9_CMD_CHIP_ERASE   0xC7
 
#define FLASH9_CMD_WRITE_STATUS_REGISTER_1   0x01
 
#define FLASH9_CMD_WRITE_STATUS_REGISTER_2   0x31
 
#define FLASH9_CMD_WRITE_STATUS_REGISTER_3   0x11
 
#define FLASH9_CMD_GLOBAL_BLOCK_LOCK   0x7E
 
#define FLASH9_CMD_GLOBAL_BLOCK_UNLOCK   0x98
 
#define FLASH9_CMD_POWER_DOWN   0xB9
 
#define FLASH9_CMD_ENTER_4BYTE_ADDRESS_MODE   0xB7
 
#define FLASH9_CMD_EXIT_4BYTE_ADDRESS_MODE   0xE9
 
#define FLASH9_CMD_ENABLE_RESET   0x66
 
#define FLASH9_CMD_RESET_DEVICE   0x99
 
#define FLASH9_CMD_SOFTWARE_DIE_SELECT   0xC2
 
#define FLASH9_CMD_READ_DATA   0x03
 Flash 9 Linear Address Instruction.
 
#define FLASH9_CMD_READ_DATA_WITH_4BYTE_ADDRESS   0x13
 
#define FLASH9_CMD_FAST_READ   0x0B
 
#define FLASH9_CMD_FAST_READ_WITH_4BYTE_ADDRESS   0x0C
 
#define FLASH9_CMD_PAGE_PROGRAM   0x02
 
#define FLASH9_CMD_PAGE_PROGRAM_WITH_4BYTE_ADDRESS   0x12
 
#define FLASH9_CMD_SECTOR_ERASE   0x20
 
#define FLASH9_CMD_SECTOR_ERASE_WITH_4BYTE_ADDRESS   0x21
 
#define FLASH9_CMD_BLOCK_ERASE_32KB   0x52
 
#define FLASH9_CMD_BLOCK_ERASE_64KB   0xD8
 
#define FLASH9_CMD_BLOCK_ERASE_64KB_WITH_4BYTE_ADDRESS   0xDC
 
#define FLASH9_CMD_ERASE_SECURITY_REGISTER   0x44
 
#define FLASH9_CMD_PROGRAM_SECURITY_REGISTER   0x42
 
#define FLASH9_CMD_READ_SECURITY_REGISTER   0x48
 
#define FLASH9_CMD_READ_BLOCK_LOCK   0x3D
 
#define FLASH9_CMD_INDIVIDUAL_BLOCK_LOCK   0x36
 
#define FLASH9_CMD_INDIVIDUAL_BLOCK_UNLOCK   0x39
 
#define FLASH9_JEDEC_MANUFACTURER_ID   0xEF
 Flash 9 JEDEC ID values.
 
#define FLASH9_JEDEC_MEMORY_TYPE   0x70
 
#define FLASH9_JEDEC_CAPACITY   0x22
 
#define FLASH9_MIN_ADDRESS   0x00000000
 Flash 9 memory address range.
 
#define FLASH9_MAX_ADDRESS   0x0FFFFFFFul
 
#define FLASH9_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define FLASH9_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define FLASH9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  flash9_return_value_t { FLASH9_OK = 0 , FLASH9_ERROR = -1 }
 Flash 9 Click return value data. More...
 

Functions

void flash9_cfg_setup (flash9_cfg_t *cfg)
 Flash 9 configuration object setup function.
 
err_t flash9_init (flash9_t *ctx, flash9_cfg_t *cfg)
 Flash 9 initialization function.
 
err_t flash9_default_cfg (flash9_t *ctx)
 Flash 9 default configuration function.
 
err_t flash9_generic_write (flash9_t *ctx, uint8_t *data_in, uint16_t in_len)
 Flash 9 generic write function.
 
err_t flash9_generic_read (flash9_t *ctx, uint8_t *data_in, uint8_t in_len, uint8_t *data_out, uint16_t out_len)
 Flash 9 generic read function.
 
err_t flash9_write_register (flash9_t *ctx, uint8_t reg, uint8_t *data_in, uint16_t in_len)
 Flash 9 write register function.
 
err_t flash9_read_register (flash9_t *ctx, uint8_t reg, uint8_t *data_out, uint16_t out_len)
 Flash 9 read register function.
 
err_t flash9_write_command (flash9_t *ctx, uint8_t cmd)
 Flash 9 write command function.
 
void flash9_set_wp_pin (flash9_t *ctx, uint8_t state)
 Flash 9 set wp pin function.
 
void flash9_set_hld_pin (flash9_t *ctx, uint8_t state)
 Flash 9 set hld pin function.
 
void flash9_set_rst_pin (flash9_t *ctx, uint8_t state)
 Flash 9 set rst pin function.
 
err_t flash9_check_communication (flash9_t *ctx)
 Flash 9 check communication function.
 
err_t flash9_erase_memory (flash9_t *ctx, uint8_t erase_cmd, uint32_t address)
 Flash 9 erase memory function.
 
err_t flash9_read_status (flash9_t *ctx, uint8_t status_cmd, uint8_t *status)
 Flash 9 read status function.
 
err_t flash9_write_status (flash9_t *ctx, uint8_t status_cmd, uint8_t status)
 Flash 9 write status function.
 
err_t flash9_memory_write (flash9_t *ctx, uint32_t address, uint8_t *data_in, uint16_t len)
 Flash 9 memory write function.
 
err_t flash9_memory_read (flash9_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len)
 Flash 9 memory read function.
 
err_t flash9_memory_read_fast (flash9_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len)
 Flash 9 memory read fast function.
 

Detailed Description

This file contains API for Flash 9 Click Driver.

Enumeration Type Documentation

◆ flash9_return_value_t

Flash 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
FLASH9_OK 
FLASH9_ERROR