Commit Graph

7 Commits

Author SHA1 Message Date
Erwan Gouriou 5a26397450 sample: shields: Update prj.conf
Before Kconfig clean up to be performed in boards/shields, update samples
to enable the components they require.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-05-23 13:02:36 +02: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
Gerard Marull-Paretas 9c27fabba3 samples: shields: npm6001_ek: remove dead assignment
The voltage gets assigned by regulator_get_voltage, code was likely a
copy&paste from set voltage command.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas ffdf85ed30 samples: shields: npm6001_ek: add support to query mode
Add a new command to query the regulator operating mode.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas 460f2d04fa samples: shields: npm6001_ek: add utility to test regulators
Add a utility sub-shell to test all regulators embedded in the nPM6001
PMIC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-16 11:26:47 +01:00
Gerard Marull-Paretas e7c659fb29 samples: shields: npm6001_ek: fix build
Commit ff3aaa6ef3 moved some getopt
declarations to unistd.h. Update sample to include the header, so that
we can access optarg.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-05 18:21:31 +01:00
Gerard Marull-Paretas 767dd47f98 samples: shields: npm6001_ek: initial version
Add a sample that demonstrates usage of the nPM6001 PMIC (all of its
functionalities).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-22 11:05:19 +01:00