|
1 | | -# ArduinoCore-API |
| 1 | +# 📚 ArduinoCore-API for STM32duino |
2 | 2 |
|
3 | | -[](https://github.com/arduino/ArduinoCore-API/actions?workflow=Unit+Tests) |
4 | | -[](https://codecov.io/gh/arduino/ArduinoCore-API) |
5 | | -[](https://github.com/arduino/ArduinoCore-API/actions/workflows/spell-check.yml) |
| 3 | +Fork of [`arduino/ArduinoCore-API`](https://github.com/arduino/ArduinoCore-API) |
| 4 | +Designed to be used as a git submodule in [`stm32duino/Arduino_Core_STM32`](https://github.com/stm32duino/Arduino_Core_STM32) |
6 | 5 |
|
7 | | -This repository hosts the hardware independent layer of Arduino core. In other words it contains the abstract definition of the Arduino core API, consisting of hardware-independent header files that are then included and implemented by the various platform-specific cores. |
| 6 | +--- |
8 | 7 |
|
9 | | -Having a single place where the Arduino API is defined means that there is no longer a String implementation within every Arduino core (a String module within ArduinoCore-avr, a String module within ArduinoCore-samd, a String module within ArduinoCore-megaavr …) but rather one String implementation within ArduinoCore-API which all other cores utilise. This has the pleasant side effects that bugs fixed or features added within the ArduinoCore-API String implementation are automatically propagated to all cores utilizing ArduinoCore-API. |
| 8 | +## 🎯 Purpose |
10 | 9 |
|
11 | | -As of now, the following official cores are utilising ArduinoCore-API: |
| 10 | +This repository is a fork which reworks the folder structure to contain only the official Arduino API and hardware‑independent code, in order to simplify Arduino API integration into STM32duino via a git submodule. |
12 | 11 |
|
13 | | -* [megaavr](https://github.com/arduino/ArduinoCore-megaAVR) |
14 | | -* [mbed](https://github.com/arduino/ArduinoCore-mbed) |
15 | | -* [samd](https://github.com/arduino/ArduinoCore-samd) |
16 | | -* [renesas](https://github.com/arduino/ArduinoCore-renesas) |
| 12 | +It will also contain some updates/changes/enhancements/fixes. |
17 | 13 |
|
18 | | -There's an ongoing effort to port the others, while maintainers of third-party cores are strongly invited to follow the same route in order to stay up-to-date with the new language features. For backwards compatibility, every revision of this repo will increase the `ARDUINO_API_VERSION` define. |
| 14 | +--- |
19 | 15 |
|
20 | | -## Documentation |
| 16 | +## 📦 What's Included? |
21 | 17 |
|
22 | | -The Arduino API is documented in the official [language reference](https://www.arduino.cc/reference/en/), whose sources are located in [this repository](https://github.com/arduino/reference-en) and are open to contributions from the community. |
| 18 | +- ✅ Official Arduino API files (`api/` folder) |
| 19 | +- ✅ some updates, changes, enhancements and fixes. |
23 | 20 |
|
24 | | -## Support |
| 21 | +--- |
25 | 22 |
|
26 | | -This repository is not directly usable by final users. If you need assistance with Arduino, see the [Help Center](https://support.arduino.cc/) and browse the [forum](https://forum.arduino.cc). |
| 23 | +## 🚀 Submodule usage |
27 | 24 |
|
28 | | -## Development |
| 25 | +### 1️⃣ Add the Submodule |
29 | 26 |
|
30 | | -### Bugs & Issues |
| 27 | +In the `Arduino_Core_STM32` repository, run: |
31 | 28 |
|
32 | | -If you want to report an issue with this core, you can submit it to the [issue tracker](https://github.com/arduino/ArduinoCore-API/issues) of this repository. Some rules apply: |
33 | | - |
34 | | -* If your issue is about a specific hardware platform, report it to its repository. This one is only about discussing the generic API. |
35 | | -* Before posting, please check if the same problem has been already reported by someone else to avoid duplicates. |
36 | | -* Remember to include as much detail as you can about your hardware set-up, code and steps for reproducing the issue. Make sure you're using an original Arduino board. |
37 | | - |
38 | | -### Contributions |
| 29 | +```bash |
39 | 30 |
|
40 | | -Contributions are always welcome! You can submit them directly to this repository as Pull Requests. Please provide a detailed description of the problem you're trying to solve. We also appreciate any help in testing issues and patches contributed by other users. |
| 31 | +git submodule add https://github.com/stm32duino/ArduinoCore-API.git cores/arduino/api |
| 32 | +``` |
| 33 | +### 2️⃣ Initialize and update |
| 34 | +```bash |
| 35 | +git submodule update --init |
| 36 | +``` |
41 | 37 |
|
42 | | -### Unit testing |
| 38 | +--- |
43 | 39 |
|
44 | | -This repository includes a test suite that covers most of the API and that is designed to run on generic hardware, thus not requiring a development board. We call this _host-based unit-testing_. In order to test the features that are only defined but not implemented in this repository, mock implementations are included. |
| 40 | +## 🔗 Official Resources |
45 | 41 |
|
46 | | -Please help us improve the coverage of the test suite! |
| 42 | +| Resource | Link | |
| 43 | +|----------|------| |
| 44 | +| **Official ArduinoCore-API** | https://github.com/arduino/ArduinoCore-API | |
| 45 | +| **STM32duino** | https://github.com/stm32duino/Arduino_Core_STM32 | |
47 | 46 |
|
48 | | -#### To build and run unit tests |
| 47 | +--- |
49 | 48 |
|
50 | | -The unit tests are automatically built by GitHub as part of pull request checks (in `.github/workflows/unit-tests.yml`). |
| 49 | +## 📝 License |
51 | 50 |
|
52 | | -To build and run locally: |
| 51 | +This repository is a fork of `arduino/ArduinoCore-API` and maintains the **same license** (LGPL 2.1+). |
53 | 52 |
|
54 | | -**Dependencies** |
| 53 | +See the [LICENSE](License) file in the repository root for details. |
55 | 54 |
|
56 | | -* [CMake](https://cmake.org/) |
57 | | -* [GCC](https://gcc.gnu.org/) |
| 55 | +--- |
58 | 56 |
|
59 | | -On (Ubuntu) Linux run: |
| 57 | +## 💡 Important Notes |
60 | 58 |
|
61 | | -```bash |
62 | | -sudo apt-get install build-essential cmake |
63 | | -``` |
| 59 | +### ✅ Advantages of Using a Submodule |
64 | 60 |
|
65 | | -From the project root: |
| 61 | +- **Traceability**: Know exactly which version of the API you're using |
| 62 | +- **Easy Updates**: Simple `git submodule update` to sync |
| 63 | +- **Isolation**: API stays in its own code branch |
| 64 | +- **Compatibility**: STM32-specific modifications remain separate |
66 | 65 |
|
67 | | -```bash |
68 | | -cd test && mkdir build && cd build |
69 | | -cmake .. |
70 | | -make && bin/test-ArduinoCore-API |
71 | | -``` |
| 66 | +### ⚠️ Points to Consider |
72 | 67 |
|
73 | | -### Implementing ArduinoCore-API |
| 68 | +- After cloning **Arduino_Core_STM32**, run: |
| 69 | + ```bash |
| 70 | + git submodule update --init --recursive |
| 71 | + ``` |
74 | 72 |
|
75 | | -In order to compile a core which is implementing ArduinoCore-API you'll need to copy/symlink the `api` directory to the target's `cores/arduino` directory as part of your development and release workflow. The most elegant and effective solution is to develop your core with `api` symlinked and produce the distributable archive by telling `tar` to follow symlinks. Example: |
| 73 | +--- |
76 | 74 |
|
77 | | -```bash |
78 | | -tar --exclude='*.git*' -cjhvf $yourcore-$version.tar.bz2 $yourcore/ |
79 | | -``` |
| 75 | +## 📊 Project Information |
80 | 76 |
|
81 | | -The API is coded to the C++11 standard and the core's compiler must be able to support that version of the language. |
| 77 | +| Property | Value | |
| 78 | +|----------|-------| |
| 79 | +| **Type** | fork | |
| 80 | +| **Use Case** | Submodule for STM32duino | |
| 81 | +| **Language** | C/C++ | |
| 82 | +| **License** | LGPL 2.1+ | |
| 83 | +| **Original Repository** | https://github.com/arduino/ArduinoCore-API | |
| 84 | +--- |
82 | 85 |
|
83 | | -Documentation for how to integrate with a Arduino core (which is necessary if you do not download the Arduino core via the Boards Manager) can be found here: |
84 | | -* [ArduinoCore-megaavr](https://github.com/arduino/ArduinoCore-megaavr#developing) |
85 | | -* [ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed#clone-the-repository-in-sketchbookhardwarearduino-git) |
86 | | -* [ArduinoCore-samd](https://github.com/arduino/ArduinoCore-samd/#developing) |
| 86 | +## ✨ Quick Start |
87 | 87 |
|
88 | | -## Donations |
| 88 | +### Clone **Arduino_Core_STM32** with this submodule |
89 | 89 |
|
90 | | -This open source code is maintained by Arduino with the help of the community. We invest a considerable amount of time in testing code, optimizing it and introducing new features. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc) which is the best way to make sure our effort can continue in the long term. |
| 90 | +```bash |
| 91 | +git clone --recurse-submodules https://github.com/stm32duino/Arduino_Core_STM32.git |
| 92 | +``` |
91 | 93 |
|
92 | | -## License and credits |
| 94 | +### Update submodule |
93 | 95 |
|
94 | | -This code is licensed under the terms of the GNU LGPL 2.1. If you have questions about licensing please contact us at [license@arduino.cc](mailto:license@arduino.cc). |
| 96 | +```bash |
| 97 | +git submodule update --remote |
| 98 | +``` |
95 | 99 |
|
| 100 | +--- |
0 commit comments