Skip to content

Commit 5f797d7

Browse files
gibixDhruvaG2000
authored andcommitted
fix(docs): variants file names and directory structure
Co-authored-by: Gilberto Conti <g.conti@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent b16b96f commit 5f797d7

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

documentation/variants.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,18 @@ target board. To add board support:
2626
1. This project is structured in a way so as to isolate the variants from the core API. Thus, whenever a new board
2727
needs to be added it needs to be done in the `variants/` folder.
2828
Add a folder inside of the variants folder that matches the name of your board.
29-
2. Add an overlay file and a pinmap header file that match the name of the board.
30-
3. Add your new headerfile to an `#ifdef` statement in the variant.h file.
29+
2. Add an overlay file file that match the name of the board.
30+
3. Add a `variant.h` file.
3131

3232
An example of this structure is shown below.
3333

3434
```tree
3535
variants/
3636
├── arduino_nano_33_ble
3737
│   ├── arduino_nano_33_ble.overlay
38-
│   └── arduino_nano_33_ble_pinmap.h
39-
├── CMakeLists.txt
40-
└── variant.h
41-
38+
│   ├── variant.h
4239
```
4340

44-
- The top level consists of `CMakeLists.txt`, `variant.h` and the `<BOARD_NAME>` folder. Each of these files have a specific role to play.
45-
- The `Cmakelists` help the compiler locate the proper directory to help find the proper header files that are board specific. You need to add the name using `zephyr_include_directories(BOARD_NAME)` to this file. Do note that this `BOARD_NAME` is the same as the name of your board's directory.
46-
- `variant.h` contains the necessary `#includes` inorder to tell the source code about your board's pinmap.
47-
- The `<BOARD_NAME>` folder is where the overlay and pinmap file resides. Inorder to understand how to write DT overlays, lookup `Documentation/overlays.md`. To understand the `<boardname_pinmap.h>` file, go through the existing `variants/ARDUINO_NANO33BLE/arduino_nano_ble_sense_pinmap.h` which shows how to use the overlay nodes inside our C programs using zephyr macros like `GPIO_DT_SPEC_GET`. The zephyr-project documentation on this is pretty extensive as well and worth reading.
48-
4941
## Guide to Writing Overlays
5042

5143
### DeviceTree Overlay files for Arduino boards

0 commit comments

Comments
 (0)