Commit graph

10 commits

Author SHA1 Message Date
Peter Bigot a4337bde28 drivers: pwm: clarify behavior
As written the specification when both period and pulse are zero is
inconsistent: allowed behavior would be to drive the pin at constant
active or constant inactive, depending on which condition was checked
first.

Clarify that driving constant active level requres a non-zero pulse
equal to period.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-09 18:12:53 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Anas Nashif 3e4cd1853e drivers: pwm: fix doxygen docs
When referencing parameters, use @p and not @param.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-25 17:16:56 +02:00
Peter Bigot a189311798 drivers: pwm: remove extraneous whitespace
PR was merged before this was cleaned up.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-19 22:27:41 -04:00
Alexander Wachter 31ae13eeb1 drivers: pwm: Clarify period parameter
Clarify what happens when the period parameter is zero or equal
to the period.

Signed-off-by: Alexander Wachter <alexander.wachter@leica-geosystems.com>
2020-05-19 18:27:42 +02:00
Corey Wharton 86bfc489f4 scripts: Replace hard-coded subsystem list with __subsystem annotations.
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-03-11 17:13:39 +02:00
Henrik Brix Andersen db611e6781 drivers: pwm: add support for inverted PWM signals
Add support for requesting an inverted PWM pulse (active-low) when
setting up the period and pulse width of a PWM pin. This is useful
when driving external, active-low circuitry (e.g. an LED) with a PWM
signal.

All in-tree PWM drivers is updated to match the new API signature, but
no driver support for inverted PWM signals is added yet.

All in-tree PWM consumers are updated to pass a flags value of 0
(0 meaning default, which is normal PWM polarity).

Fixes #21384.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Tomasz Bursztyka 05aa6921ba include/drivers: Removing legacy leftovers in PWM header
These 2 macros are not used anymore anywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-08-23 23:51:28 +02:00
Peter Bigot 6554a5e5b6 include: rearrange for standard use of extern "C" in various headers
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

The inclusion of the generated syscall files is placed outside the
extern "C" block as the generated file has its own extern "C" block.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-13 18:00:31 +02:00
Anas Nashif 5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00