Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit a78c747

Browse files
committed
[docs] Add board support documentation for A101 and K64F
Removed the documentation for old arduino101_pins and k64f_pins modules. Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
1 parent 132ee43 commit a78c747

File tree

6 files changed

+183
-219
lines changed

6 files changed

+183
-219
lines changed

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Board Support
5353
-------------
5454
[Board](./board.md)
5555

56-
[Arduino 101](./a101_pins.md)
56+
[Arduino 101](./boards/arduino_101.md)
5757

58-
[FRDM-K64F](./k64f_pins.md)
58+
[FRDM-K64F](./boards/frdm_k64f.md)
5959

6060
Devices
6161
-------

docs/a101_pins.md

Lines changed: 0 additions & 102 deletions
This file was deleted.

docs/aio.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ API Documentation
5858

5959
The `init` object lets you set the pin number. You can either use a raw
6060
number for your device or use the board support module such as
61-
[Arduino 101](./a101_pins.md) or [K64F](./k64f_pins.md) to specify a named pin.
61+
[Arduino 101](./boards/arduino_101.md) or [K64F](./boards/frdm_k64f.md) to
62+
specify a named pin.
6263

6364
Use the AIOPin object returned to read values from the pin.
6465

docs/boards/arduino_101.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ZJS Board Support for Arduino 101
2+
=================================
3+
4+
* [Introduction](#introduction)
5+
* [Available Pins](#available-pins)
6+
* [Sample Apps](#sample-apps)
7+
8+
Introduction
9+
------------
10+
The Arduino 101 is pretty much fully supported by ZJS. Two exceptions are that
11+
certain GPIOs that are accessible only from the ARC core are not available, and
12+
there are analog comparator pins that are not supported.
13+
14+
For multi-board support, you can use the [board module](../board.md) to detect
15+
whether you're running on the Arduino 101 with `board.name === 'arduino_101'`.
16+
17+
Available Pins
18+
--------------
19+
### GPIO
20+
The Arduino 101 has 14 general purpose I/O pins exposed, IO0 - IO13.
21+
22+
IO0 and IO1 are used for serial communication and we haven't yet looked into
23+
disabling that to provide them as extra GPIO pins, so these are not available.
24+
25+
IO6 and IO9 are defined but not actually usable as GPIOs currently. They can
26+
only be accessed from the ARC side which we do not support.
27+
28+
IO3 and IO5 can be used as GPIO inputs but not outputs currently.
29+
30+
The rest (IO2, IO4, IO7, IO8, and IO10 - IO13) can all be used as either GPIO
31+
inputs or outputs. *FIXME: However, at the time of this writing IO8, IO10, and
32+
IO11 do not seem to be working; they used to.*
33+
34+
There are different ways to refer to a pin like IO3. The easiest way is the
35+
string 'IO3', but you can also use the string '3' or number 3, and finally you
36+
can use the full pin specification 'GPIO_0.17', but this requires you to look
37+
up the mapping between logical pins and GPIO numbers. The only way we know to do
38+
this is consulting Zephyr's `boards/x86/arduino_101/pinmux.c` file. The Arduino
39+
101 only has one GPIO controller so the device is always 'GPIO_0' for full pin
40+
specifications like this. But if you use the friendly forms, you don't need to
41+
worry about that.
42+
43+
Note, SPI bus support uses IO10 - IO13 so when that is enabled, those pins are
44+
not available. The flash filesystem uses SPI, so these GPIOs are not available
45+
when you use ashell or filesystem APIs.
46+
47+
### LEDs
48+
The Arduino 101 has three onboard LEDs that you can access as additional GPIO
49+
outputs.
50+
51+
LED0 controls an onboard red fault LED. It is active *low*.
52+
53+
LED1 controls an onboard green LED. It is active *low*.
54+
55+
LED2 controls another onboard green LED. It is active high, and it is an alias
56+
for IO13, so in other words, LED0 displays the current state of IO13. So don't
57+
try to use both names.
58+
59+
Note, if SPI is enabled this reconfigures the GPIO that controls LED2 and it
60+
will not be available. The flash filesystem uses SPI, so LED2 is not available
61+
when you use ashell or filesystem APIs.
62+
63+
You can refer to the pins for these LEDs with the strings 'LED0', 'LED1', and
64+
'LED2'.
65+
66+
### AIO
67+
The Arduino 101 has six analog input pins, A0 - A5.
68+
69+
You can refer to these pins with strings 'A0' to 'A5', 'AD0' to 'AD5', numbers
70+
0 to 5, strings '0' to '5', or full pin specification like 'ADC_0.10' but you
71+
will have to look up the mapping in the Zephyr `pinmux.c` file. There is only
72+
one analog input controller, ADC_0.
73+
74+
### PWM
75+
The Arduino 101 has four pins that can be used as PWM outputs. As usual on
76+
Arduino, these pins are marked on the board by a ~ (tilde) symbol next to the
77+
pins, namely IO3, IO5, IO6, and IO9.
78+
79+
You can refer to these pins with strings 'PWM0' to 'PWM3', numbers 0 to 3,
80+
strings '0' to '3', with the IO pin names 'IO3', 'IO5', 'IO6', and 'IO9', or
81+
full pin specification 'PWM_0.0' to 'PWM_0.3'. There is only one PWM
82+
controller, PWM_0.
83+
84+
Sample Apps
85+
-----------
86+
* [GPIO Inputs test](../../samples/tests/GPIO-Inputs.js)
87+
* [GPIO Outputs test](../../samples/tests/GPIO-Outputs.js)
88+
* [AIO sample](../../samples/AIO.js)
89+
* [PWM sample](../../samples/PWM.js)

docs/boards/frdm_k64f.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ZJS Board Support for FRDM-K64F
2+
===============================
3+
4+
* [Introduction](#introduction)
5+
* [Available Pins](#available-pins)
6+
* [Sample Apps](#sample-apps)
7+
8+
Introduction
9+
------------
10+
The FRDM-K64F is pretty well supported by ZJS. This page lists the available
11+
pins and how to refer to them in ZJS.
12+
13+
Available Pins
14+
--------------
15+
It will be helpful to refer to the two diagrams
16+
[here](https://os.mbed.com/platforms/FRDM-K64F/#component-pinout)
17+
when working with the K64F.
18+
19+
### GPIO Pins
20+
The FRDM-K64F has 16 general purpose I/O pins, D0 - D15.
21+
22+
If you look at the diagrams above, the pin D0 in the bottom right corner is
23+
also labeled PTC16. This means it's pin 16 on the 'C' GPIO controller. The full
24+
pin specification for that pin is "GPIO_2.16" (2 because the controllers A-E are
25+
0-indexed, 0 to 4). All the other pins listed with a blue box of the format
26+
PTC16 can also be used as GPIOs. For example, the pins that can also be used as
27+
analog inputs (A0 - A5) also have GPIO names. (These work as GPIOs unless you
28+
have also included the [AIO module](../aio.md).)
29+
30+
You can refer to the pins D0 - D15 with strings "D0" to "D15", numbers 0 to 15,
31+
or strings "0" to "15". For the other pins, you need to use the full
32+
pin specification. *NOTE: we plan to add support for the "PTC16" style names
33+
directly to make this easier.*
34+
35+
### LEDs
36+
The FRDM-K64F has an onboard RGB LED which can be controlled through three
37+
different GPIO outputs for the red, green, and blue components.
38+
39+
LEDR controls the red portion, LEDG the green portion, and LEDB the blue
40+
portion. They are all active low. They can be referred to with "LEDR", "LEDG",
41+
and "LEDB" (or "LED0", "LED1", and "LED2") or their full pin specifications
42+
such as "GPIO_1.22" for red.
43+
44+
These can be treated like other GPIOs, but don't work as inputs.
45+
46+
### Switches
47+
The FRDM-K64F has three onboard switches labeled SW2, SW3, and RESET.
48+
49+
The SW2 switch can be used as a GPIO input. Refer to it with "SW2" or
50+
"GPIO_2.6". The SW3 switch is defined but does not seem to work currently. You
51+
would refer to it with "SW3" or "GPIO_0.4". The RESET switch cannot be used as
52+
an input.
53+
54+
These can be treated like other GPIOs, but don't work as outputs.
55+
56+
### AIO Pins
57+
The FRDM-K64F has six analog input pins, A0 - A5.
58+
59+
Pins A0 - A3 work and you can refer to them with "A0" to "A3" or their full
60+
pin specifications. Pins A4 and A5 do not work, because they apparently use
61+
hardware triggering which isn't supported by the Zephyr driver.
62+
63+
We have also defined A6 and A7 for ZJS. A6 refers to the pin labeled
64+
ADC1_SE18 in a blue label on the diagrams mentioned above, and A7 refers to the
65+
pin labeled DAC0_OUT. These also work as analog inputs.
66+
67+
All the analog pins report a 12-bit digital value, from 0 to 4095.
68+
69+
### PWM Pins
70+
*PWM support for K64F is not enabled yet, but when it is the pins should be
71+
as follows.*
72+
73+
The FRDM-K64F has twelve pins that can be used as PWM output. For ZJS purposes,
74+
we have named them PWM0 - PWM11. These correspond to the purple labels on the
75+
diagrams mentioned above. We've numbered them sequentially starting with the
76+
bottom right (D3/PTA1) upward, and then with A4 and A5 as PWM10 and PWM11.
77+
78+
However, PWM4 (D8) will probably not work even when this feature is enabled,
79+
because the pin name in the schematics doesn't make it clear how it would be
80+
identified to the driver. (Too much detail: this is FTM3_FLT0.)
81+
82+
When support is added, you will be able to refer to these with names like
83+
"PWM0" but also "D3" and "A4" to identify them more clearly based on the
84+
diagram.
85+
86+
Sample Apps
87+
-----------
88+
* [GPIO Inputs test](../../samples/tests/GPIO-Inputs.js)
89+
* [GPIO Outputs test](../../samples/tests/GPIO-Outputs.js)
90+
* [AIO sample](../../samples/AIO.js)

0 commit comments

Comments
 (0)