semperflash 2.0.0.0
semperflash.h File Reference

This file contains API for Semper Flash 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  semperflash_t
 Click ctx object definition. More...
 
struct  semperflash_cfg_t
 Click configuration structure definition. More...
 
struct  semperflash_config_t
 Flash configuration structure. More...
 

Macros

#define SEMPERFLASH_MAP_MIKROBUS(cfg, mikrobus)
 
#define SEMPERFLASH_RETVAL   uint8_t
 
#define SEMPERFLASH_OK   0x00
 
#define SEMPERFLASH_INIT_ERROR   0xFF
 
#define SEMPERFLASH_MANUFACTURER_DEVICE_ID   0x9F
 
#define SEMPERFLASH_JEDEC_SERIAL_FLASH_DISCOVER_PARAMS   0x5A
 
#define SEMPERFLASH_DEVICE_ID   0x4C
 
#define SEMPERFLASH_READ_STATUS_REG_1   0x05
 
#define SEMPERFLASH_READ_STATUS_REG_2   0x07
 
#define SEMPERFLASH_READ_CFG_REG_1   0x35
 
#define SEMPERFLASH_READ_ANY_REG   0x65
 
#define SEMPERFLASH_WRITE_ENABLE   0x06
 
#define SEMPERFLASH_WRITE_ENABLE_VOLATILE   0x50
 
#define SEMPERFLASH_WRITE_DISABLE   0x04
 
#define SEMPERFLASH_WRITE_REG   0x01
 
#define SEMPERFLASH_WRITE_ANY_REG   0x71
 
#define SEMPERFLASH_CLEAR_PROGRAM_ERASE_ERROR   0x30
 
#define SEMPERFLASH_ENTER_4_BYTE_ADDR_MODE   0xB7
 
#define SEMPERFLASH_EXIT_4_BYTE_ADDR_MODE   0xB8
 
#define SEMPERFLASH_READ_DATA_LEARN_PATT_REG   0x41
 
#define SEMPERFLASH_PROGRAM_DATA_LEARN_PATT   0x43
 
#define SEMPERFLASH_WRITE_DATA_LEARN_PATT   0x4A
 
#define SEMPERFLASH_AUTOBOOT_REG_WRITE   0x15
 
#define SEMPERFLASH_READ_ECC_STATUS   0x19
 
#define SEMPERFLASH_CLEAR_ECC_STATUS   0x1B
 
#define SEMPERFLASH_DATA_INT_CHECK   0x5B
 
#define SEMPERFLASH_READ_0   0x03
 
#define SEMPERFLASH_READ_1   0x13
 
#define SEMPERFLASH_FAST_READ_0   0x0B
 
#define SEMPERFLASH_FAST_READ_1   0x0C
 
#define SEMPERFLASH_PROGRAM_PAGE_0   0x02
 
#define SEMPERFLASH_PROGRAM_PAGE_1   0x12
 
#define SEMPERFLASH_ERASE_4K_0   0x20
 
#define SEMPERFLASH_ERASE_4K_1   0x21
 
#define SEMPERFLASH_ERASE_256K_1   0xD8
 
#define SEMPERFLASH_ERASE_256K_2   0xDC
 
#define SEMPERFLASH_ERASE_CHIP_1   0x60
 
#define SEMPERFLASH_ERASE_CHIP_2   0xC7
 
#define SEMPERFLASH_ERASE_STATUS   0xD0
 
#define SEMPERFLASH_ERASE_CNT   0x5D
 
#define SEMPERFLASH_SUSPEND_ERASE_PROG_DATA_CHECK   0x75
 
#define SEMPERFLASH_SUSPEND_ERASE_PROG   0x85
 
#define SEMPERFLASH_RESUME_ERASE_PROG_DATA_CHECK   0x7A
 
#define SEMPERFLASH_RESUME_ERASE_PROG   0x8A
 
#define SEMPERFLASH_PROG_SECURE_SILICON_REGION   0x42
 
#define SEMPERFLASH_READ_SECURE_SILICON_REGION   0x4B
 
#define SEMPERFLASH_ASP_PROG   0x2F
 
#define SEMPERFLASH_READ_DYNAMIC_PROTECION_BIT   0xFA
 
#define SEMPERFLASH_WRITE_DYNAMIC_PROTECION_BIT   0xFB
 
#define SEMPERFLASH_READ_PRESISTENT_PROTECTION_BIT   0xFC
 
#define SEMPERFLASH_PROG_PRESISTENT_PROTECTION_BIT   0xFD
 
#define SEMPERFLASH_ERASE_PRESISTENT_PROTECTION_BIT   0xE4
 
#define SEMPERFLASH_WRITE_PPB_PROTECTION_LOCK_BIT   0xA6
 
#define SEMPERFLASH_READ_PROG_PRESISTENT_PROTECION_LOCK_BIT   0xA7
 
#define SEMPERFLASH_PROG_PASSWORD   0xE8
 
#define SEMPERFLASH_PASSWORD_UNLOCK   0xE9
 
#define SEMPERFLASH_SOFT_RESET_ENABLE   0x66
 
#define SEMPERFLASH_SOFT_RESET   0x99
 
#define SEMPERFLASH_LEGACY_SOFT_RESET   0xF0
 
#define SEMPERFLASH_ENTER_DEEP_POWER_DOWN_MODE   0xB9
 
#define SEMPERFLASH_PIN_STATE_HIGH   1
 
#define SEMPERFLASH_PIN_STATE_LOW   0
 
#define SEMPERFLASH_ID_ERROR   0xCC
 
#define SEMPERFLASH_SIZE_ERROR   0xBB
 
#define SEMPERFLASH_SUCCESS   0xAA
 
#define SEMPERFLASH_MANUFACTURER_DEVICE_ID_VALUE   0x34
 
#define SEMPERFLASH_DEVICE_ID_BYTE_SIZE   8
 
#define SEMPERFLASH_STATUS_REG_1_DEFAULT   0x00
 
#define SEMPERFLASH_STATUS_REG_1_PROGRAM_ERASE_REG_WRITE_ENABLE   0x02
 
#define SEMPERFLASH_STATUS_REG_1_DEVICE_BUSY   0x01
 
#define SEMPERFLASH_CFG_1_DEFAULT   0x00
 
#define SEMPERFLASH_CFG_2_DEFAULT   0x00
 
#define SEMPERFLASH_CFG_3_DEFAULT   0x00
 
#define SEMPERFLASH_CFG_4_DEFAULT   0x00
 
#define SEMPERFLASH_MANUFACTURER_DEVICE_ID_VALUE   0x34
 
#define SEMPERFLASH_MEMORY_BUF_MAX_SIZE   512
 

Functions

void semperflash_cfg_setup (semperflash_cfg_t *cfg)
 Config Object Initialization function.
 
SEMPERFLASH_RETVAL semperflash_init (semperflash_t *ctx, semperflash_cfg_t *cfg)
 Initialization function.
 
void semperflash_default_cfg (semperflash_t *ctx)
 Click Default Configuration function.
 
void semperflash_send_cmd (semperflash_t *ctx, uint8_t cmd)
 Send command function.
 
void semperflash_transfer_data (semperflash_t *ctx, uint8_t *write_buf, uint16_t wbuf_size, uint8_t *read_buf, uint16_t rbuf_size)
 Transfer data function.
 
void semperflash_generic_write (semperflash_t *ctx, uint8_t *write_buf, uint16_t buf_size)
 Writing data function.
 
void semperflash_write_config (semperflash_t *ctx, semperflash_config_t *cfg_data)
 Write configuration function.
 
uint8_t semperflash_read_memory (semperflash_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Read memory function.
 
uint8_t semperflash_write_memory (semperflash_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_size)
 Write memory function.
 
void semperflash_erase_memory (semperflash_t *ctx, uint32_t addr)
 Erase memory function.
 
uint8_t semperflash_get_device_id (semperflash_t *ctx, uint8_t *id_buf)
 Get device ID function.
 
uint8_t semperflash_check_manufacturer_id (semperflash_t *ctx)
 Check manufacturer ID function.
 
uint8_t semperflash_check_status_reg_1 (semperflash_t *ctx)
 Check status register function.
 

Detailed Description

This file contains API for Semper Flash Click driver.