flash6 2.0.0.0
flash6.h File Reference

This file contains API for Flash 6 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  flash6_t
 Click ctx object definition. More...
 
struct  flash6_cfg_t
 Click configuration structure definition. More...
 

Macros

#define FLASH6_MAP_MIKROBUS(cfg, mikrobus)
 
#define FLASH6_RETVAL   uint8_t
 
#define FLASH6_OK   0x00
 
#define FLASH6_INIT_ERROR   0xFF
 
#define FLASH6_CMD_WRITE_ENABLE   0x06
 
#define FLASH6_CMD_VOL_SR_WRITE_ENABLE   0x50
 
#define FLASH6_CMD_WRITE_DISABLE   0x04
 
#define FLASH6_CMD_RELEASE_POWER_DOWN_ID   0xAB
 
#define FLASH6_CMD_MANUFACTURER_DEVICE_ID   0x90
 
#define FLASH6_CMD_JEDEC_ID   0x9F
 
#define FLASH6_CMD_UINQUE_ID   0x4B
 
#define FLASH6_CMD_READ_DATA   0x03
 
#define FLASH6_CMD_FAST_READ_DATA   0x0B
 
#define FLASH6_CMD_PAGE_PROGRAM   0x02
 
#define FLASH6_CMD_SECTOR_ERASE_4KB   0x20
 
#define FLASH6_CMD_BLOCK_ERASE_32KB   0x52
 
#define FLASH6_CMD_BLOCK_ERASE_64KB   0xD8
 
#define FLASH6_CMD_CHIP_ERASE   0xC7
 
#define FLASH6_CMD_READ_STATUS_1   0x05
 
#define FLASH6_CMD_WRITE_STATUS_1   0x01
 
#define FLASH6_CMD_READ_STATUS_2   0x35
 
#define FLASH6_CMD_WRITE_STATUS_2   0x31
 
#define FLASH6_CMD_READ_STATUS_3   0x15
 
#define FLASH6_CMD_WRITE_STATUS_3   0x11
 
#define FLASH6_CMD_READ_SFDP_REG   0x5A
 
#define FLASH6_CMD_ERASE_SECURITY_REG   0x44
 
#define FLASH6_CMD_PROGRAM_SECURITY_REG   0x42
 
#define FLASH6_CMD_READ_SECURITY_REG   0x48
 
#define FLASH6_CMD_GLOBAL_BLOCK_LOCK   0x7E
 
#define FLASH6_CMD_GLOBAL_BLOCK_UNLOCK   0x98
 
#define FLASH6_CMD_READ_BLOCK_LOCK   0x3D
 
#define FLASH6_CMD_INDIVIDUAL_BLOCK_LOCK   0x36
 
#define FLASH6_CMD_INDIVIDUAL_BLOCK_UNLOCK   0x39
 
#define FLASH6_CMD_ERASE_PROGRAM_SUSPEND   0x75
 
#define FLASH6_CMD_ERASE_PROGRAM_RESUME   0x7A
 
#define FLASH6_CMD_POWER_DOWN   0xB9
 
#define FLASH6_CMD_ENABLE_RESET   0x66
 
#define FLASH6_CMD_RESET_DEVICE   0x99
 
#define FLASH6_DEVICE_ID   0x17
 
#define FLASH6_MANIFACTURE_ID   0xEF
 
#define FLASH6_DEVICE_OK   0xFF
 
#define FLASH6_DEVICE_ERROR   0xAA
 

Functions

void flash6_cfg_setup (flash6_cfg_t *cfg)
 Config Object Initialization function.
 
FLASH6_RETVAL flash6_init (flash6_t *ctx, flash6_cfg_t *cfg)
 Initialization function.
 
void flash6_generic_transfer (flash6_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void flash6_read_data (flash6_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint16_t len)
 Generic funcion for reading.
 
void flash6_write_data (flash6_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint8_t len)
 Generic funcion for writing.
 
void flash6_send_cmd (flash6_t *ctx, uint8_t cmd_data)
 Function for sending one Byte od data.
 
uint8_t flash6_get_manufacture_device_id (flash6_t *ctx, uint8_t *manufacture_id, uint8_t *device_id)
 Funcion for checking manufacture and device id.
 
void flash6_erase_memory_segment (flash6_t *ctx, uint8_t segment, uint32_t start_addr)
 Function for eraseing segment.
 
uint8_t flash6_read_status_reg (flash6_t *ctx, uint8_t status_cmd)
 Function for reading status register.
 
void flash6_write_status_reg (flash6_t *ctx, uint8_t status_cmd, uint8_t status_data)
 Function for writing status register.
 
void flash6_write_memory_data (flash6_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Function used for writing in memory.
 
void flash6_read_memory_data (flash6_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Function used for reading from memory.
 
void flash6_software_reset (flash6_t *ctx)
 Function for reseting device.
 

Detailed Description

This file contains API for Flash 6 Click driver.