Skip to content

Commit c29a6da

Browse files
authored
Merge pull request ARMmbed#22 from ARMmbed/button_configuration_documentation
Document how to add button configuration on new targets.
2 parents 8e71b22 + c5f2c5b commit c29a6da

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

BLE_Button/readme.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ The sample application can be seen on any BLE scanner on a smartphone. If you do
2424

2525
Hardware requirements are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
2626

27+
### Porting this example on new boards
28+
29+
This example requires a board with at least a button to work. While the pin name of the button is defined for the `NRF51_DK`, `NRF52_DK`, `K64F` and `NUCLEO_F401RE`, it is not specified for other boards.
30+
31+
It is easy to add the button configuration for your board:
32+
* Open the file named `mbed_app.json` at the root of this example.
33+
* In the section `target_overides` add a new object named after your target if it doesn't exist. This object contain overridden parameters for your target.
34+
* Override the property `ble_button_pin_name` in your target object. The value of the property should be equal to the pin name to use as a button.
35+
36+
As an example, this is the JSON bit which has to be added in the `target_overrides` section of `mbed_app.json` for a `NUCLEO_F411RE` board.
37+
38+
```json
39+
"NUCLEO_F411RE": {
40+
"ble_button_pin_name": "USER_BUTTON"
41+
}
42+
```
43+
44+
<span> **Note:** You can get more informations about the configuration system in the [documentation](https://github.com/ARMmbed/mbed-os/blob/master/docs/config_system.md)</span>
45+
46+
<span> **Important:** If your target use an ST BLE shield, other parameters have to be overridden for your target. More information are available in the global [README](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md#targets-for-ble)</span>
47+
2748
## Building instructions
2849

2950
Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
@@ -76,4 +97,3 @@ Building instructions for all samples are in the [main readme](https://github.co
7697
![](img/button_depressed.png)
7798

7899
**figure 7** Notification of button depressed using Master Control Panel 4.0.5
79-

BLE_GAPButton/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ The sample application can be seen on any BLE scanner on a smartphone. If you do
1818

1919
Hardware requirements are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
2020

21+
### Porting this example on new boards
22+
23+
This example requires a board with at least a button to work. While the pin name of the button is defined for the `NRF51_DK`, `NRF52_DK`, `K64F` and `NUCLEO_F401RE`, it is not specified for other boards.
24+
25+
It is easy to add the button configuration for your board:
26+
* Open the file named `mbed_app.json` at the root of this example.
27+
* In the section `target_overides` add a new object named after your target if it doesn't exist. This object contain overridden parameters for your target.
28+
* Override the property `ble_button_pin_name` in your target object. The value of the property should be equal to the pin name to use as a button.
29+
30+
As an example, this is the JSON bit which has to be added in the `target_overrides` section of `mbed_app.json` for a `NUCLEO_F411RE` board.
31+
32+
```json
33+
"NUCLEO_F411RE": {
34+
"ble_button_pin_name": "USER_BUTTON"
35+
}
36+
```
37+
38+
<span> **Note:** You can get more informations about the configuration system in the [documentation](https://github.com/ARMmbed/mbed-os/blob/master/docs/config_system.md)</span>
39+
40+
<span> **Important:** If your target use an ST BLE shield, other parameters have to be overridden for your target. More information are available in the global [README](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md#targets-for-ble)</span>
41+
42+
2143
## Building instructions
2244

2345
Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).

0 commit comments

Comments
 (0)