flash13 2.2.0
Loading...
Searching...
No Matches
flash13.h File Reference

This file contains API for Flash 13 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  flash13_t
 Flash 13 Click context object. More...
struct  flash13_cfg_t
 Flash 13 Click configuration object. More...

Macros

#define FLASH13_CMD_WRITE_ENABLE   0x06
 Flash 13 Instruction Set Table 1 commands.
#define FLASH13_CMD_VOLATILE_SR_WRITE_ENABLE   0x50
#define FLASH13_CMD_WRITE_DISABLE   0x04
#define FLASH13_CMD_READ_STATUS_REG_1   0x05
#define FLASH13_CMD_WRITE_STATUS_REG_1   0x01
#define FLASH13_CMD_READ_STATUS_REG_2   0x35
#define FLASH13_CMD_WRITE_STATUS_REG_2   0x31
#define FLASH13_CMD_READ_STATUS_REG_3   0x15
#define FLASH13_CMD_WRITE_STATUS_REG_3   0x11
#define FLASH13_CMD_CHIP_ERASE   0x60
#define FLASH13_CMD_ERASE_PROGRAM_SUSPEND   0x75
#define FLASH13_CMD_ERASE_PROGRAM_RESUME   0x7A
#define FLASH13_CMD_POWER_DOWN   0xB9
#define FLASH13_CMD_RELEASE_POWER_DOWN   0xAB
#define FLASH13_CMD_MANUFACTURER_DEVICE_ID   0x90
#define FLASH13_CMD_JEDEC_ID   0x9F
#define FLASH13_CMD_ENABLE_RESET   0x66
#define FLASH13_CMD_RESET_DEVICE   0x99
#define FLASH13_CMD_READ_SERIAL_FLASH_DISC_PAR   0x5A
#define FLASH13_CMD_READ_UNIQUE_ID   0x4B
#define FLASH13_CMD_PAGE_PROGRAM   0x02
 Flash 13 Instruction Set Table 2 commands.
#define FLASH13_CMD_SECTOR_ERASE_4KB   0x20
#define FLASH13_CMD_BLOCK_ERASE_32KB   0x52
#define FLASH13_CMD_BLOCK_ERASE_64KB   0xD8
#define FLASH13_CMD_READ_DATA   0x03
#define FLASH13_CMD_FAST_READ   0x0B
#define FLASH13_CMD_ERASE_SECURITY_REG   0x44
#define FLASH13_CMD_PROGRAM_SECURITY_REG   0x42
#define FLASH13_CMD_READ_SECURITY_REG   0x48
#define FLASH13_CMD_SET_BURST_WITH_WRAP   0x77
#define FLASH13_STATUS3_HOLD_RST   0x80
 Flash 13 status register settings.
#define FLASH13_STATUS3_DRV1   0x40
#define FLASH13_STATUS3_DRV0   0x20
#define FLASH13_STATUS3_DC   0x10
#define FLASH13_STATUS2_SUS1   0x80
#define FLASH13_STATUS2_CMP   0x40
#define FLASH13_STATUS2_LB3   0x20
#define FLASH13_STATUS2_LB2   0x10
#define FLASH13_STATUS2_LB1   0x08
#define FLASH13_STATUS2_SUS2   0x04
#define FLASH13_STATUS2_QE   0x02
#define FLASH13_STATUS2_SRP1   0x01
#define FLASH13_STATUS1_SRP0   0x80
#define FLASH13_STATUS1_BP4   0x40
#define FLASH13_STATUS1_BP3   0x20
#define FLASH13_STATUS1_BP2   0x10
#define FLASH13_STATUS1_BP1   0x08
#define FLASH13_STATUS1_BP0   0x04
#define FLASH13_STATUS1_WEL   0x02
#define FLASH13_STATUS1_WIP   0x01
#define FLASH13_MIN_ADDRESS   0x000000ul
 Flash 13 memory address range.
#define FLASH13_MAX_ADDRESS   0x1FFFFFul
#define FLASH13_PAGE_SIZE   256
#define FLASH13_MANUFACTURER_ID   0x68
 Flash 13 device ID.
#define FLASH13_DEVICE_ID   0x14
#define FLASH13_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
#define FLASH13_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
#define FLASH13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  flash13_return_value_t { FLASH13_OK = 0 , FLASH13_ERROR = -1 }
 Flash 13 Click return value data. More...

Functions

void flash13_cfg_setup (flash13_cfg_t *cfg)
 Flash 13 configuration object setup function.
err_t flash13_init (flash13_t *ctx, flash13_cfg_t *cfg)
 Flash 13 initialization function.
err_t flash13_write_cmd (flash13_t *ctx, uint8_t cmd)
 Flash 13 write cmd function.
err_t flash13_write_cmd_data (flash13_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 Flash 13 write cmd data function.
err_t flash13_read_cmd_data (flash13_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Flash 13 read cmd data function.
err_t flash13_write_cmd_address_data (flash13_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 13 write cmd address data function.
err_t flash13_read_cmd_address_data (flash13_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 13 read cmd address data function.
err_t flash13_memory_write (flash13_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len)
 Flash 13 memory write function.
err_t flash13_memory_read (flash13_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 Flash 13 memory read function.
err_t flash13_erase_memory (flash13_t *ctx, uint8_t erase_cmd, uint32_t address)
 Flash 13 erase memory function.
err_t flash13_check_communication (flash13_t *ctx)
 Flash 13 check communication function.
err_t flash13_write_protect (flash13_t *ctx)
 Flash 13 write protect function.
err_t flash13_write_enable (flash13_t *ctx)
 Flash 13 write enable function.
err_t flash13_soft_reset (flash13_t *ctx)
 Flash 13 soft reset function.
void flash13_set_wp_pin (flash13_t *ctx, uint8_t state)
 Flash 13 set wp pin function.
void flash13_set_hold_pin (flash13_t *ctx, uint8_t state)
 Flash 13 set hold pin function.

Detailed Description

This file contains API for Flash 13 Click Driver.

Enumeration Type Documentation

◆ flash13_return_value_t

Flash 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
FLASH13_OK 
FLASH13_ERROR