|
EEPROM_STM_Arduino 0.9.0
EEPROM:M24C02 class driver
|
#include <M24C02.h>
Public Member Functions | |
| M24C02 (uint8_t i2c_address=(0xA0 > > 1)) | |
| M24C02 (TwoWire &wire, uint8_t i2c_address=(0xA0 > > 1)) | |
| virtual | ~M24C02 () |
| void | begin (void) |
| int | wait_write_complete (int n) |
| int | write (int byte_adr, uint8_t data) |
| int | write (int byte_adr, const uint8_t *dp, int length) |
| uint8_t | read (int byte_adr) |
| int | read (int byte_adr, uint8_t *dp, int length) |
Private Member Functions | |
| int | within_a_page (int byte_adr, int length) |
Static Private Attributes | |
| static constexpr int | PAGE_WRITE_SIZE = 16 |
| static constexpr int | PAGE_READ_SIZE = 32 |
EEPROM:M24C02 operation library for Arduino
Released under the MIT license License M24C02 class
M24C02 class is a sample code for the PCA9846PW-ARD and the PCA9617ADP-ARD operation
| M24C02::M24C02 | ( | uint8_t | i2c_address = (0xA0 >> 1) | ) |
Create a M24C02 instance with specified address
| i2c_address | I2C-bus address (default: (0xA0>>1)) |
Definition at line 3 of file M24C02.cpp.
| M24C02::M24C02 | ( | TwoWire & | wire, |
| uint8_t | i2c_address = (0xA0 >> 1) ) |
Create a M24C02 instance with specified address
| wire | TwoWire instance |
| i2c_address | I2C-bus address (default: (0xA0>>1)) |
Definition at line 7 of file M24C02.cpp.
|
virtual |
Definition at line 11 of file M24C02.cpp.
| void M24C02::begin | ( | void | ) |
Begin the device operation
This method turns-on the device
Definition at line 15 of file M24C02.cpp.
| uint8_t M24C02::read | ( | int | byte_adr | ) |
Read data
| byte_adr | byte address |
Definition at line 92 of file M24C02.cpp.
Referenced by write().
| int M24C02::read | ( | int | byte_adr, |
| uint8_t * | dp, | ||
| int | length ) |
Read data
| byte_adr | byte address. The address can be arbitrary. It not needed to be aligned to page size. |
| dp | pointer to data array |
| length | data size |
Definition at line 97 of file M24C02.cpp.
| int M24C02::wait_write_complete | ( | int | n | ) |
Wait write complete
| n | loop count (in mili-second) |
Definition at line 81 of file M24C02.cpp.
|
inlineprivate |
| int M24C02::write | ( | int | byte_adr, |
| const uint8_t * | dp, | ||
| int | length ) |
Write data
| byte_adr | byte address. The address can be arbitrary. It not needed to be aligned to page size. |
| dp | pointer to data array |
| length | data size |
Definition at line 32 of file M24C02.cpp.
| int M24C02::write | ( | int | byte_adr, |
| uint8_t | data ) |
Write data
| byte_adr | byte address |
| data | 1 byte data for writing |
Definition at line 19 of file M24C02.cpp.
|
staticconstexprprivate |
|
staticconstexprprivate |
Definition at line 87 of file M24C02.h.
Referenced by within_a_page(), and write().