Commit Graph

16 Commits

Author SHA1 Message Date
Andreas Sandberg b544855ba5 samples: usb-c: sink: Add support for WeAct STM32G431 core
Add support for the WeAct Studio STM32G431 Core board. Note that this
board does not support USB-C PD in its default configuration. See the
board documentation for the necessary hardware reconfiguration.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2023-11-21 09:54:02 +01:00
Andreas Sandberg b41853127f samples: usb_c: Rename port1 to port0 for consistency
Aliases, including usbc_port0, start counting from zero. This meant
that the DT alias is inconsistent with the port numbering in the
samples. Change the numbering scheme to start from zero to make this
consistent.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2023-10-25 18:37:53 -07:00
Andreas Sandberg d36e42c975 usbc: Use a DT alias to identify USB-C port
Samples sometimes need to identify a default USB-C port. Instead of
hard-coding a node label, use the usbc-port0 alias to point to the
correct node.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2023-10-25 18:37:53 -07:00
Benjamin Cabé 4f1cd0e428 doc: Migrate subsys/ code samples to new Sphinx extension
This migrates the subsys code samples to the new Sphinx code-sample
extension, making it easier to find relevant samples when browsing
API reference.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-21 09:28:31 +02:00
Daniel Leung dc0cec972d samples: usb: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Nerijus Bendžiūnas 397ed142ad doc: fix :zephyr-app: paths
During testing I've found one bad path and looked if
there is more.

I've used this oneliner to find more:

```
rg :zephyr-app: | awk '{ print $3 }' | while read dir
do
    test -d $dir || echo $dir
done | grep '^samples' | grep -v '<' | sort | uniq

```

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
2023-07-17 16:51:16 -04:00
Madhurima Paruchuri a19d905cc4 USB-C: genVIF: Cleanup and add support to pick static data from input
Removed few VIF properties which are being hardcoded
Updated the script to parse source VIF XML and add information to
the output
Added optional Kconfig option to configure custom source VIF XML path
Cleaned up the code

Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com>
2023-05-26 13:54:43 -04:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Michał Barnaś 052a057daf usbc: fix assignment of value for PDOs count in get_snk_cap callback
Instead of assigning the address of value to the temporary function
parameter, there should be a dereference of the pointer and assignment
of PDOs count to it.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-03-21 09:36:08 +01:00
Sam Hurst ce65f86d0a samples: usb-c: sink: Enable Dead Battery functionality on Port1
Enable Dead Battery functionality on PD Port1

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-06 10:03:13 +01:00
Sam Hurst de0a64fa0d samples: subsys: usb_c: sink: Change PD port to Port1
The stm32g081b_eval board does not implement Dead Battery
functionality on PD Port2. Change the sample configuration
so that PD Port1 is used, which has Dead Battery support.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-06 10:03:13 +01:00
Sam Hurst 6984162e92 samples: subsys: usb_c: sink: Add USBC_CSM_SINK_ONLY Config to prj.conf
Add CONFIG_USBC_CSM_SINK_ONLY=y to Sink's sample prj.conf.
This selects the Sink only Connection state machine
for the Sink sample and it explicitly show the user
of the Sink sample how the connection state machines are
selected.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-11 18:32:43 +01:00
Sam Hurst 3e98f20d66 samples: subsys: usb_c: sink: Add missing policy notifications
Add missing policy notifications to case statement

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Madhurima Paruchuri fa738b0f74 usb-c: Generate USB-C connector VIF policies XML file
Generates XML file containing VIF policies by reading the device tree
using EDT.pickle generated during build
This script writes a subset of general and sink-pdo VIF policies in
output file
This script gets invoked during build if enabled through kconfig
The generated XML containing USB-C VIF policies could be used by
USB PD/Type-C analysers/testers to understand USB-C properties and
perform tests accordingly

Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com>
2022-12-02 08:46:04 -06:00
Anas Nashif ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Sam Hurst e2f5fcd91a samples: usb-c: sink: Add USB-C Subsystem Sink Sample
Implementing USB-C Sink functionality can be difficult.
This sample application serves as an example of how
to create an application with Power Delivery Sink
functionality.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-10-22 18:38:35 -04:00