eeprom4 2.0.0.0
Public function

Functions

void eeprom4_cfg_setup (eeprom4_cfg_t *cfg)
 Config Object Initialization function.
 
EEPROM4_RETVAL eeprom4_init (eeprom4_t *ctx, eeprom4_cfg_t *cfg)
 Initialization function.
 
void eeprom4_default_cfg (eeprom4_t *ctx)
 Click Default Configuration function.
 
void eeprom4_generic_transfer (eeprom4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint8_t eeprom4_send_command (eeprom4_t *ctx, uint8_t command_byte)
 Command send function.
 
void eeprom4_write_status_reg (eeprom4_t *ctx, uint8_t data_value)
 Status register write function.
 
uint8_t eeprom4_read_status_reg (eeprom4_t *ctx)
 Status register read function.
 
void eeprom4_write_memory (eeprom4_t *ctx, uint32_t memory_address, uint8_t *data_input, uint8_t n_bytes)
 Memory array write function.
 
void eeprom4_read_memory (eeprom4_t *ctx, uint32_t memory_address, uint8_t *data_output, uint8_t n_bytes)
 Memory array read function.
 
void eeprom4_enable_write_protect (eeprom4_t *ctx, uint8_t state)
 Write Protect enable function.
 
void eeprom4_enable_hold_operation (eeprom4_t *ctx, uint8_t state)
 Hold operation enable function.
 
uint8_t eeprom4_check_status_reg (eeprom4_t *ctx, uint8_t check_bit)
 Status register bits check function.
 

Detailed Description

Function Documentation

◆ eeprom4_cfg_setup()

void eeprom4_cfg_setup ( eeprom4_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ eeprom4_check_status_reg()

uint8_t eeprom4_check_status_reg ( eeprom4_t * ctx,
uint8_t check_bit )

Status register bits check function.

Parameters
ctxClick object.
check_bitDetermined witch bit in status register be checked

@description Function checks value of status register bit determined by check_bit parametar.

◆ eeprom4_default_cfg()

void eeprom4_default_cfg ( eeprom4_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for EEPROM 4 click.

◆ eeprom4_enable_hold_operation()

void eeprom4_enable_hold_operation ( eeprom4_t * ctx,
uint8_t state )

Hold operation enable function.

Parameters
ctxClick object.
stateValue witch set or reset PWM (HLD) pin

@description Function enables or disables the Hold operation. To pause the serial communication with the master device without resetting the serial sequence, the HOLD pin must be brought low. To resume serial communication, HOLD pin must be brought high.

◆ eeprom4_enable_write_protect()

void eeprom4_enable_write_protect ( eeprom4_t * ctx,
uint8_t state )

Write Protect enable function.

Parameters
ctxClick object.
stateValue witch set or reset RST (WP) pin

@description Function sets RST pin on state value to enable or disable writting to status register and memory array. WP pin is used in conjuction with the block protection bits of the status register and with WPEN and WEL bits also.

◆ eeprom4_generic_transfer()

void eeprom4_generic_transfer ( eeprom4_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ eeprom4_init()

EEPROM4_RETVAL eeprom4_init ( eeprom4_t * ctx,
eeprom4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ eeprom4_read_memory()

void eeprom4_read_memory ( eeprom4_t * ctx,
uint32_t memory_address,
uint8_t * data_output,
uint8_t n_bytes )

Memory array read function.

Parameters
ctxClick object.
memory_addressAddress where from data will be read
data_outputPointer to buffer where data be storaged
nBytesNumber of bytes witch will be read

@description Function reads number of bytes determined by nBytes parametar from memory location determined by memory_address parametar and stores bytes to buffer determined by data_output pointer.

◆ eeprom4_read_status_reg()

uint8_t eeprom4_read_status_reg ( eeprom4_t * ctx)

Status register read function.

Parameters
ctxClick object.

@description Function reads one byte data value from status register.

◆ eeprom4_send_command()

uint8_t eeprom4_send_command ( eeprom4_t * ctx,
uint8_t command_byte )

Command send function.

Parameters
command_byteClick instruction
ctxClick object.

@description Function sends command (instruction) to click. In case that command byte is EEPROM4_LOW_POWER_WRITE_POLL_COMMAND (0x08) function returns 0x00 if part is not in a write cycle and returns 0xFF is part still busy completing the write cycle. In other case function returns 0.

◆ eeprom4_write_memory()

void eeprom4_write_memory ( eeprom4_t * ctx,
uint32_t memory_address,
uint8_t * data_input,
uint8_t n_bytes )

Memory array write function.

Parameters
ctxClick object.
memory_addressAddress where data be written
data_inputPointer to buffer witch from data be written
nBytesNumber of bytes witch will be written

@descripption Function writes number of bytes determined by nBytes parametar from buffer determined by data_input pointer to memory location determined by memory_address parametar.

◆ eeprom4_write_status_reg()

void eeprom4_write_status_reg ( eeprom4_t * ctx,
uint8_t data_value )

Status register write function.

Parameters
data_valueData to be written in status register
ctxClick object.

@description Function writes data determined in parametar of function to status register.