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

Add HAL for nRF51 series #138

Merged
merged 10 commits into from
Apr 21, 2020
Merged

Add HAL for nRF51 series #138

merged 10 commits into from
Apr 21, 2020

Conversation

fmckeogh
Copy link
Contributor

@fmckeogh fmckeogh commented Apr 5, 2020

As discussed in the Matrix room, my current strategy will be to favour keeping the APIs consistent over exact/correct naming and an increase in code complexity due to many feature gates.

For example, the nRF51 does not have EasyDMA for UART, and so the peripheral is called UART but has been feature gated inside the nRF52 UARTE module. I think more discussion might be needed, but IMHO the benefit to users who want to be able to write agnostic code for any nRF5x device is greater than the confusion that will arise from the missing methods and inconsistent naming.

EDIT: Spoke too soon, there were many difference and so are now separate modules for the nRF51 versions of peripherals where needed. The API's have still been kept as similar as possible however.

TODO

  • Temp
  • Time
  • Timer
  • Clocks
  • GPIO
  • ADC
  • I2C
  • SPI
  • Delay

@fmckeogh
Copy link
Contributor Author

fmckeogh commented Apr 7, 2020

Once ready, nrf-rs/nrf51#9 will need to be merged and a new version published so that this PR can point to version 0.9.0 of nrf51.

@thejpster
Copy link
Contributor

Ok, now #113 really needs to be done :)

@fmckeogh fmckeogh force-pushed the master branch 2 times, most recently from 82108d9 to 7316445 Compare April 17, 2020 11:41
@fmckeogh fmckeogh marked this pull request as ready for review April 19, 2020 17:00
nrf-hal-common/Cargo.toml Outdated Show resolved Hide resolved
nrf-hal-common/src/adc.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/delay_timer.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/twi.rs Show resolved Hide resolved
nrf51-hal/src/lib.rs Outdated Show resolved Hide resolved
@fmckeogh
Copy link
Contributor Author

Okay to merge?

@jonas-schievink jonas-schievink merged commit 1d41617 into nrf-rs:master Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants