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

Multiple peripheral configuration for a single board #11270

Closed
ofauchon opened this issue Mar 25, 2019 · 2 comments
Closed

Multiple peripheral configuration for a single board #11270

ofauchon opened this issue Mar 25, 2019 · 2 comments
Labels
State: stale State: The issue / PR has no activity for >185 days Type: question The issue poses a question regarding usage of RIOT

Comments

@ofauchon
Copy link

Hi.

I have several RIOT-OS application that need different peripheral configuration (for a same board) eg:

  • One board configuration that uses two serial port and PWM for a RIOT application
  • One board configuration that uses three serial ports for another RIOT application

There can be conflicts between the GPIOs (ex: third serial port pins vs PWM pins)

What is the correct way to handle multiple peripheral configuration for the same board ?

Should I :

1/ Duplicate board ( board/myboard_3uart and board/myboard_2serial_1pwm )
2/ Use #ifdefs GPIO_PROFILE_X in a local board/xxxxxx/include/periph_conf.h to switch peripheral config at compile time ?

Thanks for your help

Olivier

@dylad dylad added the Type: question The issue poses a question regarding usage of RIOT label Mar 27, 2019
@MrKevinWeiss
Copy link
Contributor

I believe the configuration task force should be able to solve this with board configuration files but that seems to be a ways away.

Ultimately it is your choice how to do it. In RIOT the boards/esp32-olimex-evb/include/periph_conf.h has an #ifdef

#ifndef ADC_GPIOS
#if MODULE_OLIMEX_ESP32_GATEWAY
#define ADC_GPIOS { GPIO32, GPIO35, GPIO36, GPIO39 }
#else /* MODULE_OLIMEX_ESP32_GATEWAY */
#define ADC_GPIOS { }
#endif /* MODULE_OLIMEX_ESP32_GATEWAY */
#endif /* ADC_GPIOS */

I personally would prefer creating my own board file and playing around with it. As long as it is only for you it is only up to you.

@stale
Copy link

stale bot commented Oct 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Oct 3, 2019
@stale stale bot closed this as completed Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: stale State: The issue / PR has no activity for >185 days Type: question The issue poses a question regarding usage of RIOT
Projects
None yet
Development

No branches or pull requests

3 participants