Commit graph

42249 commits

Author SHA1 Message Date
Andrei Emeltchenko
59659ce4da drivers/nble: Re-enable advertising on disconnect
Move re-enabling logic to the NBLE stack.

Change-Id: I1b895aa952a241dc41e2fc9faa2794a8c2c2d2db
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-21 09:21:24 +00:00
Andrei Emeltchenko
a881ef8c4d drivers/nble: Move auth callback to nble struct
Keep authentication callback structure inside nble.

Change-Id: I5a577e4c093c4bbfece0d2cac3de94cff78349d2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-21 09:21:10 +00:00
Andrei Emeltchenko
e0c143233e drivers/nble: Move local bdaddr to nble structure
Create nble structure and move bdaddr there.

Change-Id: I4fb920364c03ba5d10931efa7673b1cb433bcd5c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-21 09:21:01 +00:00
Andrei Emeltchenko
a896e00ccf drivers/nble: Implement common response
Implement on_nble_common_rsp() RPC event.

Change-Id: I066a3d5a698dc038903a202595a0d197456a65d8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-21 09:20:50 +00:00
Anas Nashif
2f20933cad sensors: Convert return codes to errno.h
Change-Id: Ifdcc26c903e70c4f72ac94e0511cc3f01fa6dc6e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-21 09:16:40 +00:00
Johan Hedberg
032be935c0 Bluetooth: Kconfig: Add missing BLUETOOTH_STACK_HCI dependencies
These options shouldn't show up unless the HCI stack has been
selected.

Change-Id: I0f07c56f899ec833bec64ff062e1456341845027
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-19 15:55:50 +00:00
L.S. Cook
5e46cfd2d0 doc: Edit microkerenel_mailboxes for ReST syntax, content
flow, readability

Add some :dfn: syntax, spelling fixes, and minor edits

Change-Id: Ia37406ccccde677150dbff5da95d53c3917b1efb
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 11:05:25 +00:00
Peter Mitsis
7f14e706ec printf: Limit width modifier to [0..MAXFLD]
When capping the the absolute value of the width modifier in printf(),
it must first be cast to an 'unsigned'. This stems from the fact that
in two's complement, not all negative numbers have a positive counterpart.

Change-Id: I3e6f92f68ab1b8dab48bbf883c5ad4b078a93f87
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-03-19 11:03:54 +00:00
Vinicius Costa Gomes
de5dd2f0ff k64f: Fix indentation in the K64F pinmux driver
Change-Id: Ied78a3168b134dfdfce21ad25b530bb87db283b0
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-19 10:44:39 +00:00
Vinicius Costa Gomes
facfc59464 pinmux: Convert return codes to errno.h
Before moving pinmux related code to 'drivers/pinmux' fix their return
codes to be consistent with the rest of the API.

Change-Id: Ie84f64e93745d44bef8b9d2119f6a05cdc8cb8c4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-19 10:44:38 +00:00
L.S. Cook
fb4b8d2933 doc: Edit nanokernel_synchronization section
Fix for imperative API descriptions, note needs work (see comment).

Change-Id: I300ff03ee5c6b6cb50cf2b1614f22940a0b10213
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 10:40:53 +00:00
Murtaza Alexandru
2e31980e81 sensor: add full-scale attribute
Add enum value for full-scale attribute, so we can implement runtime
alteration if needed.

Change-Id: Ib71b4cac6e8841e3f082c07ee75939d1c51209b4
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 10:40:52 +00:00
Murtaza Alexandru
9d4c6507e4 sensor: add magnetometer generic polling sample
Add generic sample that continuosly read magnetometer data from
the first device that finds available within a predefined list.

Change-Id: Ia9b5fd434f462fb4704896852415f90eb633e1eb
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 10:40:14 +00:00
L.S. Cook
a1b9254697 doc: Edit nanokernel_timers for proper ReST syntax, grammar, etc.
Minor edits to clarify wording, readability of rendered documentation

Change-Id: I4144cfb8e191234d5fb3b6aa0fc3324b85cd286a
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 10:40:13 +00:00
L.S. Cook
1be71d97ed doc: Edit nanokernel_fibers for doc structure with rst, grammar
To enhance readability, add bold, lists in sentence form (as per
the style guide) and other parallel content from microkernels section.

Change-Id: Ida989ec7187bf7a035803644b5cc710571b66e3e
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 10:40:13 +00:00
Murtaza Alexandru
3b6d4cb9cf sensor: add driver for BMC150 magnetometer
Add device driver for the magnetometer part of BMC150 sensor.

Datasheet:
  https://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf

Change-Id: Id7cbfd872a0a37e20afb03a8155c1f6851710a16
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia
ef65f155c2 sensor: add driver for HDC1008 temperature and humidity sensor
Add driver for the HDC1008 temperature and relative humidity
sensor.

Datasheet:
	http://www.ti.com/lit/ds/symlink/hdc1008.pdf

Origin: Original
Change-Id: I63cb4cdd94120b80d0d6f3205da073f0817c4f17
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia
653874c73f sensor: add driver for SHT3xD sensors
Add device driver for the SHT3xD temperature and humidity sensors.

Datasheets:
	https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_SHT3x_Datasheet_digital.pdf
	https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS_V1.pdf

Origin: Original
Change-Id: I9cda2f1bc7172e93ce34fde63c6febf0b8b28289
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia
babb62a0ed sensor: add isl29035 light sensor
Add device driver for the isl29035 ambient light and infrared
light sensor.

Datasheet:
    http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29035.pdf

Origin: Original
Change-Id: Ib285f8def32d78d50f1d92998dca5f55d6603ca5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 10:38:39 +00:00
Daniel Leung
fa868a7846 drivers: bluetooth: nble: restructures Bluetooth Kconfig options
This moves both the Bluetooth HCI and NBLE drivers under
"Bluetooth Drivers" category. This also adds a selection for
choosing Bluetooth stacks as the bulk of both HCI and NBLE stacks
cannot be compiled together.

Note that this does not move the source files. That should be
done in a separate change.

Change-Id: I32fa7097ada0fdc52bcc745adb78c7273f4023c6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-19 00:23:11 +00:00
L.S. Cook
0b04465a8c doc: Edit microkernel_task_irqs.rst for consistency in styling.
Added some rst styling, minor punctuation fixes, and doc flow edits.

Change-Id: I1f4bd5dd1ac788b12fc498d1ad3297260f05e7fa
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 00:21:46 +00:00
L.S. Cook
e017d92dfe doc: Edit microkernel_pipes for ReST syntax, readability, grammar
Add :dfn: and other .rst kinds of syntax and parallel format to
other documents in the microkernel sections. Corrected a few
typos.

Change-Id: I8e0d36a2f9091f551674fdf0518bb66453ada49b
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-19 00:19:44 +00:00
Bogdan Davidoaia
fe9c947fee sensor: add driver for BMA280 accelerometer
Add device driver for the BMA280 I2C-based triaxial accelerometer
sensor, which supports reading data from the accel-x, accel-y, accel-z
and temperature channels. The driver also has support for data-ready
and any-motion triggers.

Datasheet:
	http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMA280-DS000-11_published.pdf

Origin: Original
Change-Id: Iff7246d7dd4a9358ec7a71e8ffbcfcccd49e393c
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
2016-03-19 00:13:18 +00:00
Andre Guedes
ace49af6b0 uart: Enable QMSI driver for Quark D2000
This patch fixes the QMSI UART shim driver so we are able to use it in
Quark D2000 based platforms. Differently from Quark SE, the peripheral
clock gate bit (CLK_PERIPH_CLK) is not enabled by default in Quark
D2000. We have to explicitly set this bit in order to properly initialize
the device.

Since this drivers is now properly working on Quark D2000, this patch
also sets the QMSI driver default options in arch/x86/soc/quark_d2000/
Kconfig.

Change-Id: I817b7703554be162ac628dcd8d3d07512b9eb3f5
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-18 23:33:06 +00:00
Andre Guedes
3172fca3a0 drivers: qmsi: Fix gpio, i2c and wdt for D2000
This patch fixes the gpio, i2c and watchdog shim drivers so they set the
CLK_PERIPH_CLK bit during driver initialization. Differently from Quark
SE, the peripheral clock gate bit (CLK_PERIPH_CLK) is not enabled by
default in Quark D2000. We have to explicitly set this bit in order to
properly initialize the device.

This issue has been masked so far because the CLK_PERIPH_CLK bit is set
when UART NS16550 driver is enabled. The UART NS16550 driver is enabled
by default for Quark D2000 so gpio, i2c and watchdog sample apps were
working just fine. But if we disable the NS16550 driver, these samples
applications stop working.

The remaining shim drivers already set the CLK_PERIPH_CLK bit during
initialization so there is no need to fix them.

Change-Id: I3f658da564f87e9d52092ce7aac423c7b3e0c890
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-18 23:31:45 +00:00
L.S. Cook
c6be6f271c doc: Edit nanokernel_tasks for consistency and ReST :dfn: syntax
Corrected an "is is" and other minor punctuation + grammatical edits.

Change-Id: I26f51809215a8ac77a20bc9d424e6a806e29ee50
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-03-18 22:29:58 +00:00
d0u9
6cd159674a zephyr-env.sh: Add a note to indicate the required version of zsh
For zsh users, to successfully source this environment set up script,
the version of zsh need to be 5.0.6 or above. Users can download the
newest zsh at http://zsh.sourceforge.net/Arc/source.html, and then
install it manually.

Change-Id: I1877b4030cf8688bce6b2483c302f957f4a5506f
Signed-off-by: d0u9 <d0u9.su@outlook.com>
2016-03-18 22:01:19 +00:00
Maciek Borzecki
47d88b25ec samples/button: button input example
An example of button driver.

Change-Id: I8af860058166d7ca5653f50ff585bc9784008f78
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:59:23 +00:00
Maciek Borzecki
624c9e339a watchdog/iwdg_stm32: add driver for STM32 Independent Watchdog (IWDG)
Add a driver for Independent Watchdog (IWDG) commonly found in STM32
MCUs. The driver has been tested on STM32F1 family MCU.

Change-Id: Idc6ac35990e46901a206b4af0ce3767eb4875de9
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:57:26 +00:00
Maciek Borzecki
7c5cb7b85e soc/stm32f1/gpio: implement MCU specific GPIO input interrupt integration
Add necessary integration for supporting interrupts on GPIO input pins
for STM32F1 line of MCUs.

Change-Id: I0526a85cc3fdb96891c93ba4840ef27d613ab31b
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:57:16 +00:00
Maciek Borzecki
dd583518ee soc/stm32f1: AFIO registers mapping
Add mapping of Alternate Function I/O (AFIO) registers for STM32F1 MCU.

Change-Id: Id3e12290d6869c1f0506549f21407b3cd80d0a64
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:55:36 +00:00
Maciek Borzecki
1524e713c5 gpio/stm32: GPIO input with interrupts
Add support for interrupts for input GPIO pins on STM32 MCUs. The SoC
support code is expected to provide an implementation of
stm32_gpio_enable_int() call.

Change-Id: I61bae54b8e044be4d7d8eb60c0c67b71f8c59553
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:55:21 +00:00
Maciek Borzecki
33907674dd interupt_controller/stm32_exti: driver for STM32 EXTI controller
Introcuce a driver for External Interrupt/Event Controller (EXTI) found
on STM32 MCUs.

Change-Id: Ib206521fcc51b5dfaaf5dea9d436f8304f3a36be
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:53:06 +00:00
Maciek Borzecki
0cd7ff8d4b serial/stm32: add support for IRQ APIs
The patch extends STM32 serial port driver with support for IRQ API of
the common UART port driver API.

Change-Id: If105e8528ea4ed4181cc4af0c97c24aa874e69e0
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:52:00 +00:00
Maciek Borzecki
e8d16b2985 soc/stm32f1: add IRQ numbers listing
Add a list of symbolic constants for IRQ lines available on
STM32F1 line of MCUs.

Change-Id: Iebf1847719c0db31cf852529fe5876e3cabbfe52
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:33 +00:00
Maciek Borzecki
4ee4a6abad boards/nucleo_f103rb: add new board
Add configuration for Nucleo-64 F103RB board. By default, the UART
console is forwarded to USART2, available on STLink V2-1 USB
connector. All GPIO ports available on the connecot headers are
enabled.

Change-Id: I266170d1288ef27f668410c5737c46cdf716e137
Origin: Original
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:32 +00:00
Maciek Borzecki
291415a6c4 samples/drivers/disco: add 'disco' sample program
Add a sample program for blinking with GPIO connected LEDs. The sample
program by assumes the use of Nucleo-64 F103RB development board as the
target and will need to be updated for other platforms. The intention is
that the code will serve as an example of how to use GPIOs in one's
code.

Change-Id: Ia190a7ad5b07181731c9f502d87bd0ef0ba1abde
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:32 +00:00
Maciek Borzecki
84cf5a8b0b boards/stm32_mini_a15: add new board
Introduce configuration for STM32 MINI A15 embedded development
board. The board has a STM32F103VET6 MCU on board. The MCU has 64KB of
SRAM and 512KB of flash.

The board has the following peripherals:
- RS232 port on DB9 connector, connecting to USART1, pin mapping:
  - PA9-US1-TX
  - PA10-US1-RX
- a LED diode (U2) connected to pin PB5
- micro SD card connector with pin mapping:
  - PC8-SDIO-D0
  - PC9-SDIO-D1
  - PC10-SDIO-D2
  - PC11-SDIO-D3
  - PC12-SDIO-CK
  - PD2-SDIO-CMD
- on board SPI flash AT45DB161D-SU, pin mapping;
  - PA4-SPI1-NSS
  - PA5-SPI1-SCK
  - PA6-SPI1-MISO
  - PA7-SPI1-MOSI
- button (K1), connecting PB15 to GND
- 40-pin header connector XS5

Change-Id: Ia378b105abb25fb589a100185ea96512a5f98cf3
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:31 +00:00
Maciek Borzecki
5a73ca6809 serial/stm32: add driver for STM32 UART
Add driver for U(S)ART ports on STM32 MCUs. The driver implements basic
RX/TX functionality. Data transmission is implemented using polling. The
driver configures the port to use 8bit data transmission, 1 stop bit, no
parity control.

The driver exposes a public uart driver API and registers a single UART
device 'UART_0'. The device binds to USART1 peripheral and performs
required pinmux and clock control configuration. The device can be
initialized at the PRIMARY level, with default device priority.

The driver has been verified to work with a sample Hello World
application on a STM32F103 series MCU.

Change-Id: Iae103fcd8d2fb0a6c173cf141a68e17791255aab
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:20:28 +01:00
Maciek Borzecki
a8700114b3 soc/stm32f1/pinmux: implement STM32 pinmux integration
Add necessary integration code enabling use of common STM32 pinmux
driver.

The alternate function listing currently consists of USART1 pins
only. The listing should be updated when support for more devices is
added.

Change-Id: Ic65aeea9df9aaea7636ecdd6996f56e6ef59dc2f
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
3642f9d6a3 soc/stm32f1/gpio: implement GPIO support
Add functions required for integration with common STM32 GPIO driver.

Change-Id: Ic6637e991f5c0cf659f3b927ed47ef482b13b64f
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
6461e70b72 gpio/stm32: add common driver for STM32 GPIO
The driver implements a GPIO device interface for STM32 MCUs. Each SoC
must provide implementation of the follwoing calls:
stm32_gpio_flags_to_conf(), stm32_gpio_configure(),
stm32_gpio_set(). Consult gpio_stm32.h header for details on semantics
of these calls.

The driver registers 5 devices, each corresponding to a single GPIO
port. The users can then access individual pins by using values
0-15.

Change-Id: Id236b5b75c9dd091018a50a7be3501c8591cd551
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
e53390f02d pinmux/stm32: add common driver for STM32 pinmux
Add a common driver for pin control subsystem in STM32 MCU series. The
driver allows for selection of pin's function without the ability of pin
remapping.

The driver implements a pinmux driver API, with custom `func` and `pin`
encoding in API calls. The caller is expected to use STM32PIN() helper
macro for encoding port/pin numbers or using one of the provided
STM32_PIN_* defines.

The common driver requires SoC specific support to be implemented. The
SoC code must implement these calls: stm32_get_pin_config(),
stm32_get_port_clock(), stm32_pin_configure(). Consult pinmux_stm32.h
header for detailn on semantics of these calls.

The driver also requires board level integration. The call
stm32_board_get_pinconf() is expected to privide pin function
assignments for the target board.

Whenever an IO pin is being enabled, the driver will automatically
enable the clock for corresponding port. The driver does not implement
disabling of port's clock as this has potentially disruptive, as such
such operation should be done explicitly in the code.

The pin control module needs to be initialized before any other modules,
but after clock_control. For this reason, the driver is initialized by
default at PRIMARY level, with priority set to 2. The priority can be
changed through configuration.

Change-Id: I8cb746d0f3cad72cd50b3355fe6d93a9f469be25
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Andrei Emeltchenko
f3ebc5bf97 drivers/nble: Check firmware version for compatibility
Current design of Nordic RPC requires strict firmware compatibility,
add check indicating if firmware is incompatible. At the moment we
allow to continue since something may work :).

Change-Id: Ie67d4a6509e53553ae6c41a2c8d2593ab20bdcfb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:22:13 +00:00
Andrei Emeltchenko
eb1e41d1e7 drivers/nble: Update valid advertise parameters
Allow to use Non Resolvable Private Address (NRPA) in advertisement,
following NBLE change.

Change-Id: I9491cfcd2e981237c99e55773a8beaddaee8b730
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:20:38 +00:00
Andrei Emeltchenko
4961833fd4 drivers/nble: Update RPC to Nordic BLE firmware
Update firmware version to 0317. Changes are mostly related to
advertising.

Change-Id: I3a438ad38e3c892e354f7ea59b99739153957f19
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:19:57 +00:00
Mariusz Skamra
f84bf33aca Bluetooth: tester: Return BTP error if requested unknown attr ID
With this patch BTP error will be returned if attribute with
requested ID don't exist in GATT attribute database.

Change-Id: Ic6125c6359e75a80fb9a51b6a527ee0a98628e6d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-18 15:19:18 +00:00
Anas Nashif
cee0eb5816 watchdog: use instance name instead of variable
Do not depend on CONFIG_WDT_DW_DRV_NAME

Change-Id: Ib16389b2c64fdaa154f451a5c38bd4a25a0dfba5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-18 14:12:42 +00:00
Jukka Rissanen
8328fd5cd0 net: coap: Debug print was missing a parameter
Debug print was missing a parameter so it printed some garbage
value. Changed the printf not to try to print extra value.

Change-Id: I265c0bc8d703c8b40af6e25f5879a3d3a6fddcdf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-18 11:35:00 +00:00
Daniel Leung
2735e1fa82 adc: move each driver kconfig options into submenus
This moves the kconfig options for each drivers into their own
submenus. This makes menuconfig easier to navigate.

Change-Id: I2bdc8c3b61e424248ffb65385a7eabc797d89684
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00