API for configuring and manipulating SWI EEPROM Click driver.
More...
API for configuring and manipulating SWI EEPROM Click driver.
◆ SWIEEPROM_OP_CODE_EEPROM
#define SWIEEPROM_OP_CODE_EEPROM 0xA0 |
◆ SWIEEPROM_OP_CODE_FREEZE_ROM
#define SWIEEPROM_OP_CODE_FREEZE_ROM 0x10 |
◆ SWIEEPROM_OP_CODE_HIGH_SPEED
#define SWIEEPROM_OP_CODE_HIGH_SPEED 0xE0 |
◆ SWIEEPROM_OP_CODE_ID
#define SWIEEPROM_OP_CODE_ID 0xC0 |
◆ SWIEEPROM_OP_CODE_LOCK
#define SWIEEPROM_OP_CODE_LOCK 0x20 |
◆ SWIEEPROM_OP_CODE_ROM
#define SWIEEPROM_OP_CODE_ROM 0x70 |
◆ SWIEEPROM_OP_CODE_SECURITY
#define SWIEEPROM_OP_CODE_SECURITY 0xB0 |
◆ SWIEEPROM_OP_CODE_STDN_SPEED
#define SWIEEPROM_OP_CODE_STDN_SPEED 0xD0 |
◆ swieeprom_check_communication()
err_t swieeprom_check_communication |
( |
swieeprom_t * |
ctx | ) |
|
SWI EEPROM check communication function.
This function checks the communication by reading and verifying the device ID.
- Parameters
-
[in] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ swieeprom_init()
SWI EEPROM initialization function.
This function initializes all necessary pins and peripherals used for this click board.
- Parameters
-
[out] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ swieeprom_mem_clear()
SWI EEPROM memory clear function.
This function clears the whole memory to zero.
- Parameters
-
[in] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ swieeprom_mem_read()
err_t swieeprom_mem_read |
( |
swieeprom_t * |
ctx, |
|
|
uint8_t |
start_addr, |
|
|
uint8_t * |
data_out, |
|
|
uint8_t |
len |
|
) |
| |
SWI EEPROM memory read function.
This function reads data from the specified memory address.
- Parameters
-
[in] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
[in] | start_addr | : Address byte [0-127]. |
[out] | data_out | : Read data. |
[in] | len | : Number of data bytes to read. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ swieeprom_mem_write()
err_t swieeprom_mem_write |
( |
swieeprom_t * |
ctx, |
|
|
uint8_t |
start_addr, |
|
|
uint8_t |
data_in |
|
) |
| |
SWI EEPROM memory write function.
This function writes data to the specified memory address.
- Parameters
-
[in] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
[in] | start_addr | : Address byte [0-127]. |
[in] | data_in | : Data to be written. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ swieeprom_mem_write_page()
err_t swieeprom_mem_write_page |
( |
swieeprom_t * |
ctx, |
|
|
uint8_t |
start_addr, |
|
|
uint8_t * |
data_in, |
|
|
uint8_t |
len |
|
) |
| |
SWI EEPROM memory write page function.
This function writes data to the specified memory address page.
- Parameters
-
[in] | ctx | : Click context object. See swieeprom_t object definition for detailed explanation. |
[in] | start_addr | : Address byte [0-127]. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes (up to 8 bytes). |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.