42#define CHIP_NAME "Giantec Semiconductor GT24CXX"
43#define MANUFACTURER_NAME "Giantec Semiconductor"
44#define SUPPLY_VOLTAGE_MIN 1.7f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 3.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
73 handle->
debug_print(
"gt24cxx: iic_init is null.\n");
79 handle->
debug_print(
"gt24cxx: iic_deinit is null.\n");
85 handle->
debug_print(
"gt24cxx: iic_read is null.\n");
91 handle->
debug_print(
"gt24cxx: iic_write is null.\n");
97 handle->
debug_print(
"gt24cxx: iic_read_address16 is null.\n");
103 handle->
debug_print(
"gt24cxx: iic_write_address16 is null.\n");
109 handle->
debug_print(
"gt24cxx: delay_ms is null.\n");
116 handle->
debug_print(
"gt24cxx: iic init failed.\n");
148 handle->
debug_print(
"gt24cxx: iic deinit failed.\n");
173 handle->
id = (uint32_t)type;
266 if ((address + len) > handle->
id)
268 handle->
debug_print(
"gt24cxx: read out of range.\n");
276 address % 65536, buf,
286 if (handle->
iic_read((uint8_t)(handle->
iic_addr + ((address / 256) << 1)), address % 256,
314 uint16_t page_remain;
316 uint16_t page_delay_ms;
326 if ((address + len) > handle->
id)
328 handle->
debug_print(
"gt24cxx: write out of range.\n");
333 switch ((uint32_t)handle->
id)
421 page_remain = (uint16_t)(page_div - address % page_div);
422 if (len <= page_remain)
424 page_remain = (uint16_t)len;
431 address % 65536, buf,
439 if (page_remain == len)
445 address += page_remain;
450 page_remain = (uint16_t)len;
454 page_remain = page_div;
463 if (handle->
iic_write((uint8_t)(handle->
iic_addr + ((address / 256) << 1)), address % 256, buf,
471 if (page_remain == len)
477 address += page_remain;
482 page_remain = (uint16_t)len;
486 page_remain = page_div;
#define SUPPLY_VOLTAGE_MAX
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define CHIP_NAME
chip information definition
driver gt24cxx header file
uint8_t gt24cxx_init(gt24cxx_handle_t *handle)
initialize the chip
uint8_t gt24cxx_deinit(gt24cxx_handle_t *handle)
close the chip
uint8_t gt24cxx_info(gt24cxx_info_t *info)
get chip's information
uint8_t gt24cxx_set_addr_pin(gt24cxx_handle_t *handle, gt24cxx_address_t addr_pin)
set the chip address pin
uint8_t gt24cxx_set_type(gt24cxx_handle_t *handle, gt24cxx_t type)
set the chip type
uint8_t gt24cxx_write(gt24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
write bytes to the chip
uint8_t gt24cxx_read(gt24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
read bytes from the chip
uint8_t gt24cxx_get_type(gt24cxx_handle_t *handle, gt24cxx_t *type)
get the chip type
struct gt24cxx_handle_s gt24cxx_handle_t
gt24cxx handle structure definition
gt24cxx_t
gt24cxx type enumeration definition
uint8_t gt24cxx_get_addr_pin(gt24cxx_handle_t *handle, gt24cxx_address_t *addr_pin)
get the chip address pin
struct gt24cxx_info_s gt24cxx_info_t
gt24cxx information structure definition
gt24cxx_address_t
gt24cxx address enumeration definition
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