eeprom4 2.0.0.0
|
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. | |
void eeprom4_cfg_setup | ( | eeprom4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t eeprom4_check_status_reg | ( | eeprom4_t * | ctx, |
uint8_t | check_bit ) |
Status register bits check function.
ctx | Click object. |
check_bit | Determined witch bit in status register be checked |
@description Function checks value of status register bit determined by check_bit parametar.
void eeprom4_default_cfg | ( | eeprom4_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for EEPROM 4 click.
void eeprom4_enable_hold_operation | ( | eeprom4_t * | ctx, |
uint8_t | state ) |
Hold operation enable function.
ctx | Click object. |
state | Value 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.
void eeprom4_enable_write_protect | ( | eeprom4_t * | ctx, |
uint8_t | state ) |
Write Protect enable function.
ctx | Click object. |
state | Value 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.
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.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
EEPROM4_RETVAL eeprom4_init | ( | eeprom4_t * | ctx, |
eeprom4_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void eeprom4_read_memory | ( | eeprom4_t * | ctx, |
uint32_t | memory_address, | ||
uint8_t * | data_output, | ||
uint8_t | n_bytes ) |
Memory array read function.
ctx | Click object. |
memory_address | Address where from data will be read |
data_output | Pointer to buffer where data be storaged |
nBytes | Number 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.
uint8_t eeprom4_read_status_reg | ( | eeprom4_t * | ctx | ) |
Status register read function.
ctx | Click object. |
@description Function reads one byte data value from status register.
uint8_t eeprom4_send_command | ( | eeprom4_t * | ctx, |
uint8_t | command_byte ) |
Command send function.
command_byte | Click instruction |
ctx | Click 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.
void eeprom4_write_memory | ( | eeprom4_t * | ctx, |
uint32_t | memory_address, | ||
uint8_t * | data_input, | ||
uint8_t | n_bytes ) |
Memory array write function.
ctx | Click object. |
memory_address | Address where data be written |
data_input | Pointer to buffer witch from data be written |
nBytes | Number 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.
void eeprom4_write_status_reg | ( | eeprom4_t * | ctx, |
uint8_t | data_value ) |
Status register write function.
data_value | Data to be written in status register |
ctx | Click object. |
@description Function writes data determined in parametar of function to status register.