eeprom7 2.0.0.0
|
API for configuring and manipulating EEPROM 7 Click driver. More...
Topics | |
EEPROM 7 Registers List | |
List of registers of EEPROM 7 Click driver. | |
EEPROM 7 MikroBUS Map | |
MikroBUS pin mapping of EEPROM 7 Click driver. | |
Functions | |
void | eeprom7_cfg_setup (eeprom7_cfg_t *cfg) |
EEPROM 7 configuration object setup function. | |
err_t | eeprom7_init (eeprom7_t *ctx, eeprom7_cfg_t *cfg) |
EEPROM 7 initialization function. | |
err_t | eeprom7_default_cfg (eeprom7_t *ctx) |
EEPROM 7 default configuration function. | |
err_t | eeprom7_generic_write (eeprom7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
EEPROM 7 data writing function. | |
err_t | eeprom7_generic_read (eeprom7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
EEPROM 7 data reading function. | |
err_t | eeprom7_generic_write_then_read (eeprom7_t *ctx, uint8_t *data_in, uint8_t len_in, uint8_t *data_out, uint8_t len_out) |
EEPROM 7 data writing function. | |
void | eeprom7_enable_write_protect (eeprom7_t *ctx, uint8_t en_write_protect) |
Enable write protect function. | |
void | eeprom7_enable_hold_operation (eeprom7_t *ctx, uint8_t en_hold) |
Enable hold operation function. | |
void | eeprom7_enable_write (eeprom7_t *ctx, uint8_t en_write) |
Enable write function. | |
uint16_t | eeprom7_read_status (eeprom7_t *ctx) |
Read status function. | |
uint8_t | eeprom7_is_device_ready (eeprom7_t *ctx) |
Check the device is ready function. | |
err_t | eeprom7_send_cmd (eeprom7_t *ctx, uint8_t cmd) |
Send command function. | |
void | eeprom7_sw_reset (eeprom7_t *ctx) |
Software device reset function. | |
void | eeprom7_set_status (eeprom7_t *ctx, uint8_t status) |
Set status function. | |
uint8_t | eeprom7_get_status (eeprom7_t *ctx) |
Get status function. | |
void | eeprom7_write_memory (eeprom7_t *ctx, uint32_t addr, uint8_t *p_tx_data, uint8_t n_bytes) |
Write EEPROM memory function. | |
void | eeprom7_read_memory (eeprom7_t *ctx, uint32_t addr, uint8_t *p_rx_data, uint8_t n_bytes) |
Read EEPROM memory function. | |
err_t | eeprom7_check_status (eeprom7_t *ctx, uint8_t check_bit) |
Status register bits check function. | |
API for configuring and manipulating EEPROM 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void eeprom7_cfg_setup | ( | eeprom7_cfg_t * | cfg | ) |
EEPROM 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See eeprom7_cfg_t object definition for detailed explanation. |
err_t eeprom7_check_status | ( | eeprom7_t * | ctx, |
uint8_t | check_bit ) |
Status register bits check function.
The function checks value of status register bit determined by check_bit parametar from the targeted register address of t25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | check_bit | : Determined witch bit in status register be checked |
0
- Success, -1
- Error.err_t eeprom7_default_cfg | ( | eeprom7_t * | ctx | ) |
EEPROM 7 default configuration function.
This function executes a default configuration of EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
0
- Success, -1
- Error.void eeprom7_enable_hold_operation | ( | eeprom7_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.
[out] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | en_hold | : Enable/disable hold. |
void eeprom7_enable_write | ( | eeprom7_t * | ctx, |
uint8_t | en_write ) |
Enable write function.
The function enable write depending on the function argument of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[out] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | en_write | : Write enable/disable |
void eeprom7_enable_write_protect | ( | eeprom7_t * | ctx, |
uint8_t | en_write_protect ) |
Enable write protect function.
The function enable write protect, the EEPROM protection is determined by the contents of the Memory Partition Registers (MPR) by sets the states of the HLD ( PWM ) pin depending on the function argument.
[out] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | en_write_protect | : Write protection enable/disable. |
err_t eeprom7_generic_read | ( | eeprom7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
EEPROM 7 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 eeprom7_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.err_t eeprom7_generic_write | ( | eeprom7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
EEPROM 7 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 eeprom7_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.err_t eeprom7_generic_write_then_read | ( | eeprom7_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | len_in, | ||
uint8_t * | data_out, | ||
uint8_t | len_out ) |
EEPROM 7 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 eeprom7_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len_in | : Number of bytes to be written. |
[out] | data_out | : Output read data. |
[in] | len_out | : Number of bytes to be read. |
0
- Success, -1
- Error.uint8_t eeprom7_get_status | ( | eeprom7_t * | ctx | ) |
Get status function.
The function get status register of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
err_t eeprom7_init | ( | eeprom7_t * | ctx, |
eeprom7_cfg_t * | cfg ) |
EEPROM 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See eeprom7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t eeprom7_is_device_ready | ( | eeprom7_t * | ctx | ) |
Check the device is ready function.
The function checks the device is ready by check bit 0 of the status register of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
void eeprom7_read_memory | ( | eeprom7_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 register address of t25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | addr | : 24-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. |
uint16_t eeprom7_read_status | ( | eeprom7_t * | ctx | ) |
Read status function.
The function read 16-bit status register of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
err_t eeprom7_send_cmd | ( | eeprom7_t * | ctx, |
uint8_t | cmd ) |
Send command function.
The function sends the desired command to the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | cmd | : 8-bit Commands Opcode. |
0
- Success, -1
- Error.void eeprom7_set_status | ( | eeprom7_t * | ctx, |
uint8_t | status ) |
Set status function.
The function set status register of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[out] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | status | : 8-bit status data. |
void eeprom7_sw_reset | ( | eeprom7_t * | ctx | ) |
Software device reset function.
The function software reset, reset the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
void eeprom7_write_memory | ( | eeprom7_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 register address of the 25CSM04 4-Mbit SPI Serial EEPROM with 128-Bit Serial Number and Enhanced Write Protection on EEPROM 7 click board.
[in] | ctx | : Click context object. See eeprom7_t object definition for detailed explanation. |
[in] | addr | : 24-bit memory address. |
[in] | p_tx_data | : Pointer to the data to be written. |
[in] | n_bytes | : Number of bytes to be written. |