1 /* 2 * Copyright (c) 2024 Nuvoton Technology Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_USBC_TCPC_UCPD_NUMAKER_H_ 8 #define ZEPHYR_DRIVERS_USBC_TCPC_UCPD_NUMAKER_H_ 9 10 #include <zephyr/drivers/usb_c/usbc_ppc.h> 11 #include <zephyr/drivers/usb_c/usbc_vbus.h> 12 13 /* TCPC exported for PPC */ 14 int numaker_tcpc_ppc_is_dead_battery_mode(const struct device *dev); 15 int numaker_tcpc_ppc_exit_dead_battery_mode(const struct device *dev); 16 int numaker_tcpc_ppc_is_vbus_source(const struct device *dev); 17 int numaker_tcpc_ppc_is_vbus_sink(const struct device *dev); 18 int numaker_tcpc_ppc_set_snk_ctrl(const struct device *dev, bool enable); 19 int numaker_tcpc_ppc_set_src_ctrl(const struct device *dev, bool enable); 20 int numaker_tcpc_ppc_set_vbus_discharge(const struct device *dev, bool enable); 21 int numaker_tcpc_ppc_is_vbus_present(const struct device *dev); 22 int numaker_tcpc_ppc_set_event_handler(const struct device *dev, usbc_ppc_event_cb_t handler, 23 void *data); 24 int numaker_tcpc_ppc_dump_regs(const struct device *dev); 25 26 /* TCPC exported for VBUS */ 27 bool numaker_tcpc_vbus_check_level(const struct device *dev, enum tc_vbus_level level); 28 int numaker_tcpc_vbus_measure(const struct device *dev, int *vbus_meas); 29 int numaker_tcpc_vbus_discharge(const struct device *dev, bool enable); 30 int numaker_tcpc_vbus_enable(const struct device *dev, bool enable); 31 32 #endif /* ZEPHYR_DRIVERS_USBC_TCPC_UCPD_NUMAKER_H_ */ 33