42#define CHIP_NAME "Texas Instruments PCF8575"
43#define MANUFACTURER_NAME "Texas Instruments"
44#define SUPPLY_VOLTAGE_MIN 2.5f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 100.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
68 handle->
iic_addr |= (uint8_t)(addr_pin << 1);
119 handle->
debug_print(
"pcf8575: iic_init is null.\n");
125 handle->
debug_print(
"pcf8575: iic_deinit is null.\n");
131 handle->
debug_print(
"pcf8575: iic_read_cmd is null.\n");
137 handle->
debug_print(
"pcf8575: iic_write_cmd is null.\n");
143 handle->
debug_print(
"pcf8575: delay_ms is null.\n");
150 handle->
debug_print(
"pcf8575: iic init failed.\n");
157 (uint8_t *)buf, 2) != 0)
159 handle->
debug_print(
"pcf8575: iic write failed.\n");
195 handle->
debug_print(
"pcf8575: iic deinit failed.\n");
234 handle->
debug_print(
"pcf8575: iic read failed.\n");
238 prev = (((uint16_t)buf[0]) << 8) | buf[1];
274 handle->
debug_print(
"pcf8575: iic read failed.\n");
278 prev = (((uint16_t)buf[0]) << 8) | buf[1];
280 prev |= level << pin;
281 buf[0] = (prev >> 8) & 0xFF;
282 buf[1] = (prev >> 0) & 0xFF;
286 handle->
debug_print(
"pcf8575: iic write failed.\n");
#define SUPPLY_VOLTAGE_MAX
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define CHIP_NAME
chip information definition
driver pcf8575 header file
uint8_t pcf8575_deinit(pcf8575_handle_t *handle)
close the chip
struct pcf8575_handle_s pcf8575_handle_t
pcf8575 handle structure definition
uint8_t pcf8575_set_addr_pin(pcf8575_handle_t *handle, pcf8575_address_t addr_pin)
set the address pin
uint8_t pcf8575_write(pcf8575_handle_t *handle, pcf8575_pin_t pin, pcf8575_pin_level_t level)
write the pin
uint8_t pcf8575_read(pcf8575_handle_t *handle, pcf8575_pin_t pin, pcf8575_pin_level_t *level)
read the pin
uint8_t pcf8575_init(pcf8575_handle_t *handle)
initialize the chip
pcf8575_address_t
pcf8575 address enumeration definition
pcf8575_pin_t
pcf8575 pin enumeration definition
pcf8575_pin_level_t
pcf8575 pin enumeration definition
struct pcf8575_info_s pcf8575_info_t
pcf8575 information structure definition
uint8_t pcf8575_info(pcf8575_info_t *info)
get chip's information
uint8_t pcf8575_get_addr_pin(pcf8575_handle_t *handle, pcf8575_address_t *addr_pin)
get the address pin
uint8_t pcf8575_set_reg(pcf8575_handle_t *handle, uint8_t *buf, uint16_t len)
set the chip register
uint8_t pcf8575_get_reg(pcf8575_handle_t *handle, uint8_t *buf, uint16_t len)
get the chip register
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_read_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
uint8_t(* iic_write_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v