Commit graph

44 commits

Author SHA1 Message Date
Anas Nashif 429c2a4d9d kconfig: fix help syntax and add spaces
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-13 17:43:28 -06:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
David B. Kinder 93e4d7258d spell: fix Kconfig help typos: /boards /drivers
Fix misspellings in Kconfig help text

Change-Id: I3ae28a5d23d8e266612114bc0eb8a6e158129dc7
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-21 21:31:30 +00:00
Kumar Gala cc334c7273 Convert remaining code to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.  This handles the remaining includes and kernel, plus
touching up various points that we skipped because of include
dependancies.  We also convert the PRI printf formatters in the arch
code over to normal formatters.

Jira: ZEP-2051

Change-Id: Iecbb12601a3ee4ea936fd7ddea37788a645b08b0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 11:38:23 -05:00
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Jithu Joseph d625c2bb4c grove: fix variable type mismatch
These were reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: I10d04c2949ad2a390d4c1159d2342c73108a58b7
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-11 00:14:15 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Bogdan Davidoaia 30162aedf1 sensor: remove sensor value type
Remove the type field from the sensor value structure. All values will
have the type previously defined by SENSOR_VALUE_TYPE_INT_PLUS_MICRO.

This simplifies the interface, as apps will know what value type to
expect. Apps that prefer to use double values can optain them using the
sensor_value_to_double function.

Change-Id: I3588d74258030eb16c3f89d8eead13cca4606b18
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-15 01:09:33 +00:00
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00
Bogdan Davidoaia de4727ba3f sensor: update drivers to not return double values
Update drivers to return INT_PLUS_MICRO values instead of doubles.

This hides the fact that the drivers use floating point operations and
doesn't force the application to use them as well.

Change-Id: I14c6faecb35331c2fdbdab41bc624d751de984b8
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:11 +00:00
Flavio Santes b04cdcd6e6 drivers: Remove legacy nanokernel.h include
This commit replaces the nanokernel.h include by kernel.h.

Change-Id: Ib42fbf2d9f77a73c0831f569b3dbbfb342ea2e1d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-04 14:59:37 -06:00
Anas Nashif 36e8fc5c05 drivers: lcd: use unified kernel APIs
Change-Id: Ie0d6f6e22646b23883f6b940812f93bba1789828
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:21 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Marcus Shawcroft 989f216357 grove/light_sensor: Limit name space, add static.
Change-Id: I4defcdee69a20ff7a9a5120f96a13ecc747ea5d1
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 10:55:46 +00:00
Marcus Shawcroft cfc5345ac6 grove/light_sensor: Make driver_api structure const.
Change-Id: Ib06404fa80bdce797b2446ce13468193241e2f7a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 10:55:45 +00:00
Marcus Shawcroft d8d5cb172d grove/temperature_sensor: Limit name space, add static.
Change-Id: I81167e7363aaaebfcf861a60af0f9fca214d3dec
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 10:55:45 +00:00
Marcus Shawcroft dfaeb79996 grove/temperature_sensor: Make driver_api structure const.
Change-Id: I7f7223bed0f5be955000bad0256bc29f5a89bc6b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 10:55:45 +00:00
Anas Nashif b152246a83 sensors: make grove sensors depend on CONFIG_SENSOR
The grove sensors use the sensor interface, so make them depend
on it just like the other sensors.

Change-Id: I9b62a3fa26f54dd683c65ca154c1af7c7c92772f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:32 +00:00
Marcus Shawcroft 0cb864cada grove/lcd: Limit name space, add static.
Change-Id: I1efc5def0a205964309e719f5a1d4e00ce154f12
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:03 +00:00
Anas Nashif da5e7d7fa0 grove: fixed log level kconfig variable
The variable is defined as SYS_LOG_GROVE_LEVEL in Kconfig..

Change-Id: I0f77336df2293694ece71f4f5fccb5283f6dc58c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-25 10:42:32 +00:00
Anas Nashif 2f042d65a0 grove lcd: cleanup includes
Change-Id: If9c7b505c1233c8e86bc3142ac803dc1a5ac5272
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 00:24:34 +00:00
Anas Nashif 33118f9212 sensor: grove: use global sensor init priority
Change-Id: Ie56ee7e4b267b4dc67026be4531834f550134969
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 20:53:29 +00:00
Marcus Shawcroft 6ccce59eac grove/lcd_rgb: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I7fdf091d6c2c838210a3ecd6011179be40f0931c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 08:05:50 -04:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Bogdan Davidoaia 2064f4a9cc grove: add temperature sensor
Add driver for the Grove Temperature Sensor which measures ambient
temperature.

Sensor reference page:
	http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor

Change-Id: I4f56224be5fa7a968749d5d4df8cb99a462c3c21
Origin: original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-12 12:11:04 +00:00
Bogdan Davidoaia 62c7a1338a grove: add light sensor
Add driver for the Grove Light Sensor which detects changes in ambient light.

Sensor reference page:
	http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor

Origin: Original
Change-Id: I88ae20cc9faa8ab8f274b0bd7a114db5c1a87a91
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-12 12:11:04 +00:00
Anas Nashif 9d8c332b21 i2c: use I2C_X nameing instead of I2CX
Other IOs use this format, so lets be consistent and use

I2C_0 instead of I2C0 and I2C_1 an instead of I2C1.

Change-Id: I591ab08e14bd533ef0fac38e596559da783863b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Daniel Leung a2ff6eaf1c grove/lcd_rgb: assign magic number to driver_api
Since device_get_binding() will not return any reference to
a driver instance if port->driver_api is NULL and grove_lcd
does not have any API struct, just populate it with some
magic number so grove_lcd can be referenced.

Change-Id: I16bdd13dfb49c54b5bdff34c4a4124af229aa20c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:07:34 +00:00
Genaro Saucedo Tejada d1e9181fd4 sys_log: Grove driver update to new logging API
Replaces old DBG calls by new SYS_LOG_... ones, likewise updates the
grove/Kconfig file to include new per-level logging control.

Change-Id: I638ffa915a760b4f188c1bfa2dc68e63cbf7e624
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-03-18 00:01:21 +00:00
Andre Guedes 136d171588 drivers: Replace DEV_NOT_CONFIG by -EPERM
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Benjamin Walsh d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 0303d8cab9 device: rename SYS_DEFINE_DEVICE()
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.

Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh bfc27206b2 device: rename DECLARE_DEVICE_INIT_CONFIG()
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.

Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Anas Nashif 8704792c45 grove_lcd: this display is not a feature of the board
The LCD display is an add-on, not a feature of the platform or the
board.
Set the defaults and remove the definition from Galileo Kconfig.

Change-Id: Ic319cd765d2dc1fe08cc65615680821fe9bc6a83
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:06 -05:00
Daniel Leung b90cb66afd grove/lcd: add an option to specify I2C master
Add an option to specify to which I2C master the Grove LCD
is connected, instead of already using the i2c_dw driver
port #0.

Change-Id: I4e61ef8e31c75ae912e2d16f8939369c0b8bbc2c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:06 -05:00
Dmitriy Korovkin dcda679c72 gpio, pwm, rgb lcd: Replace polling i2c requests
Now that i2c_transfer/i2c_read/i2c_write are fully synchronous, no need
to use the polling based function.

Change-Id: Ib578cf4a6d72ad0817e1aaeebc7e4dab9f9d293f
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:57 -05:00
Daniel Leung 960229468a grove/lcd: fix init level due to dependence on system clock
The Grove LCD driver requires running clock for delay. Since the clock
is only initialized in NANOKERNEL, so change the LCD driver init level
so that it starts after clock is initialized.

Change-Id: I6a2cadac1b34f95557f99c78615b1bd4aee541f5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:56 -05:00
Dmitriy Korovkin 57f2741e4f init: Implement fine-grained initialization policy
Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Dan Kalowsky 1c0da55154 grove: KConfig cleanup
Adding in dependency of GROVE_DEBUG to the GROVE configuration
option being set

Change-Id: I4108e619254ca3cde2b96de595e1b8300fe6a752
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:36 -05:00
Dan Kalowsky da67b29569 checkpatch: warning - block_comment_style
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Javier B Perez Hernandez 7ea76b96fd Change new files from BSD-3 licenses to Apache 2.0
Change the new files from Intel in BSD-3 to Apache 2.0

Change-Id: Ica4b455e9cb8134889f2a88e2d96094ce7093734
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:24:30 -05:00
Dan Kalowsky 61d87f57f8 grove-lcd: import of Grove LCD I2C controller
Initial import of the Grove LCD I2C controller.  Data sheet can
be found at:
http://www.seeedstudio.com/wiki/images/0/03/JHD1214Y_YG_1.0.pdf

[DL: Updated command sequence according to datasheet.]

Change-Id: Id1b491f8dce346769dc42c41fac0ea3aabe3950a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:29 -05:00