41 #define M24LR64E_I2C_BUS 0 42 #define M24LR64E_DEFAULT_I2C_ADDR 0x53 43 #define M24LR64E_DEFAULT_I2C_ADDR_E2 (M24LR64E_DEFAULT_I2C_ADDR | 0x04) 45 #define M24LR64E_EEPROM_I2C_LENGTH 8192 46 #define M24LR64E_PASSWORD_LENGTH 4 47 #define M24LR64E_SECTOR_SECURITY_STATUS_BASE_ADDR 0x800 48 #define M24LR64E_LOCK_PROTECT_BIT 0x01 49 #define M24LR64E_WRITE_READ_PROTECT_BIT 0x02 50 #define M24LR64E_PASSWORD_CTRL_BIT 0x04 52 #define M24LR64E_UID_LENGTH 8 53 #define M24LR64E_I2C_WRITE_TIME 5 66 M24LR64E_I2C_PASSWORD_ADDRESS = 2304,
67 M24LR64E_RF_PASSWORD_1_ADDRESS = 2308,
68 M24LR64E_RF_PASSWORD_2_ADDRESS = 2312,
69 M24LR64E_RF_PASSWORD_3_ADDRESS = 2316,
70 M24LR64E_DSFID_ADDRESS = 2320,
71 M24LR64E_AFI_ADDRESS = 2321,
72 M24LR64E_RESV_ADDRESS = 2322,
73 M24LR64E_CONFIG_ADDRESS = 2323,
74 M24LR64E_UID_ADDRESS = 2324,
75 M24LR64E_MEM_SIZE_ADDRESS = 2332,
76 M24LR64E_IC_REF_ADDRESS = 2335,
77 M24LR64E_PROG_COMP_ENERGY_HARVEST_ADDRESS = 2339
81 M24LR64E_USER_MODE = 0x0,
82 M24LR64E_ROOT_MODE = 0x1
83 } m24lr64e_access_mode;
94 m24lr64e_access_1110 = 0,
95 m24lr64e_access_1111 = 1,
96 m24lr64e_access_1100 = 2,
97 m24lr64e_access_0111 = 3,
98 } sector_access_right;
105 m24lr64e_no_password = 0,
106 m24lr64e_password_1 = 1,
107 m24lr64e_password_2 = 2,
108 m24lr64e_password_3 = 3,
109 } sector_select_password;
115 mraa_i2c_context i2c;
118 m24lr64e_access_mode mode;
162 uint32_t sector_number,
164 sector_access_right access_right,
165 sector_select_password password);
183 uint32_t sector_number,
249 uint8_t* buffer,
int len);
270 uint8_t* buffer,
int len);
upm_result_t m24lr64e_sector_protect_config(m24lr64e_context dev, uint32_t sector_number, bool protect_enable, sector_access_right access_right, sector_select_password password)
Definition: m24lr64e.c:141
upm_result_t m24lr64e_sector_write_lock_bit(m24lr64e_context dev, uint32_t sector_number, bool sock_enable)
Definition: m24lr64e.c:162
void m24lr64e_close(m24lr64e_context dev)
Definition: m24lr64e.c:82
m24lr64e_context m24lr64e_init(int bus, m24lr64e_access_mode mode)
Definition: m24lr64e.c:51
upm_result_t m24lr64e_clear_sector_protect(m24lr64e_context dev)
Definition: m24lr64e.c:157
upm_result_t m24lr64e_clear_memory(m24lr64e_context dev)
Definition: m24lr64e.c:235
upm_result_t m24lr64e_get_dsfid(m24lr64e_context dev, uint8_t *dsfid)
Definition: m24lr64e.c:187
upm_result_t m24lr64e_get_afi(m24lr64e_context dev, uint8_t *afi)
Definition: m24lr64e.c:192
upm_result_t m24lr64e_write_byte(m24lr64e_context dev, uint32_t address, uint8_t data)
Definition: m24lr64e.c:244
upm_result_t m24lr64e_read_byte(m24lr64e_context dev, uint32_t address, uint8_t *data)
Definition: m24lr64e.c:256
Definition: m24lr64e.h:114
upm_result_t m24lr64e_get_uid(m24lr64e_context dev, uint8_t *uid)
Definition: m24lr64e.c:197
upm_result_t m24lr64e_read_bytes(m24lr64e_context dev, uint32_t address, uint8_t *buffer, int len)
Definition: m24lr64e.c:262
upm_result_t m24lr64e_write_bytes(m24lr64e_context dev, uint32_t address, uint8_t *buffer, int len)
Definition: m24lr64e.c:250
upm_result_t m24lr64e_submit_password(m24lr64e_context dev, uint32_t password)
Definition: m24lr64e.c:87
upm_result_t m24lr64e_write_password(m24lr64e_context dev, uint32_t password)
Definition: m24lr64e.c:115
upm_result_t m24lr64e_get_memory_size(m24lr64e_context dev, uint32_t *memory_size)
Definition: m24lr64e.c:210