Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/dwm1001: add saul_gpio support #18818

Merged
merged 1 commit into from
Oct 29, 2022
Merged

boards/dwm1001: add saul_gpio support #18818

merged 1 commit into from
Oct 29, 2022

Conversation

blueted2
Copy link
Contributor

Contribution description

Add saul support for the dwm1001-dev's LEDs and "USER" button.
The pin macros were already present for this board, all that remained was to add the gpio_params.h header and include the saul_gpio pseudomodule in the board's Makefile.dep.

Added LEDs:

  • LED0 - Green
  • LED1 - Red
  • LED2 - Red
  • LED3 - Blue

Added button:

  • Button 1 - Labelled as "USER"
dwm1001 front blurry leds - the bokeh actually helps with seeing each LED color

Testing procedure

Below is the terminal output where each LED has been toggled by shell command, and a before/after of pressing the "USER" button.

main(): This is RIOT! (Version: 2023.01-devel-182-gbfc8c-pr/board/dwm1001_gpio_params)
> saul
saul
ID      Class           Name
#0      ACT_SWITCH      LED0 (Green)
#1      ACT_SWITCH      LED1 (Red)
#2      ACT_SWITCH      LED2 (Red)
#3      ACT_SWITCH      LED3 (Blue)
#4      SENSE_BTN       Button 1 (USER)
#5      SENSE_TEMP      NRF_TEMP
> saul write 0 1
saul write 0 1
Writing to device #0 - LED0 (Green)
Data:                 1 
data successfully written to device #0
> saul write 1 1
saul write 1 1
Writing to device #1 - LED1 (Red)
Data:                 1 
data successfully written to device #1
> saul write 2 1
saul write 2 1
Writing to device #2 - LED2 (Red)
Data:                 1 
data successfully written to device #2
> saul write 3 1
saul write 3 1
Writing to device #3 - LED3 (Blue)
Data:                 1 
data successfully written to device #3
> saul read 4
saul read 4
Reading from #4 (Button 1 (USER)|SENSE_BTN)
Data:                 0 
<---  pressing "USER" button --->
> saul read 4
saul read 4
Reading from #4 (Button 1 (USER)|SENSE_BTN)
Data:                 1 
> 

Issues/PRs references

@github-actions github-actions bot added the Area: boards Area: Board ports label Oct 28, 2022
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 28, 2022
@blueted2
Copy link
Contributor Author

I tried ammending the commit message with quotes to avoid automatically linking to the "InGroup" user, but that didn't work.

@riot-ci
Copy link

riot-ci commented Oct 28, 2022

Murdock results

✔️ PASSED

f17bd43 boards/dwm1001: add saul_gpio support

Success Failures Total Runtime
2000 0 2000 07m:12s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@benpicco
Copy link
Contributor

I tried ammending the commit message with quotes to avoid automatically linking to the "InGroup" user, but that didn't work.

I'm not quite sure what you mean, but please squash your commits

@blueted2
Copy link
Contributor Author

I think I have squashed the commits, although I may have simply caused a mess... Let me know if I should just start a fresh pull-request.

@benpicco
Copy link
Contributor

Huh, all looks good. There is only a single commit and it only touches the two files it needs.

@@ -1,5 +1,6 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += lis2dh12_spi
USEMODULE += saul_gpio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah KConfig needs an update too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

boards/dwm1001: rename "@InGroup" to match board.h

boards/dwm1001: correct documentation

added "HAVE_SAUL_GPIO"
@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label Oct 29, 2022
@benpicco benpicco merged commit a21f05a into RIOT-OS:master Oct 29, 2022
@blueted2 blueted2 deleted the pr/board/dwm1001_gpio_params branch November 3, 2022 08:01
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants