API for configuring and manipulating EEPROM 8 Click driver.
More...
|
void | eeprom8_cfg_setup (eeprom8_cfg_t *cfg) |
| EEPROM 8 configuration object setup function.
|
|
err_t | eeprom8_init (eeprom8_t *ctx, eeprom8_cfg_t *cfg) |
| EEPROM 8 initialization function.
|
|
err_t | eeprom8_write_byte (eeprom8_t *ctx, uint16_t reg_addr, uint8_t data_in) |
| Byte Write function.
|
|
err_t | eeprom8_write_page (eeprom8_t *ctx, uint16_t reg_addr, uint8_t *data_in) |
| Page Write function.
|
|
err_t | eeprom8_read_random_byte (eeprom8_t *ctx, uint16_t reg_addr, uint8_t *data_out) |
| Random Byte Read function.
|
|
err_t | eeprom8_read_current_byte (eeprom8_t *ctx, uint8_t *data_out) |
| Byte Read function.
|
|
err_t | eeprom8_read_sequential (eeprom8_t *ctx, uint16_t reg_addr, uint16_t n_bytes, uint8_t *data_out) |
| Sequential Read function.
|
|
void | eeprom8_write_enable (eeprom8_t *ctx) |
| Write Enable function.
|
|
void | eeprom8_write_protect (eeprom8_t *ctx) |
| Write Protect function.
|
|
API for configuring and manipulating EEPROM 8 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
◆ EEPROM8_WRITE_ENABLE
#define EEPROM8_WRITE_ENABLE 0 |
◆ EEPROM8_WRITE_PROTECT
#define EEPROM8_WRITE_PROTECT 1 |
◆ eeprom8_cfg_setup()
EEPROM 8 configuration object setup function.
This function initializes click configuration structure to initial values.
- Parameters
-
[out] | cfg | : Click configuration structure. See eeprom8_cfg_t object definition for detailed explanation. |
- Returns
- Nothing.
- Note
- The all used pins will be set to unconnected state.
◆ eeprom8_init()
EEPROM 8 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
- Parameters
-
[out] | ctx | : Click context object. See eeprom8_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See eeprom8_cfg_t object definition for detailed explanation. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ eeprom8_read_current_byte()
err_t eeprom8_read_current_byte |
( |
eeprom8_t * | ctx, |
|
|
uint8_t * | data_out ) |
Byte Read function.
This function reads one byte data based on internal address pointer.
- Parameters
-
[in] | ctx | Click object. |
[out] | data_out | Output read data. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ eeprom8_read_random_byte()
err_t eeprom8_read_random_byte |
( |
eeprom8_t * | ctx, |
|
|
uint16_t | reg_addr, |
|
|
uint8_t * | data_out ) |
Random Byte Read function.
This function reads one byte data from the desired register.
- Parameters
-
[in] | ctx | Click object. |
[in] | reg_addr | Register address. |
[out] | data_out | Output read data. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ eeprom8_read_sequential()
err_t eeprom8_read_sequential |
( |
eeprom8_t * | ctx, |
|
|
uint16_t | reg_addr, |
|
|
uint16_t | n_bytes, |
|
|
uint8_t * | data_out ) |
Sequential Read function.
This function reads the desired number of bytes starting from the selected register.
- Parameters
-
[in] | ctx | Click object. |
[in] | reg_addr | Register address. |
[in] | n_bytes | Number of bytes to be read. |
[out] | data_out | Output read data buffer. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ eeprom8_write_byte()
err_t eeprom8_write_byte |
( |
eeprom8_t * | ctx, |
|
|
uint16_t | reg_addr, |
|
|
uint8_t | data_in ) |
Byte Write function.
This function writes one byte data to the desired register.
- Parameters
-
[in] | ctx | Click object. |
[in] | reg_addr | Register address. |
[in] | data_in | Data to be written. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation
- Note
- None.
◆ eeprom8_write_enable()
Write Enable function.
This function allows data writing operation to the EEPROM8.
- Parameters
-
- Returns
- Nothing.
- Note
- None.
◆ eeprom8_write_page()
err_t eeprom8_write_page |
( |
eeprom8_t * | ctx, |
|
|
uint16_t | reg_addr, |
|
|
uint8_t * | data_in ) |
Page Write function.
This function writes up to 128 bytes of data starting from the selected register.
- Parameters
-
[in] | ctx | Click object. |
[in] | reg_addr | Register address. |
[in] | data_in | Data to be written. |
- Returns
0
- Success,
-1
- Error. See #err_t definition for detailed explanation.
- Note
- None.
◆ eeprom8_write_protect()
void eeprom8_write_protect |
( |
eeprom8_t * | ctx | ) |
|
Write Protect function.
This function prevents data writing operation to the EEPROM8.
- Parameters
-
- Returns
- Nothing.
- Note
- None.