flash8 2.0.0.0
flash8.h File Reference

This file contains API for Flash 8 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  flash8_t
 Flash 8 Click context object. More...
 
struct  flash8_cfg_t
 Flash 8 Click configuration object. More...
 
struct  feature_cfg_t
 Flash 8 Feature operation object. More...
 

Macros

#define FLASH8_CMD_READ_CELL_ARRAY   0x13
 Flash 8 description command set.
 
#define FLASH8_CMD_READ_BUFFER   0x03
 
#define FLASH8_CMD_READ_BUFFER_1   0x0B
 
#define FLASH8_CMD_PROGRAM_LOAD   0x02
 
#define FLASH8_CMD_PROGRAM_EXECUTE   0x10
 
#define FLASH8_CMD_PROTECT_EXECUTE   0x2A
 
#define FLASH8_CMD_PROGRAM_LOAD_RANDOM_DATA   0x84
 
#define FLASH8_CMD_BLOCK_ERASE   0xD8
 
#define FLASH8_CMD_RESET   0xFF
 
#define FLASH8_CMD_RESET_1   0xFE
 
#define FLASH8_CMD_WRITE_ENABLE   0x06
 
#define FLASH8_CMD_WRITE_DISABLE   0x04
 
#define FLASH8_CMD_GET_FEATURE   0x0F
 
#define FLASH8_CMD_SET_FEATURE   0x1F
 
#define FLASH8_CMD_READ_ID   0x9F
 
#define FLASH8_FEATURE_A0   0xA0
 
#define FLASH8_FEATURE_B0   0xB0
 
#define FLASH8_FEATURE_C0   0xC0
 
#define FLASH8_FEATURE_10   0x10
 
#define FLASH8_FEATURE_20   0x20
 
#define FLASH8_FEATURE_30   0x30
 
#define FLASH8_FEATURE_40   0x40
 
#define FLASH8_FEATURE_50   0x50
 
#define FLASH8_FEATURE_60   0x60
 
#define FLASH8_FEATURE_70   0x70
 
#define FLASH8_SET_BRWD_ENABLE   0x00
 Flash 8 description feature table - 0xA0 setting.
 
#define FLASH8_SET_BRWD_DISABLE   0x01
 
#define FLASH8_SET_BL_ALL_UNLOCKED   0x00
 
#define FLASH8_SET_BL_UPPER_1_64_LOCKED   0x01
 
#define FLASH8_SET_BL_UPPER_1_32_LOCKED   0x02
 
#define FLASH8_SET_BL_UPPER_1_16_LOCKED   0x03
 
#define FLASH8_SET_BL_UPPER_1_8_LOCKED   0x04
 
#define FLASH8_SET_BL_UPPER_1_4_LOCKED   0x05
 
#define FLASH8_SET_BL_UPPER_1_2_LOCKED   0x06
 
#define FLASH8_SET_BL_ALLLOCKED   0x07
 
#define FLASH8_SET_IDR_E_NORMAL_OPERATION   0x00
 Flash 8 description feature table - 0xB0 setting.
 
#define FLASH8_SET_IDR_E_PARAMETER_PAGE_READ   0x01
 
#define FLASH8_SET_ECC_E_INTERNAL_ECC_DISABLE   0x00
 
#define FLASH8_SET_ECC_E_INTERNAL_ECC_ENABLE   0x01
 
#define FLASH8_SET_PRT_E_NORMAL_OPERATION   0x00
 
#define FLASH8_SET_PRT_EBLOCK_PROTECTION_ENABLE   0x01
 
#define FLASH8_SET_HSE_HIGH_SPEED_MODE_DISABLE   0x00
 
#define FLASH8_SET_HSE_HIGH_SPEED_MODE_ENABLE   0x01
 
#define FLASH8_SET_HOLD_D_HOLD_IS_ENABLED   0x00
 
#define FLASH8_SET_HOLD_D_HOLD_IS_DISABLED   0x01
 
#define FLASH8_SET_WEL_WRITE_DISABLE   0x00
 Flash 8 description feature table - 0xC0 setting.
 
#define FLASH8_SET_WEL_WRITE_ENABLE   0x01
 
#define FLASH8_GET_ECCS_NO_BIT_FLIPS_WERE_DETECT   0x00
 Flash 8 description feature table - 0xC0 setting.
 
#define FLASH8_GET_ECCS_BIT_FLIPS_DETECT_CORRECT   0x10
 
#define FLASH8_GET_ECCS_MULTI_BIT_FLIPS_NOT_CORRECT   0x20
 
#define FLASH8_GET_ECCS_BIT_FLIPS_DETECT_CORRECTED   0x30
 
#define FLASH8_GET_PRG_F_PROGRAM_PASS   0x00
 
#define FLASH8_GET_PRG_F_PROGRAM_FAIL   0x08
 
#define FLASH8_GET_PRG_F_PROGRAM_PASS   0x00
 
#define FLASH8_GET_ERS_F_ERASE_FAIL   0x04
 
#define FLASH8_GET_WEL_WRITE_DISABLE   0x00
 
#define FLASH8_GET_WEL_WRITE_ENABLE   0x02
 
#define FLASH8_GET_OIP_READY_STATE   0x00
 
#define FLASH8_GET_OIP_BUSY_STATE   0x01
 
#define FLASH8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  flash8_return_value_t { FLASH8_OK = 0 , FLASH8_ERROR = -1 }
 Flash 8 Click return value data. More...
 

Functions

void flash8_cfg_setup (flash8_cfg_t *cfg)
 Flash 8 configuration object setup function.
 
err_t flash8_init (flash8_t *ctx, flash8_cfg_t *cfg)
 Flash 8 initialization function.
 
void flash8_default_cfg (flash8_t *ctx)
 Flash 8 default configuration function.
 
err_t flash8_generic_write (flash8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Flash 8 data writing function.
 
err_t flash8_generic_read (flash8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Flash 8 data reading function.
 
void flash8_hold_enable (flash8_t *ctx)
 Flash 8 hold enable function.
 
void flash8_hold_disable (flash8_t *ctx)
 Flash 8 hold disable function.
 
void flash8_write_protect_enable (flash8_t *ctx)
 Flash 8 enable write protection function.
 
void flash8_write_protect_disable (flash8_t *ctx)
 Flash 8 disable write protection function.
 
err_t flash8_read_cell_array (flash8_t *ctx, uint32_t row_address, uint16_t column_address, uint8_t *feature_status_out)
 Flash 8 read cell array function.
 
err_t flash8_read_buffer (flash8_t *ctx, uint16_t column_address, uint8_t *read_data)
 Flash 8 read buffer function.
 
err_t flash8_program_load (flash8_t *ctx, uint16_t column_address, uint8_t *data_in, uint16_t len)
 Flash 8 program load function.
 
err_t flash8_program_execute (flash8_t *ctx, uint32_t row_address)
 Flash 8 program execute function.
 
err_t flash8_program_load_random (flash8_t *ctx, uint16_t column_address, uint8_t *data_in, uint8_t len)
 Flash 8 program load random function.
 
err_t flash8_block_erase (flash8_t *ctx, uint32_t row_address, uint8_t *feat_data)
 Flash 8 block erase function.
 
err_t flash8_sw_reset (flash8_t *ctx, uint8_t *feat_data)
 Flash 8 soft reset function.
 
err_t flash8_write_enable (flash8_t *ctx)
 Flash 8 write enable function.
 
err_t flash8_write_disable (flash8_t *ctx)
 Flash 8 write disable function.
 
err_t flash8_set_feature (flash8_t *ctx, uint8_t feature_addr, uint8_t feature_data)
 Flash 8 set feature function.
 
err_t flash8_set_config_feature (flash8_t *ctx, feature_cfg_t feature_data)
 Flash 8 set config feature function.
 
err_t flash8_get_feature (flash8_t *ctx, uint8_t feature_addr, uint8_t *feature_data)
 Flash 8 get feature function.
 
err_t flash8_get_config_feature (flash8_t *ctx, feature_cfg_t *feature_data)
 Flash 8 get config feature function.
 
err_t flash8_protected_area_all_unlocked (flash8_t *ctx)
 Flash 8 protected area all unlocked function.
 
err_t flash8_protect_execute (flash8_t *ctx, uint32_t row_address, uint8_t *feature_status_out)
 Flash 8 protect execute function.
 
err_t flash8_read_id (flash8_t *ctx, uint8_t *manufacture_id, uint8_t *device_id, uint8_t *organization_id)
 Flash 8 read ID function.
 
err_t flash8_write_memory (flash8_t *ctx, uint32_t row_address, uint16_t column_address, uint8_t *data_in, uint16_t len, uint8_t *feature_status_out)
 Flash 8 write memory function.
 
err_t flash8_read_memory (flash8_t *ctx, uint32_t row_address, uint16_t column_address, uint8_t *data_out, uint16_t len, uint8_t *feature_status_out)
 Flash 8 read memory function.
 

Detailed Description

This file contains API for Flash 8 Click Driver.

Enumeration Type Documentation

◆ flash8_return_value_t

Flash 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
FLASH8_OK 
FLASH8_ERROR