zephyr/samples/basic/disco
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
..
src license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
Makefile samples: tests: remove obsolete KERNEL_TYPE and kernel variables 2016-11-04 15:47:25 -04:00
README.rst samples: doc: remove 'make pristine', it is not needed 2017-01-16 18:13:03 -05:00
prj.conf samples/basic/disco: Add support for Nucleo F401RE and A101 2016-12-25 19:16:37 +00:00
testcase.ini samples/basic/disco: Add support for Nucleo F401RE and A101 2016-12-25 19:16:37 +00:00

README.rst

Disco demo
##########

Overview
========

A simple 'disco' demo. The demo assumes that 2 LEDs are connected to
GPIO outputs of the MCU/board.


Wiring
======

The code may need some work before running on another board: set PORT,
LED1 and LED2 according to the board's GPIO configuration.

Nucleo-64 F103RB/F401RE boards
------------------------------

Connect two LEDs to PB5 and PB8 pins. PB5 is mapped to the
Arduino's D4 pin and PB8 to Arduino's D15. For more details about
these boards see:

- https://developer.mbed.org/platforms/ST-Nucleo-F103RB/
- https://developer.mbed.org/platforms/ST-Nucleo-F401RE/

Arduino 101 (x86)
-----------------

Connect two LEDs to D4 (IO4) and D7 (IO7) pins. The schematics for the Arduino
101 board is available at:

https://www.arduino.cc/en/uploads/Main/Arduino101-REV4Schematic.pdf

For Arduino 101's pinmux mapping in Zephyr, see: :file:`boards/x86/arduino_101/pinmux.c`

Modify the src/main.c file and set:

.. code-block:: c

   #define PORT	CONFIG_GPIO_QMSI_0_NAME
   /* GPIO_19 is Arduino's D4 */
   #define LED1	19
   /* GPIO_20 is Arduino's D7 */
   #define LED2	20

Building and Running
=====================

After startup, the program looks up a predefined GPIO device defined by 'PORT',
and configures pins 'LED1' and 'LED2' in output mode.  During each iteration of
the main loop, the state of GPIO lines will be changed so that one of the lines
is in high state, while the other is in low, thus switching the LEDs on and off
in an alternating pattern.

This project does not output to the serial console, but instead causes two LEDs
connected to the GPIO device to blink in an alternating pattern.

The sample can be found here: :file:`samples/basic/disco`.

Nucleo F103RB
-------------

.. code-block:: console

   $ make BOARD=nucleo_f103rb

Nucleo F401RE
-------------

.. code-block:: console

   $ make BOARD=nucleo_f401re

Arduino 101
------------

.. code-block:: console

   $ make BOARD=arduino_101