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

cpu/atmega: MCU implementation of the new GPIO API #14607

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Jul 24, 2020

Contribution description

This PR provides the MCU implementation of the low-level GPIO API in PR #14602 for ATmega. It also contains necessary changes for ATmega boards.

This PR depends on and includes PR #14602. Only the last two commits e461608 and 8aca4d1 are new in this PR.

Testing procedure

The following tests should be executed for any ATmega board:

  • Flash tests/periph_gpio_exp and test whether basic GPIO functionality is still working.
  • Use make -C tests/periph_gpio_exp test to test whether the redirection to virtual GPIO expanders works correctly.
  • Since periph/pwm had to be changed, tests/periph_pwm should be used to check whether PWM is still working.
  • Since periph/spi had to be changed, use any test that requires SPI to check whether SPI is still working.

Issues/PRs references

Depends on PR #14602

@gschorcht gschorcht added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jul 24, 2020
@gschorcht gschorcht force-pushed the periph/gpio_exp_v5b/cpu_atmega branch 4 times, most recently from 5a521fe to 27f7dd8 Compare July 26, 2020 10:07
@gschorcht gschorcht force-pushed the periph/gpio_exp_v5b/cpu_atmega branch from 27f7dd8 to 69ce49c Compare July 26, 2020 15:16
@gschorcht gschorcht added CI: run tests If set, CI server will run tests on hardware for the labeled PR and removed State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jul 26, 2020
@gschorcht
Copy link
Contributor Author

@maribu May I ask you to execute a short test this PR with drivers/wx281x. Since this driver includes a MCU specific part, I would like to know, whether the MCU implementation of the new low-level GPIO API works and maybe what the performance in comparison with the master for this driver is.

@maribu
Copy link
Member

maribu commented Jul 30, 2020

Actually, the old API was way too slow on the low end ATmega platform. Instead, a two hand-crafted assembly implementations doing the bit-banging are used - one working on 8 MHz ATmegas and one on 16 MHz ATmegas. The timing is done by relying that on ATmega each instruction takes 1 CPU cycle, except for branches and RAM accesses (which take 2).

So with the driver not using the GPIO API anyway (except for the pin setup), it won't be affected by any changes in the timing.

@gschorcht
Copy link
Contributor Author

I see 😟 It would have been interesting to see the new API in action.

@gschorcht
Copy link
Contributor Author

gschorcht commented Jul 30, 2020

But drivers/ws281x should at least still work.

@gschorcht gschorcht force-pushed the periph/gpio_exp_v5b/cpu_atmega branch from 69ce49c to 5ff2ca5 Compare September 3, 2020 07:28
@gschorcht gschorcht force-pushed the periph/gpio_exp_v5b/cpu_atmega branch from ce01ae2 to 8aca4d1 Compare September 3, 2020 07:43
@stale
Copy link

stale bot commented Mar 19, 2021

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 Mar 19, 2021
@gschorcht gschorcht added State: don't stale State: Tell state-bot to ignore this issue and removed State: stale State: The issue / PR has no activity for >185 days labels Mar 20, 2021
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
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: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms State: don't stale State: Tell state-bot to ignore this issue Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants