diff --git a/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.conf b/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.conf new file mode 100644 index 00000000000..30b789b29ec --- /dev/null +++ b/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.conf @@ -0,0 +1 @@ +CONFIG_USBC_PPC_DRIVER=y diff --git a/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.overlay b/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.overlay new file mode 100644 index 00000000000..0942227699d --- /dev/null +++ b/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.overlay @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include + +/ { + aliases { + usbc-port0 = &port0; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port0: usbc-port@0 { + compatible = "usb-c-connector"; + reg = <0>; + tcpc = <&tcpc0>; + vbus = <&vbus0>; + ppc = <&ppc0>; + power-role = "sink"; + sink-pdos = ; + }; + }; +}; + +&pinctrl { + tcpc0_default: tcpc0_default { + group0 { + pinmux = ; + digital-path-disable; + }; + group1 { + pinmux = , + , + , + , + , + ; + }; + }; + + eadc0_default: eadc0_default { + group0 { + pinmux = ; + digital-path-disable; + }; + }; +}; + +&tcpc0 { + status = "okay"; + pinctrl-0 = <&tcpc0_default>; + pinctrl-names = "default"; + gpios = <&gpioa 12 0>, + <&gpioa 1 GPIO_ACTIVE_HIGH>; + gpio-names = "vbus-detect", "vbus-discharge"; + vbus-sink-enable-polarity = "high-active"; + vbus-divide = "divide-10"; + io-channels = <&eadc0 15>; + io-channel-names = "chn-vbus"; +}; + +&vbus0 { + status = "okay"; +}; + +&ppc0 { + status = "okay"; +}; + +&eadc0 { + status = "okay"; + pinctrl-0 = <&eadc0_default>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + + channel@15 { + reg = <15>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_EXTERNAL0"; + zephyr,vref-mv = <3300>; + zephyr,acquisition-time = ; + }; +}; + +/* Enable GPIO modules which are needed for below use cases: + * 1. GPIO pins + * 2. Power pins which need to disable digital input path + */ +&gpioa { + status = "okay"; +}; +&gpiob { + status = "okay"; +};