Skip to content

Commit

Permalink
boards: refactor using extensions and shields
Browse files Browse the repository at this point in the history
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
  • Loading branch information
gmarull committed Aug 21, 2023
1 parent d27de4c commit ef0ff2b
Show file tree
Hide file tree
Showing 24 changed files with 200 additions and 297 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ jobs:
- name: Build
working-directory: spinner
run: |
west build -b nucleof302r8_ihm07m1 spinner -p
west build -b nucleog431rb_ihm16m1 spinner -p
west build -b nucleo_f302r8 spinner -p -- -DSHIELD=ihm07m1
west build -b nucleo_f302r8 spinner -p -- -DSHIELD=ihm16m1
west build -b nucleo_g431rb spinner -p -- -DSHIELD=ihm07m1
west build -b nucleo_g431rb spinner -p -- -DSHIELD=ihm16m1
- name: Test
working-directory: spinner
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ west update
The application can be built by running:

```shell
west build -b $BOARD spinner
west build -b $BOARD spinner [-- -DSHIELD=$SHIELD]
```

where `$BOARD` is the target board (see `boards`). Some other build
configurations are also provided:
where `$BOARD` is the target board (see `boards`) and `$SHIELD` an optional
shield (see `boards/shields`). Some other build configurations are also provided:

- `debug.conf`: Enable debug-friendly build
- `shell.conf`: Enable shell facilities
Expand Down
6 changes: 0 additions & 6 deletions boards/arm/nucleof302r8_ihm07m1/Kconfig.board

This file was deleted.

12 changes: 0 additions & 12 deletions boards/arm/nucleof302r8_ihm07m1/Kconfig.defconfig

This file was deleted.

7 changes: 0 additions & 7 deletions boards/arm/nucleof302r8_ihm07m1/board.cmake

This file was deleted.

91 changes: 0 additions & 91 deletions boards/arm/nucleof302r8_ihm07m1/nucleof302r8_ihm07m1.dts

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions boards/arm/nucleof302r8_ihm07m1/support/openocd.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions boards/arm/nucleog431rb_ihm16m1/Kconfig.board

This file was deleted.

12 changes: 0 additions & 12 deletions boards/arm/nucleog431rb_ihm16m1/Kconfig.defconfig

This file was deleted.

7 changes: 0 additions & 7 deletions boards/arm/nucleog431rb_ihm16m1/board.cmake

This file was deleted.

97 changes: 0 additions & 97 deletions boards/arm/nucleog431rb_ihm16m1/nucleog431rb_ihm16m1.dts

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions boards/arm/nucleog431rb_ihm16m1/support/openocd.cfg

This file was deleted.

30 changes: 30 additions & 0 deletions boards/extensions/nucleo_f302r8/nucleo_f302r8.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2021 Teslabs Engineering S.L.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dts-bindings/adc/stm32f3xx.h>

&timers1 {
svpwm: svpwm {
compatible = "st,stm32-svpwm";
currsmp = <&currsmp>;
};
};

&adc1 {
currsmp: currsmp {
compatible = "st,stm32-currsmp-shunt";
adc-resolution = <12>;
adc-tsample = <2>;
adc-trigger = <STM32_ADC_INJ_TRIG_TIM1_TRGO>;
};
};

&timers2 {
feedback: feedback {
compatible = "st,stm32-halls";
phase-shift = <60>;
};
};
31 changes: 31 additions & 0 deletions boards/extensions/nucleo_g431rb/nucleo_g431rb.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2021 Teslabs Engineering S.L.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dts-bindings/adc/stm32g4xx.h>

&timers1 {
svpwm: svpwm {
compatible = "st,stm32-svpwm";
currsmp = <&currsmp>;
};
};

&adc1 {
currsmp: currsmp {
compatible = "st,stm32-currsmp-shunt";

adc-resolution = <12>;
adc-tsample = <3>;
adc-trigger = <STM32_ADC12_INJ_TRIG_TIM1_TRGO>;
};
};

&timers2 {
feedback: feedback {
compatible = "st,stm32-halls";
phase-shift = <60>;
};
};
2 changes: 2 additions & 0 deletions boards/shields/ihm07m1/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_IHM07M1
def_bool $(shields_list_contains,ihm07m1)
Loading

0 comments on commit ef0ff2b

Please sign in to comment.