eeprom9 2.1.0.0
eeprom9.h File Reference

This file contains API for EEPROM 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  eeprom9_t
 EEPROM 9 Click context object. More...
 
struct  eeprom9_cfg_t
 EEPROM 9 Click configuration object. More...
 
struct  id_data_t
 EEPROM 9 Click identification data. More...
 

Macros

#define EEPROM9_HOLD_DISABLE   0x00
 EEPROM 9 description setting.
 
#define EEPROM9_HOLD_ENABLE   0x01
 
#define EEPROM9_WRITE_PROTECT_DISABLE   0x00
 
#define EEPROM9_WRITE_PROTECT_ENABLE   0x01
 
#define EEPROM9_WRITE_ENABLE   0x00
 
#define EEPROM9_WRITE_DISABLE   0x01
 
#define EEPROM9_SRWD_MASK   0x80
 EEPROM 9 Status register setting.
 
#define EEPROM9_TB_MASK   0x40
 
#define EEPROM9_BP2_MASK   0x10
 
#define EEPROM9_BP1_MASK   0x08
 
#define EEPROM9_BP0_MASK   0x04
 
#define EEPROM9_WEL_MASK   0x02
 
#define EEPROM9_WIP_MASK   0x01
 
#define EEPROM9_ST_MANUFACTURER_CODE   0x20
 EEPROM 9 Manufacturer code.
 
#define EEPROM9_MEMORY_ADDR_START   0x00000000ul
 EEPROM 9 Memory address.
 
#define EEPROM9_MEMORY_ADDR_END   0x003FFFFFul
 
#define EEPROM9_CMD_WREN   0x06
 EEPROM 9 Commands.
 
#define EEPROM9_CMD_WRDI   0x04
 
#define EEPROM9_CMD_RDSR   0x05
 
#define EEPROM9_CMD_WRSR   0x01
 
#define EEPROM9_CMD_READ   0x03
 
#define EEPROM9_CMD_FREAD   0x0B
 
#define EEPROM9_CMD_FDREAD   0x3B
 
#define EEPROM9_CMD_FQREAD   0x6B
 
#define EEPROM9_CMD_PGWR   0x02
 
#define EEPROM9_CMD_PGPR   0x0A
 
#define EEPROM9_CMD_PGER   0xDB
 
#define EEPROM9_CMD_SCER   0x20
 
#define EEPROM9_CMD_BKER   0xD8
 
#define EEPROM9_CMD_CHER   0xC7
 
#define EEPROM9_CMD_RDID   0x83
 
#define EEPROM9_CMD_FRDID   0x8B
 
#define EEPROM9_CMD_WRID   0x82
 
#define EEPROM9_CMD_DPD   0xB9
 
#define EEPROM9_CMD_RDPD   0xAB
 
#define EEPROM9_CMD_JEDPC   0x9F
 
#define EEPROM9_CMD_RDCR   0x15
 
#define EEPROM9_CMD_RDVR   0x85
 
#define EEPROM9_CMD_WRVR   0x81
 
#define EEPROM9_CMD_CLRSF   0x50
 
#define EEPROM9_CMD_RDSFDP   0x5A
 
#define EEPROM9_CMD_RSTEN   0x66
 
#define EEPROM9_CMD_RESET   0x99
 
#define EEPROM9_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define EEPROM9_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define EEPROM9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  eeprom9_return_value_t { EEPROM9_OK = 0 , EEPROM9_ERROR = -1 }
 EEPROM 9 Click return value data. More...
 

Functions

void eeprom9_cfg_setup (eeprom9_cfg_t *cfg)
 EEPROM 9 configuration object setup function.
 
err_t eeprom9_init (eeprom9_t *ctx, eeprom9_cfg_t *cfg)
 EEPROM 9 initialization function.
 
err_t eeprom9_generic_write (eeprom9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 EEPROM 9 data writing function.
 
err_t eeprom9_generic_read (eeprom9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 EEPROM 9 data reading function.
 
void eeprom9_set_hold (eeprom9_t *ctx, uint8_t en_hold)
 EEPROM 9 set hold pin state function.
 
void eeprom9_set_write_protection (eeprom9_t *ctx, uint8_t en_wp)
 EEPROM 9 set write protection state function.
 
err_t eeprom9_send_cmd (eeprom9_t *ctx, uint8_t cmd)
 EEPROM 9 send command function.
 
err_t eeprom9_set_write_enable (eeprom9_t *ctx, uint8_t en_write)
 EEPROM 9 enable write function.
 
err_t eeprom9_read_memory (eeprom9_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t len)
 EEPROM 9 memory reading function.
 
err_t eeprom9_write_memory (eeprom9_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t len)
 EEPROM 9 memory writing function.
 
err_t eeprom5_get_status_reg (eeprom9_t *ctx, uint8_t *status_data)
 EEPROM 9 read status function.
 
err_t eeprom9_chip_erase (eeprom9_t *ctx)
 EEPROM 9 chip memory erase function.
 
err_t eeprom9_block_erase (eeprom9_t *ctx, uint32_t block_addr)
 EEPROM 9 memory block erase function.
 
err_t eeprom9_sector_erase (eeprom9_t *ctx, uint32_t sector_addr)
 EEPROM 9 memory sector erase function.
 
err_t eeprom9_page_erase (eeprom9_t *ctx, uint32_t page_addr)
 EEPROM 9 memory page erase function.
 
err_t eeprom9_read_identification (eeprom9_t *ctx, id_data_t *id_data)
 EEPROM 9 read identification function.
 

Detailed Description

This file contains API for EEPROM 9 Click Driver.

Enumeration Type Documentation

◆ eeprom9_return_value_t

EEPROM 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
EEPROM9_OK 
EEPROM9_ERROR