eeprom5 2.0.0.0
|
API for configuring and manipulating EEPROM 5 Click driver. More...
Topics | |
EEPROM 5 Registers Settings | |
Settings for registers of EEPROM 5 Click driver. | |
EEPROM 5 MikroBUS Map | |
MikroBUS pin mapping of EEPROM 5 Click driver. | |
Functions | |
void | eeprom5_cfg_setup (eeprom5_cfg_t *cfg) |
EEPROM 5 configuration object setup function. | |
err_t | eeprom5_init (eeprom5_t *ctx, eeprom5_cfg_t *cfg) |
EEPROM 5 initialization function. | |
void | eeprom5_generic_write (eeprom5_t *ctx, uint32_t addr, uint8_t tx_data) |
EEPROM 5 data writing function. | |
uint8_t | eeprom5_generic_read (eeprom5_t *ctx, uint32_t addr) |
EEPROM 5 data reading function. | |
void | eeprom5_set_hold (eeprom5_t *ctx, uint8_t en_hold) |
Enable hold operation function. | |
void | eeprom5_set_write_protect (eeprom5_t *ctx, uint8_t en_wr_prot) |
Enable write protect function. | |
void | eeprom5_send_cmd (eeprom5_t *ctx, uint8_t cmd) |
Send command function. | |
void | eeprom5_enable_memory_write (eeprom5_t *ctx, uint8_t en_wr_mem) |
Enable memory write function. | |
void | eeprom5_get_status (eeprom5_t *ctx, status_data_t *stat_data) |
Get status function. | |
void | eeprom5_set_status (eeprom5_t *ctx, status_data_t stat_data) |
Set status function. | |
void | eeprom5_read_memory (eeprom5_t *ctx, uint32_t addr, uint8_t *p_rx_data, uint8_t n_bytes) |
Read EEPROM memory function. | |
void | eeprom5_write_memory (eeprom5_t *ctx, uint32_t addr, uint8_t *p_tx_data, uint8_t n_bytes) |
Write EEPROM memory function. | |
uint8_t | eeprom5_read_ident_page (eeprom5_t *ctx, uint16_t addr) |
Read identification page function. | |
void | eeprom5_write_ident_page (eeprom5_t *ctx, uint16_t addr, uint8_t ident_data) |
Write dentification page function. | |
uint8_t | eeprom5_read_lock_status (eeprom5_t *ctx) |
Reads the identification page lock status function. | |
void | eeprom5_lock_id (eeprom5_t *ctx, uint8_t lock_id) |
Lock ID function. | |
API for configuring and manipulating EEPROM 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void eeprom5_cfg_setup | ( | eeprom5_cfg_t * | cfg | ) |
EEPROM 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See eeprom5_cfg_t object definition for detailed explanation. |
void eeprom5_enable_memory_write | ( | eeprom5_t * | ctx, |
uint8_t | en_wr_mem ) |
Enable memory write function.
The function enable write depending on the function argument of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | en_wr_mem | : Write enabled or disabled. |
uint8_t eeprom5_generic_read | ( | eeprom5_t * | ctx, |
uint32_t | addr ) |
EEPROM 5 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.void eeprom5_generic_write | ( | eeprom5_t * | ctx, |
uint32_t | addr, | ||
uint8_t | tx_data ) |
EEPROM 5 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.void eeprom5_get_status | ( | eeprom5_t * | ctx, |
status_data_t * | stat_data ) |
Get status function.
The function read status data of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[out] | stat_data | : Pointer to the memory location where status data be stored. |
err_t eeprom5_init | ( | eeprom5_t * | ctx, |
eeprom5_cfg_t * | cfg ) |
EEPROM 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See eeprom5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void eeprom5_lock_id | ( | eeprom5_t * | ctx, |
uint8_t | lock_id ) |
Lock ID function.
The function lock ID instruction permanently locks the Identification page in read-only mode of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | lock_id | : 8-bit data to be written. |
uint8_t eeprom5_read_ident_page | ( | eeprom5_t * | ctx, |
uint16_t | addr ) |
Read identification page function.
The function read the identification page of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | addr | : 9-bit register address. |
uint8_t eeprom5_read_lock_status | ( | eeprom5_t * | ctx | ) |
Reads the identification page lock status function.
The function read the the identification page lock status of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
void eeprom5_read_memory | ( | eeprom5_t * | ctx, |
uint32_t | addr, | ||
uint8_t * | p_rx_data, | ||
uint8_t | n_bytes ) |
Read EEPROM memory function.
The function read a sequential data starting from the targeted 19-bit register address of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | addr | : 19-bit memory address. |
[out] | p_rx_data | : Pointer to the memory location where data be stored. |
[in] | n_bytes | : Number of bytes to be read. |
void eeprom5_send_cmd | ( | eeprom5_t * | ctx, |
uint8_t | cmd ) |
Send command function.
The function sends the desired command to the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | cmd | : 8-bit commands instruction. |
void eeprom5_set_hold | ( | eeprom5_t * | ctx, |
uint8_t | en_hold ) |
Enable hold operation function.
The function enable hold operation by sets the states of the HLD ( PWM ) pin depending on the function argument.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
en_hold | : Pause or resume any serial communications with the device. |
void eeprom5_set_status | ( | eeprom5_t * | ctx, |
status_data_t | stat_data ) |
Set status function.
The function write status data of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[out] | stat_data | : Pointer to the memory location where status data be stored. |
void eeprom5_set_write_protect | ( | eeprom5_t * | ctx, |
uint8_t | en_wr_prot ) |
Enable write protect function.
The function enables write protect, purpose of this input signal is to freeze the size of the area of memory that is protected against Write instructions.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | en_write_protect | : The contents of memory registers will be protected or not. |
void eeprom5_write_ident_page | ( | eeprom5_t * | ctx, |
uint16_t | addr, | ||
uint8_t | ident_data ) |
Write dentification page function.
The function writes the identification page of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | addr | : 19-bit register address. |
[in] | ident_data | : 8-bit data to be written. |
void eeprom5_write_memory | ( | eeprom5_t * | ctx, |
uint32_t | addr, | ||
uint8_t * | p_tx_data, | ||
uint8_t | n_bytes ) |
Write EEPROM memory function.
The function writes a sequential data starting of the targeted 19-bit register address of the M95M04-DR, 4-Mbit serial SPI bus EEPROM on EEPROM 5 click board.
[in] | ctx | : Click context object. See eeprom5_t object definition for detailed explanation. |
[in] | addr | : 19-bit memory address. |
[in] | p_tx_data | : Pointer to the data to be written. |
[in] | n_bytes | : Number of bytes to be written. |