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

Added beginnings of an nRF52840 hal #1

Merged
merged 4 commits into from
Aug 25, 2018

Conversation

jscarrott
Copy link
Member

This is just all the old hal code I had for the 52840, edited just to get the GPIO stuff working. I don't mind if you would rather get rid of this and start again.

@jscarrott jscarrott requested a review from wez August 24, 2018 19:51
Copy link
Member

@wez wez left a comment

Choose a reason for hiding this comment

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

❤️ I have a couple of non-blocking questions

@@ -0,0 +1,35 @@
[package]
name = "nrf52840-embedded-hal"
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep this a bit shorter? nrf52840-hal?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

{
/* NOTE K = KiBi = 1024 bytes */
/* TODO Adjust these memory regions to match your device memory layout */
FLASH : ORIGIN = 0x00000000, LENGTH = 950K
Copy link
Member

Choose a reason for hiding this comment

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

These seem a little smaller than I was expecting; are these adjusted for the softdevice?
https://github.com/particle-iot/nrf5_sdk/blob/6177fb3797962aaa091e04fa363bfb93a55eb7ef/modules/nrfx/mdk/nrf52840_xxaa.ld#L8

the memory.x in the hal should probably not factor in the softdevice and that should probably be something that is handled in the "application" crate.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, actually a good catch. When I first tried to get my dev board working I had a real mare of a time. Thinking back I think I reduced the sizes to try and prevent this weird issue I was having, I can't for the life of me remember my rationale. I'll put it back and remove the TODO.

@@ -0,0 +1,365 @@
//! General Purpose Input / Output
Copy link
Member

Choose a reason for hiding this comment

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

this file looks similar to nrf52-hal/src/gpio.rs... is it close enough that you could copy that over this one and maybe tweak the use nrf52; lines to use nrf52840?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's because it was originally a copy of an earlier version. I've updated it and made a couple of tweaks for the 52840. Couldn't get the GPIOs on P1 to work with the macro though due to the shared module p0, and I'm not sure of the best way to fix it.

@jscarrott jscarrott force-pushed the feature/Add-old-nrf52840-hal-code branch from c27152f to e64d099 Compare August 25, 2018 21:45
@jscarrott jscarrott force-pushed the feature/Add-old-nrf52840-hal-code branch from 449254c to 4b0a38d Compare August 25, 2018 22:08
Copy link
Member

@wez wez left a comment

Choose a reason for hiding this comment

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

looks good to me!

// the same module. Not sure the best way to deal with P1 only implementing half the pins
// either
// ===========================================================================
//gpio!(P1, p0, P1_Pin [
Copy link
Member

Choose a reason for hiding this comment

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

Once jamesmunns/nrf52-hal#8 is a bit further along, I think this will get a bit easier

@jscarrott jscarrott merged commit b550c2d into master Aug 25, 2018
@jscarrott jscarrott deleted the feature/Add-old-nrf52840-hal-code branch August 25, 2018 22:20
Yatekii pushed a commit that referenced this pull request Mar 6, 2019
Add spi demo example code
jacobrosenthal pushed a commit to jacobrosenthal/nrf-hal that referenced this pull request Aug 28, 2019
jamesmunns added a commit that referenced this pull request Jun 28, 2020
* Add extension trait for tasks and events

* Easier to maintain structure

* Implement other crates, fix regex a bit

* That's gross, but it works

* Apply suggestions from code review

Co-authored-by: Thales <[email protected]>

* Remove nrf9160 impls

* More inline always

Co-authored-by: Thales <[email protected]>
bors bot pushed a commit that referenced this pull request Mar 3, 2021
ieee802154.rs: add CCA-Energy Detection
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