Skip to content

Commit 0e722c7

Browse files
committed
Reorganize directory structure to match typical Arduino library
1 parent f5b1f0c commit 0e722c7

File tree

118 files changed

+2435
-5778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2435
-5778
lines changed

.gitignore

Lines changed: 63 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,63 @@
1-
*.obj
2-
*.o
3-
*.d
4-
*.lib
5-
*.a
6-
*.elf
7-
*.err
8-
*.hex
9-
*.exe
10-
*.EXE
11-
*.map
12-
*.dep
13-
*.pdf
14-
*.PDF
15-
*.Hbp
16-
*.nav
17-
*.tps
18-
*.tws
19-
*.tmp
20-
*.log
21-
*.chm
22-
*.zip
23-
*.pdb
24-
*.ncb
25-
*.suo
26-
*.chw
27-
*.sfr
28-
*.user
29-
*.avrsuo
30-
*.Debug
31-
*.Release
32-
lint*.txt
33-
*.Miro
34-
*.bak
35-
*.qlc
36-
JLink*.*
37-
38-
qm/
39-
eclipse/
40-
test/
41-
test_ports/
42-
dbg/
43-
rel/
44-
spy/
45-
settings/
46-
.settings/
47-
targetConfigs/
48-
49-
Debug/
50-
Release/
51-
Spy/
52-
53-
lib/
54-
obj/
55-
output/
56-
57-
doxygen/html/
58-
lint/*.txt
59-
lint/MISRA_Exemplar_Suite_test/*.txt
60-
61-
.DS_Store
1+
*.obj
2+
*.o
3+
*.d
4+
*.lib
5+
*.a
6+
*.elf
7+
*.err
8+
*.hex
9+
*.exe
10+
*.EXE
11+
*.map
12+
*.dep
13+
*.pdf
14+
*.PDF
15+
*.Hbp
16+
*.nav
17+
*.tps
18+
*.tws
19+
*.tmp
20+
*.log
21+
*.chm
22+
*.zip
23+
*.pdb
24+
*.ncb
25+
*.suo
26+
*.chw
27+
*.sfr
28+
*.user
29+
*.avrsuo
30+
*.Debug
31+
*.Release
32+
lint*.txt
33+
*.Miro
34+
*.bak
35+
*.qlc
36+
JLink*.*
37+
38+
eclipse/
39+
test/
40+
test_ports/
41+
dbg/
42+
rel/
43+
spy/
44+
settings/
45+
.settings/
46+
targetConfigs/
47+
48+
Debug/
49+
Release/
50+
Spy/
51+
52+
lib/
53+
obj/
54+
output/
55+
56+
doxygen/html/
57+
lint/*.txt
58+
lint/MISRA_Exemplar_Suite_test/*.txt
59+
60+
.DS_Store
61+
.venv
62+
venv
63+
.pio

README.md

Lines changed: 84 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -10,114 +10,120 @@ Please refer to the companion webiste to this project at:
1010
https://www.state-machine.com/arduino
1111

1212
----
13-
# Software Installation
13+
# Provided Library and Examples
1414

15-
The QP adaptation for Arduino is distributed in a single ZIP
16-
archive `qp-<ver>_arduino-1.8.x.zip`, where `<ver>` stands for
17-
the version of the QP frameworks.
15+
This repository contains one external library for ARM Cortex-M based Arduinos:
1816

19-
You need to unzip the `qp-<ver>_arduino-1.8.x.zip` archive into your
20-
Arduino `<Sketchbook>` folder. To find out where your `<Sketchbook>` folder
21-
is, or to configure a different location for your `<Sketchbook>` folder,
22-
you need to open the Arduino IDE and select `File|Preferences` menu.
23-
The Sketchbook location will be shown at the top of the Preferences
24-
dialog box. Once you identify the `<Sketchbook>` folder, you simply unzip
25-
the whole `qp-<ver>_arduino-1.8.x.zip` archive to this folder.
17+
- `qp-arduino` -- QP/C++ framework for Arduinos based on ARM Cortex-M
2618

2719
----
28-
# Provided Libraries and Examples
20+
# Software Installation
2921

30-
The archive `qp-<ver>_arduino-1.8.x.zip` contains two external libraries
31-
for SAM-based Arduinos:
22+
The QP adaptation for Arduino may be used either with the [Arduino
23+
IDE](https://www.arduino.cc/en/software) or with
24+
[PlatformIO](https://platformio.org/install/cli).
3225

33-
- `qpcpp_arm-cm` -- QP/C++ framework for Arduinos based on ARM Cortex-M
34-
- `qpn_avr` -- QP-nano framework for Arduinos based on AVR
26+
## Download Library
3527

36-
> **NOTE:** `qpn_avr` is now obsolete. It is provided for backwards compatibility only!
28+
The QP adaptation for Arduino can be downloaded in a single zip archive or
29+
cloned to a local git repository.
3730

38-
----
39-
# Provided Tools
31+
### Zip File
4032

41-
The archive also contains the QM modeling tool for Windows
33+
https://github.com/QuantumLeaps/qp-arduino/archive/refs/heads/master.zip
4234

43-
- `qm` -- QM modeling tool for Windows 32/64-bit
35+
### Git
4436

45-
----
46-
# Directories and Files
37+
```bash
38+
git clone https://github.com/QuantumLeaps/qp-arduino.git
39+
```
40+
41+
## Arduino IDE
42+
43+
You need to unzip the zip archive, or clone the git repository, into your
44+
Arduino `<Sketchbook>` folder. To find out where your `<Sketchbook>` folder is,
45+
or to configure a different location for your `<Sketchbook>` folder, you need to
46+
open the Arduino IDE and select `File|Preferences` menu. The Sketchbook location
47+
will be shown at the top of the Preferences dialog box. Once you identify the
48+
`<Sketchbook>` folder, you simply unzip the whole zip archive, or clone the git
49+
repository, to this folder, renaming the folder qp-arduino if necessary.
4750

4851
After the installation, your Arduino `<Sketchbook>` folder should look
4952
as follows:
5053

51-
<Sketchbook>/ - your Arduino Sketchbook folder
52-
├───libraries/ - libraries folder
53-
│ ├───qpcpp_arm-cm/ - QP/C++ library for ARM Cortex-M based boards
54-
│ │ ├───examples/ - QP/C++ library examples
55-
│ │ │ ├───blinky-sam/ - Blinky example for SAM-Arduinos
56-
│ │ │ │ ├───blinky-sam.ino - Blinky code (generated by QM)
57-
│ │ │ │ └───blinky-sam.qm - Blinky model (for QM)
58-
│ │ │ ├───blinky2-sam/ - Blinky2 example for SAM-Arduinos
59-
│ │ │ │ ├───blinky2-sam.ino - Blinky2 code (generated by QM)
60-
│ │ │ │ └───blinky2-sam.qm - Blinky2 model (for QM)
61-
│ │ │ ├───blinky_bsp-sam/ - Blinky example with BSP for SAM
62-
│ │ │ │ ├───blinky_bsp-sam.ino - Blinky-BSP code (generated by QM)
63-
│ │ │ │ ├───blinky_bsp-sam.qm - Blinky-BSP model (for QM)
64-
│ │ │ │ ├───bsp.hpp - BSP header (generated by QM)
65-
│ │ │ │ └───bsp.cpp - BSP source (generated by QM)
66-
│ │ │ ├───blinky_bsp-teensy4/ - Blinky example with BSP for Teensy4
67-
│ │ │ │ ├───blinky_bsp-teensy4.ino - Blinky-BSP code (generated by QM)
68-
│ │ │ │ ├───blinky_bsp-teensy4.qm - Blinky-BSP model (for QM)
69-
│ │ │ │ ├───bsp.hpp - BSP header (generated by QM)
70-
│ │ │ │ └───bsp.cpp - BSP source (generated by QM)
71-
│ │ │ └───dpp_bsp-sam/ - DPP example with BSP for SAM
72-
│ │ │ ├───qview/ - DPP with QView demonstration
73-
│ │ │ ├───dpp_bsp-teensy4.ino - DPP-BSP code (generated by QM)
74-
│ │ │ ├───dpp_bsp-teensy4.qm - DPP-BSP model (for QM)
75-
│ │ │ ├───bsp.hpp - BSP header (generated by QM)
76-
│ │ │ └───bsp.cpp - BSP source (generated by QM)
77-
│ │ └───src/ - QP/C++ library source
78-
│ │
79-
│ └───qpn_avr/ - QP-nano library for AVR-based Arduinos
80-
│ ├───examples/ - QP-nano library examples
81-
│ │ ├───blinky/
82-
│ │ ├───blinky_bsp/
83-
│ │ ├───dpp/
84-
│ │ └───pelican/
85-
│ └───src/
86-
├───qm/ - QM modeling tool
87-
│ ├───bin/ - QM binaries (executable and DLLs)
88-
│ │ └───qm.exe - QM executable for Windows
89-
│ └───html/ - QM documentation
90-
│ └───index.html
91-
92-
├───QP-Arduino_GPL_Exception.txt - GPL exception for QP on Arduino
93-
└───README.md - this file
94-
95-
96-
> **NOTE:** The QP-Arduino archive contains QM for Windows only. But QM is also
97-
available for Linux and MacOS hosts. If you wish to work on those operating
98-
systems, you will need to install QM separately, as described at:
99-
https://www.state-machine.com/qm/gs.html
54+
```
55+
<Sketchbook>/
56+
└── libraries
57+
└── qp-arduino
58+
├── examples
59+
│   ├── blinky-sam
60+
│   ├── blinky2-sam
61+
│   ├── blinky_bsp-sam
62+
│   ├── blinky_bsp-teensy4
63+
│   ├── dpp_bsp-sam
64+
│   └── dpp_bsp-teensy4
65+
└── src
66+
└── qp-arduino
67+
```
68+
69+
## PlatformIO
70+
71+
Unzip the zip archive or clone the git repository into any folder you prefer.
72+
73+
----
74+
# Additional Tools
10075

76+
The QM modeling tool may be downloaded and installed from:
77+
78+
https://www.state-machine.com/products/qm
10179

10280
----
10381
# Working with the Examples
10482

83+
The intended way of working with the examples is to use the
84+
[QM modeling tool](https://www.state-machine.com/products/qm/) to modify
85+
the **models** (`.qm` files) and then to **generate code** from these
86+
models.
87+
88+
In this scenario, the Arduino IDE or PlatformIO are used only to build and
89+
upload the code to the Arduino board(s).
90+
91+
## Arduino IDE
92+
10593
Assumming that you have installed the QP library in your `<Sketchbook>`
10694
folder, the examples provided in each QP library show up in the Arduino
10795
IDE under the menu:
10896

10997
`File|Examples|Examples from Custom Libraries`
11098

111-
The intended way of working with the examples is to use the
112-
[QM modeling tool](https://www.state-machine.com/products/qm/) to modify
113-
the **models** (`.qm` files) and then to **generate code** from these
114-
models. In this scenario, the Arduino IDE is used only to build and
115-
upload the code to the Arduino board(s).
116-
11799
> **NOTE:** The preferences in the Arduino IDE should be set up to
118100
**Use external editor** so that the IDE will update the code each time
119101
it is re-generated by the QM modeling tool.
120102

103+
The Arduino IDE serial monitor may be used to observe the output of the dpp
104+
examples.
105+
106+
## PlatformIO
107+
108+
PlatformIO may be used either with its IDE or on the command line.
109+
110+
### Command Line
111+
112+
Navigate inside the qp-arduino directory where the platformio.ini file is contained.
113+
114+
Modify the platformio.ini file to compile the example that you prefer.
115+
116+
Compile and upload the example with a command like this:
117+
118+
```bash
119+
pio run -e teensy41 -t upload
120+
```
121+
122+
To use the serial monitor to observe the output of the dpp examples run:
123+
124+
```bash
125+
pio device monitor
126+
```
121127

122128
----
123129
## Example Documentation
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<session version="5.1.3">
3+
<item name="license"></item>
4+
<group name="locked"/>
5+
<group name="settings">
6+
<item name="tabs">1</item>
7+
<item name="windows">0</item>
8+
<item name="grid">3</item>
9+
<item name="backups">0</item>
10+
</group>
11+
<group name="windows">
12+
<item id="AOs::Blinky::SM">0,0,932,625,*</item>
13+
</group>
14+
<group name="search">
15+
<item name="options">2032128</item>
16+
<item name="replace">0</item>
17+
</group>
18+
<group name="vars"/>
19+
<group name="tools">
20+
<group name="tool">
21+
<item name="icon">0</item>
22+
<item name="title"></item>
23+
<item name="command"></item>
24+
<item name="args"></item>
25+
<item name="dir"></item>
26+
<item name="options">0</item>
27+
</group>
28+
<group name="tool">
29+
<item name="icon">0</item>
30+
<item name="title"></item>
31+
<item name="command"></item>
32+
<item name="args"></item>
33+
<item name="dir"></item>
34+
<item name="options">0</item>
35+
</group>
36+
<group name="tool">
37+
<item name="icon">0</item>
38+
<item name="title"></item>
39+
<item name="command"></item>
40+
<item name="args"></item>
41+
<item name="dir"></item>
42+
<item name="options">0</item>
43+
</group>
44+
<group name="tool">
45+
<item name="icon">0</item>
46+
<item name="title"></item>
47+
<item name="command"></item>
48+
<item name="args"></item>
49+
<item name="dir"></item>
50+
<item name="options">0</item>
51+
</group>
52+
<group name="tool">
53+
<item name="icon">0</item>
54+
<item name="title"></item>
55+
<item name="command"></item>
56+
<item name="args"></item>
57+
<item name="dir"></item>
58+
<item name="options">0</item>
59+
</group>
60+
</group>
61+
</session>

0 commit comments

Comments
 (0)