42#define CHIP_NAME "Cypress FM24CLXX"
43#define MANUFACTURER_NAME "Cypress"
44#define SUPPLY_VOLTAGE_MIN 2.7f
45#define SUPPLY_VOLTAGE_MAX 3.65f
46#define MAX_CURRENT 0.1f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
73 handle->
debug_print(
"fm24clxx: iic_init is null.\n");
79 handle->
debug_print(
"fm24clxx: iic_deinit is null.\n");
85 handle->
debug_print(
"fm24clxx: iic_read is null.\n");
91 handle->
debug_print(
"fm24clxx: iic_write is null.\n");
97 handle->
debug_print(
"fm24clxx: iic_read_address16 is null.\n");
103 handle->
debug_print(
"fm24clxx: iic_write_address16 is null.\n");
109 handle->
debug_print(
"fm24clxx: delay_ms is null.\n");
116 handle->
debug_print(
"fm24clxx: iic init failed.\n");
148 handle->
debug_print(
"fm24clxx: iic deinit failed.\n");
173 handle->
id = (uint16_t)type;
269 if ((uint16_t)(address + len) > handle->
id)
271 handle->
debug_print(
"fm24clxx: read out of range.\n");
275 page_remain = (uint8_t)(8 - address % 8);
276 if (len <= page_remain)
278 page_remain = (uint8_t)len;
290 if (page_remain == len)
296 address += page_remain;
301 page_remain = (uint8_t)len;
314 if (handle->
iic_read((uint8_t)(handle->
iic_addr + ((address / 256) << 1)), address % 256, buf,
321 if (page_remain == len)
327 address += page_remain;
332 page_remain = (uint8_t)len;
372 if ((uint16_t)(address + len) > handle->
id)
374 handle->
debug_print(
"fm24clxx: write out of range.\n");
378 page_remain = (uint8_t)(8 - address % 8);
379 if (len <= page_remain)
381 page_remain = (uint8_t)len;
393 if (page_remain == len)
399 address += page_remain;
404 page_remain = (uint8_t)len;
417 if (handle->
iic_write((uint8_t)(handle->
iic_addr + ((address / 256) << 1)), address % 256, buf,
424 if (page_remain == len)
430 address += page_remain;
435 page_remain = (uint8_t)len;
#define SUPPLY_VOLTAGE_MAX
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define CHIP_NAME
chip information definition
driver fm24clxx header file
uint8_t fm24clxx_set_addr_pin(fm24clxx_handle_t *handle, fm24clxx_address_t addr_pin)
set the chip address pin
uint8_t fm24clxx_init(fm24clxx_handle_t *handle)
initialize the chip
struct fm24clxx_handle_s fm24clxx_handle_t
fm24clxx handle structure definition
uint8_t fm24clxx_read(fm24clxx_handle_t *handle, uint16_t address, uint8_t *buf, uint16_t len)
read bytes from the chip
fm24clxx_address_t
fm24clxx address enumeration definition
fm24clxx_t
fm24clxx type enumeration definition
struct fm24clxx_info_s fm24clxx_info_t
fm24clxx information structure definition
uint8_t fm24clxx_set_type(fm24clxx_handle_t *handle, fm24clxx_t type)
set the chip type
uint8_t fm24clxx_write(fm24clxx_handle_t *handle, uint16_t address, uint8_t *buf, uint16_t len)
write bytes to the chip
uint8_t fm24clxx_info(fm24clxx_info_t *info)
get chip's information
uint8_t fm24clxx_get_addr_pin(fm24clxx_handle_t *handle, fm24clxx_address_t *addr_pin)
get the chip address pin
uint8_t fm24clxx_deinit(fm24clxx_handle_t *handle)
close the chip
uint8_t fm24clxx_get_type(fm24clxx_handle_t *handle, fm24clxx_t *type)
get the chip type
void(* delay_ms)(uint32_t ms)
uint8_t(* iic_read_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v