Skip to content

Commit 17bb7b9

Browse files
authored
fix: wrong button label in main example (#79)
Button labels without pins defined must be references to buttons already defined in board configuration. Closes #78
1 parent 044e5ef commit 17bb7b9

File tree

2 files changed

+93
-17
lines changed

2 files changed

+93
-17
lines changed

docs/using_the_cli/configuration_file.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ general:
2828
runevery: 1m
2929
# Board name, as defined in Zephyr.
3030
board: nrf52840dongle_nrf52840
31+
32+
# Defines specific major & minor version that should be used.
33+
# Later patch version can be automatically selected by the program,
34+
# if specific version is not found.
35+
# I.e. if requested v2.7.0, but only v2.7.2 is found - v2.7.2 will be used instead.
36+
# Higher then minimum supported version can be specified (but may be incompatible),
37+
# but lower then minimum version will result in an error.
38+
# This is optional configuration.
39+
ncs_version: v2.7.0
3140

3241
# This paths are necessary to build the generated firmware.
3342
# If nRF Connect setup was done with VS Code extension -
@@ -57,10 +66,10 @@ general:
5766
# This section is for defining peripherals
5867
# on the board. I.e. uart, spi, i2c, etc.
5968
# NOTE: Only changes should be defined here.
60-
# See https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/<arch>/<board_name>/<board_name>.dts
69+
# See https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/<vendor>/<board_name>/<board_name>.dts
6170
# for existing definitions for the board.
6271
# For example nRF52840 Dongle would have board devicetree at
63-
# https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
72+
# https://github.com/zephyrproject-rtos/zephyr/blob/26603cefaf41298c417f2eee834ed40d9ab35d3a/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840.dts
6473
board:
6574
# Specifically define bootloader for the board.
6675
# This field is optional, and in most cases this might not be needed.
@@ -74,6 +83,12 @@ board:
7483
# to be selected one, even if the value is empty string.
7584
#bootloader: nrf52_legacy
7685

86+
# This will make "button0" factory reset button.
87+
# Pressing this button for at least 5 seconds
88+
# would remove current network configuration,
89+
# allowing it to be connected to another network.
90+
factory_reset_button: button0
91+
7792
# This option will add UART loging functionality.
7893
# User can choose which console to use(usb or uart).
7994
# UART has to be defined either in default device tree,
@@ -103,6 +118,20 @@ board:
103118
# By default device will be configured as sleepy end device.
104119
# Note: Enabling router will increase the size of the firmware.
105120
is_router: false
121+
# Buttons is optional, to provide information about available buttons on the board.
122+
# Available button is not necessary a physical button, but can also be a pin.
123+
buttons:
124+
# If only ID is provided it means that this button is already present in board definition,
125+
# and it will be just referenced from it.
126+
- id: button0
127+
# Button can also have a pin, which will create new "button" on specified pin.
128+
# To make it active-low - set "inverted" configuration option to "true".
129+
- id: button1
130+
pin:
131+
port: 0
132+
pin: 18
133+
inverted: true
134+
106135
# I2C is optional, only to provide different pins for i2c instance(s)
107136
i2c:
108137
# ID of instance is the same as defined in the SoC definition.
@@ -121,7 +150,7 @@ board:
121150
rx: 1.10
122151
leds:
123152
- id: led_green
124-
# The `pin` section is optional, if led is already present in board definition.
153+
# The pin definition is optional, if led is already present in board definition.
125154
pin:
126155
port: 0
127156
pin: 6
@@ -130,7 +159,7 @@ board:
130159
# Sensors define a list of devices that
131160
# can provide sensor values or be controlled
132161
sensors:
133-
# All sensors have type, and most will
162+
# All sensors have type, and most will,
134163
# also have sensor-specific configuration.
135164
- type: bme680
136165
i2c:
@@ -153,6 +182,36 @@ sensors:
153182
# port: 0
154183
# pin: 6
155184
# inverted: true
185+
# Add a dht sensor from aosong manufacturer
186+
# If DHT22 or AM2302 is used, variant must be set to "dht22". DHT11 does not need variant.
187+
# - type: dht
188+
# variant: "dht22"
189+
# pin:
190+
# port: 1
191+
# pin: 13
192+
#
193+
# power_config uses ADC to measure positive voltage
194+
# on pin 0.04 and report it as a battery voltage.
195+
# ZCL 4.9 will be implemented to do general
196+
# electricity measurements through ADC.
197+
# Capacitive mositure sensors would be added
198+
# with ZCL 4.7.
199+
# - type: power_config
200+
# adc_pin: 0.04
201+
# battery_rated_voltage: 3000
202+
# battery_voltage_min_threshold: 2500
203+
#
204+
# This example is crude example of using soil_moisture_adc
205+
# sensor to get water moisture percentage.
206+
#
207+
# Note: min & max mv values may differ for your sensor,
208+
# so please test it and adjust them accordingly!
209+
# - type: soil_moisture_adc
210+
# adc_pin:
211+
# pin: 0.04
212+
# oversampling: 4
213+
# min_moisture_mv: 730
214+
# max_moisture_mv: 430
156215
```
157216

158217
## Sensor options

zigbee.yaml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ general:
1010
runevery: 1m
1111
# Board name, as defined in Zephyr.
1212
board: nrf52840dongle_nrf52840
13+
14+
# Defines specific major & minor version that should be used.
15+
# Later patch version can be automatically selected by the program,
16+
# if specific version is not found.
17+
# I.e. if requested v2.7.0, but only v2.7.2 is found - v2.7.2 will be used instead.
18+
# Higher then minimum supported version can be specified (but may be incompatible),
19+
# but lower then minimum version will result in an error.
20+
# This is optional configuration.
21+
ncs_version: v2.7.0
1322

1423
# This paths are necessary to build the generated firmware.
1524
# If nRF Connect setup was done with VS Code extension -
@@ -39,10 +48,10 @@ general:
3948
# This section is for defining peripherals
4049
# on the board. I.e. uart, spi, i2c, etc.
4150
# NOTE: Only changes should be defined here.
42-
# See https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/<arch>/<board_name>/<board_name>.dts
51+
# See https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/<vendor>/<board_name>/<board_name>.dts
4352
# for existing definitions for the board.
4453
# For example nRF52840 Dongle would have board devicetree at
45-
# https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
54+
# https://github.com/zephyrproject-rtos/zephyr/blob/26603cefaf41298c417f2eee834ed40d9ab35d3a/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840.dts
4655
board:
4756
# Specifically define bootloader for the board.
4857
# This field is optional, and in most cases this might not be needed.
@@ -56,11 +65,11 @@ board:
5665
# to be selected one, even if the value is empty string.
5766
#bootloader: nrf52_legacy
5867

59-
# This will make "btn1" factory reset button.
68+
# This will make "button0" factory reset button.
6069
# Pressing this button for at least 5 seconds
6170
# would remove current network configuration,
6271
# allowing it to be connected to another network.
63-
factory_reset_button: btn1
72+
factory_reset_button: button0
6473

6574
# This option will add UART loging functionality.
6675
# User can choose which console to use(usb or uart).
@@ -96,10 +105,10 @@ board:
96105
buttons:
97106
# If only ID is provided it means that this button is already present in board definition,
98107
# and it will be just referenced from it.
99-
- id: btn1
108+
- id: button0
100109
# Button can also have a pin, which will create new "button" on specified pin.
101110
# To make it active-low - set "inverted" configuration option to "true".
102-
- id: btn2
111+
- id: button1
103112
pin:
104113
port: 0
105114
pin: 18
@@ -129,14 +138,22 @@ board:
129138
pin: 6
130139
inverted: true
131140

141+
# Sensors define a list of devices that
142+
# can provide sensor values or be controlled
132143
sensors:
133-
# - type: bme680
134-
# i2c:
135-
# id: i2c0
136-
# addr: '0x76'
137-
# - type: scd4x
138-
# i2c:
139-
# id: i2c0
144+
# All sensors have type, and most will,
145+
# also have sensor-specific configuration.
146+
- type: bme680
147+
i2c:
148+
id: i2c0
149+
# Some devices might have changable I2C address,
150+
# which can be defined here.
151+
# Note: this does not change the device address,
152+
# only tells which address to use.
153+
addr: '0x76'
154+
- type: scd4x
155+
i2c:
156+
id: i2c0
140157
# - type: device_temperature
141158
# on_off is a sensor that will respond to on/off state of the pin.
142159
# For now verifyied to be controlled by the client only,

0 commit comments

Comments
 (0)