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

Adds RTC, AON, PRCM driver to CC26x2 #1119

Merged
merged 3 commits into from Jul 18, 2018

Conversation

Projects
None yet
3 participants
@refugeesus
Copy link
Contributor

refugeesus commented Jul 17, 2018

Pull Request Overview

Add support for RTC, power domain and clock control to the cc26x2 chip.

Testing Strategy

This PR was tested by initializing dependent peripherals (RFCore from a separate PR) and passing is_enabled() checks. Panic on fail.

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.
Adds RTC, AON, PRCM driver to CC26x2
Add support for RTC, power domain and clock control to the cc26x2 chip.

@alevy alevy force-pushed the refugeesus:chip-cc1312/prcm-aon branch from b635ea0 to d0e8774 Jul 17, 2018

@alevy alevy changed the title Chip cc1312/prcm aon Adds RTC, AON, PRCM driver to CC26x2 Jul 17, 2018

@alevy
Copy link
Member

alevy left a comment

Minor comments

use kernel::common::StaticRef;

#[repr(C)]
struct AonWucRegisters {

This comment has been minimized.

@alevy

alevy Jul 17, 2018

Member

I can't find a reference to this anywhere in the datasheet. Can you add a pointer in the comments?

This comment has been minimized.

@refugeesus

refugeesus Jul 17, 2018

Contributor

Its wake-up-control. These are the same registers as PMCtl registers set in AON. It's needed here for clock access when forcing shutdown. Another not so clear portion of the tech ref manual. If the LF clock is not deactivated (wherever you are sourcing it from), the mcu will not power down correctly.

I can add comments in to explain this and some reference page numbers

This comment has been minimized.

@alevy

alevy Jul 18, 2018

Member

Please. I still can't find it.

This comment has been minimized.

@refugeesus

refugeesus Jul 18, 2018

Contributor

Ok so I can't find the page exactly since AON registers are not separated into their own chapter, but it is correct and here is ti's register description html page where you can find it here. I'll keep looking for the page in the tech ref but it is unusually hard to locate for some reason.

Name should be changed to AonPWCtlRegisters since the settings for wake up/shutdown

This comment has been minimized.

@alevy

alevy Jul 18, 2018

Member

That doc seems to imply the offset should be 0x4009_0010, rather than 0x4009_1000.

That is brutal... it's not in the datasheet.

So a comment with a link to that URL and the specific name of the register. This is a recipe for nobody being able to figure out what the heck to do with this later. Thanks TI.

regs.sync.get();
}

pub fn sync(&self) {

This comment has been minimized.

@alevy

alevy Jul 17, 2018

Member

Comment describing what this does (really comments for all of these would be good, but this is the most ambiguous, and not really related to the functionality if the RTC.

@alevy alevy referenced this pull request Jul 17, 2018

Closed

Add chip support for cc13x2 #1084

@bradjc

This comment has been minimized.

Copy link
Contributor

bradjc commented Jul 17, 2018

What is the difference between the two RTC implementations?

@alevy

This comment has been minimized.

Copy link
Member

alevy commented Jul 17, 2018

@bradjc: relatively little. there is an additional sync method which is used to synchronize between the AON and MCU clocks (why is it in the RTC registers? idk... ask TI...)

Otherwise not much, but I'm personally of a mind to get rid of the cc26xx crate as soon as we have equivalents for the cc26x2 family specifically. It's a crazy enough datasheet that I'm fairly unconfident in any changes we'd make without testing on hardware, and I don't think anyone is actively developing for the CC2650 (sensortag) anymore (nor should they since it doesn't have an MPU)

chips: added comments for explaining why AON PMCtl is in prcm.rs and …
…why sync() method is in rtc.rs. Changed Wuc naming to PMCtl

@alevy alevy force-pushed the refugeesus:chip-cc1312/prcm-aon branch from cd4488e to b1b5553 Jul 18, 2018

@alevy

alevy approved these changes Jul 18, 2018

@alevy

This comment has been minimized.

Copy link
Member

alevy commented Jul 18, 2018

bors r+

bors bot added a commit that referenced this pull request Jul 18, 2018

Merge #1119
1119: Adds RTC, AON, PRCM driver to CC26x2 r=alevy a=refugeesus

### Pull Request Overview

Add support for RTC, power domain and clock control to the cc26x2 chip.

### Testing Strategy

This PR was tested by initializing dependent peripherals (RFCore from a separate PR) and passing is_enabled() checks. Panic on fail. 

### TODO or Help Wanted

n/a

### Documentation Updated

- [ ] ~~Updated the relevant files in `/docs`, or no updates are required.~~

### Formatting

- [x] Ran `make formatall`.


Co-authored-by: Robert Keith <robertfkeith@me.com>
Co-authored-by: Amit Aryeh Levy <amit@amitlevy.com>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Jul 18, 2018

@bors bors bot merged commit c91b27a into tock:master Jul 18, 2018

3 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@alevy alevy referenced this pull request Jul 31, 2018

Closed

Tracking: Migrating away from CC26xx crate #1137

7 of 9 tasks complete

@refugeesus refugeesus deleted the refugeesus:chip-cc1312/prcm-aon branch Sep 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment