Commit graph

14 commits

Author SHA1 Message Date
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
Andy Ross 32bb2395c2 timeout: Fix up API usage
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them.  Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:

+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
  values for equality (e.g. with K_FOREVER or K_NO_WAIT).

+ Adding a k_msleep() synonym for k_sleep() which can continue to take
  integral arguments as k_sleep() moves away to timeout arguments.

+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
  generate timeout arguments.

+ Removing the usage of K_NO_WAIT as the final argument to
  K_THREAD_DEFINE().  This is just a count of milliseconds and we need
  to use a zero.

This patch include no logic changes and should not affect generated
code at all.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Kumar Gala 5f3154ceff drivers: led: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 03:32:26 -05:00
Kumar Gala 4e772c4322 led: lp5562: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Anas Nashif a14ef3bf01 cleanup: include/: move led.h to drivers/led.h
move led.h to drivers/led.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
Anas Nashif 8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.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
Alexander Svensen 47d7146c7e Drivers: led: lp5562: Add delay when writing to enable register
According to datasheet, there needs to be a minimum of 488µs
between each write to Enable register

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
2019-06-17 16:23:16 -04:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Kumar Gala e1c6d11e66 drivers: led: lp5562: Fix use of logical or vs bitwise
We are or'ing bit flags so use '|' instead of '||'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-14 17:11:36 -05:00
Kumar Gala be0d753721 led: lp5562: Remove dts_fixup.h
Since the lp5562 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Patrik Flykt 8ff96b5a57 drivers: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Anas Nashif 7e61660c9c driver: led: move to new logger
Move drivers to new logger and change samples enabling logging in
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Johannes Hutter 41b7e7aa19 drivers: led: Add LED driver support for TI LP5562
Add support for TI LP5562 I2C 4-channel LED driver.

Supported blinking period: 1ms - 1000ms
Supported brightness value: 0% - 100%

This driver supports the entire currently available API.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
2018-08-16 06:28:53 -07:00