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

Adds PPI support and example #162

Merged
merged 3 commits into from
Jun 28, 2020
Merged

Conversation

thalesfragoso
Copy link
Contributor

@thalesfragoso thalesfragoso commented Jun 19, 2020

This abstraction allows for the usage of PPI channels independently.

I would like an opinion on the enable method, I think that it might have the potential to break an hypothetical abstraction, but probably won't cause any memory safety problems, should we mark it as unsafe ?

nrf-hal-common/src/ppi.rs Outdated Show resolved Hide resolved
regs.ch[P::CH].tep.write(|w| unsafe { w.bits(addr) });
}

fn set_event_endpoint(&mut self, addr: u32) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The manual says that these registers "accept only addresses to registers from the Event/Task group". Does that mean that writing an incorrect address has no effect, or will that cause trouble?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I just tried here on hardware, I used another timer's CC0 register (TIMER1) to see if it would write something to it or hardfault, but nothing happened, no write nor fault, so I guess it just doesn't do anything ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also tried with a RAM address now, same thing.

Copy link
Member

Choose a reason for hiding this comment

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

It might be really tedious, but we could define an extension trait for all of the events and tasks, it would also let us get rid of the awkward &p.RADIO.tasks_disable as *const _ as u32 dance.

@Yatekii
Copy link
Contributor

Yatekii commented Jun 19, 2020

Awesome! I am keen to try this out! Unfortunately I have little to no experience with the PPI, so I can't really judge about the API ...

Co-authored-by: Jonas Schievink <[email protected]>
@jamesmunns
Copy link
Member

Regarding the "extension trait" idea, here's a quick look for the nrf52832-pac:

Events:

rg 'type EVENTS_' --type rust

src/rng.rs:pub type EVENTS_VALRDY = crate::Reg<u32, _EVENTS_VALRDY>;
src/timer0.rs:pub type EVENTS_COMPARE = crate::Reg<u32, _EVENTS_COMPARE>;
src/uart0.rs:pub type EVENTS_CTS = crate::Reg<u32, _EVENTS_CTS>;
src/uart0.rs:pub type EVENTS_NCTS = crate::Reg<u32, _EVENTS_NCTS>;
src/uart0.rs:pub type EVENTS_RXDRDY = crate::Reg<u32, _EVENTS_RXDRDY>;
src/uart0.rs:pub type EVENTS_TXDRDY = crate::Reg<u32, _EVENTS_TXDRDY>;
src/uart0.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/uart0.rs:pub type EVENTS_RXTO = crate::Reg<u32, _EVENTS_RXTO>;
src/spim0.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/spim0.rs:pub type EVENTS_ENDRX = crate::Reg<u32, _EVENTS_ENDRX>;
src/spim0.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/spim0.rs:pub type EVENTS_ENDTX = crate::Reg<u32, _EVENTS_ENDTX>;
src/spim0.rs:pub type EVENTS_STARTED = crate::Reg<u32, _EVENTS_STARTED>;
src/spis0.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/spis0.rs:pub type EVENTS_ENDRX = crate::Reg<u32, _EVENTS_ENDRX>;
src/spis0.rs:pub type EVENTS_ACQUIRED = crate::Reg<u32, _EVENTS_ACQUIRED>;
src/gpiote.rs:pub type EVENTS_IN = crate::Reg<u32, _EVENTS_IN>;
src/gpiote.rs:pub type EVENTS_PORT = crate::Reg<u32, _EVENTS_PORT>;
src/clock.rs:pub type EVENTS_HFCLKSTARTED = crate::Reg<u32, _EVENTS_HFCLKSTARTED>;
src/clock.rs:pub type EVENTS_LFCLKSTARTED = crate::Reg<u32, _EVENTS_LFCLKSTARTED>;
src/clock.rs:pub type EVENTS_DONE = crate::Reg<u32, _EVENTS_DONE>;
src/clock.rs:pub type EVENTS_CTTO = crate::Reg<u32, _EVENTS_CTTO>;
src/power.rs:pub type EVENTS_POFWARN = crate::Reg<u32, _EVENTS_POFWARN>;
src/power.rs:pub type EVENTS_SLEEPENTER = crate::Reg<u32, _EVENTS_SLEEPENTER>;
src/power.rs:pub type EVENTS_SLEEPEXIT = crate::Reg<u32, _EVENTS_SLEEPEXIT>;
src/spi0.rs:pub type EVENTS_READY = crate::Reg<u32, _EVENTS_READY>;
src/twim0.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/twim0.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/twim0.rs:pub type EVENTS_SUSPENDED = crate::Reg<u32, _EVENTS_SUSPENDED>;
src/twim0.rs:pub type EVENTS_RXSTARTED = crate::Reg<u32, _EVENTS_RXSTARTED>;
src/twim0.rs:pub type EVENTS_TXSTARTED = crate::Reg<u32, _EVENTS_TXSTARTED>;
src/twim0.rs:pub type EVENTS_LASTRX = crate::Reg<u32, _EVENTS_LASTRX>;
src/twim0.rs:pub type EVENTS_LASTTX = crate::Reg<u32, _EVENTS_LASTTX>;
src/egu0.rs:pub type EVENTS_TRIGGERED = crate::Reg<u32, _EVENTS_TRIGGERED>;
src/wdt.rs:pub type EVENTS_TIMEOUT = crate::Reg<u32, _EVENTS_TIMEOUT>;
src/twi0.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/twi0.rs:pub type EVENTS_RXDREADY = crate::Reg<u32, _EVENTS_RXDREADY>;
src/twi0.rs:pub type EVENTS_TXDSENT = crate::Reg<u32, _EVENTS_TXDSENT>;
src/twi0.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/twi0.rs:pub type EVENTS_BB = crate::Reg<u32, _EVENTS_BB>;
src/twi0.rs:pub type EVENTS_SUSPENDED = crate::Reg<u32, _EVENTS_SUSPENDED>;
src/pdm.rs:pub type EVENTS_STARTED = crate::Reg<u32, _EVENTS_STARTED>;
src/pdm.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/pdm.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/ecb.rs:pub type EVENTS_ENDECB = crate::Reg<u32, _EVENTS_ENDECB>;
src/ecb.rs:pub type EVENTS_ERRORECB = crate::Reg<u32, _EVENTS_ERRORECB>;
src/rtc0.rs:pub type EVENTS_TICK = crate::Reg<u32, _EVENTS_TICK>;
src/rtc0.rs:pub type EVENTS_OVRFLW = crate::Reg<u32, _EVENTS_OVRFLW>;
src/rtc0.rs:pub type EVENTS_COMPARE = crate::Reg<u32, _EVENTS_COMPARE>;
src/lpcomp.rs:pub type EVENTS_READY = crate::Reg<u32, _EVENTS_READY>;
src/lpcomp.rs:pub type EVENTS_DOWN = crate::Reg<u32, _EVENTS_DOWN>;
src/lpcomp.rs:pub type EVENTS_UP = crate::Reg<u32, _EVENTS_UP>;
src/lpcomp.rs:pub type EVENTS_CROSS = crate::Reg<u32, _EVENTS_CROSS>;
src/radio.rs:pub type EVENTS_READY = crate::Reg<u32, _EVENTS_READY>;
src/radio.rs:pub type EVENTS_ADDRESS = crate::Reg<u32, _EVENTS_ADDRESS>;
src/radio.rs:pub type EVENTS_PAYLOAD = crate::Reg<u32, _EVENTS_PAYLOAD>;
src/radio.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/radio.rs:pub type EVENTS_DISABLED = crate::Reg<u32, _EVENTS_DISABLED>;
src/radio.rs:pub type EVENTS_DEVMATCH = crate::Reg<u32, _EVENTS_DEVMATCH>;
src/radio.rs:pub type EVENTS_DEVMISS = crate::Reg<u32, _EVENTS_DEVMISS>;
src/radio.rs:pub type EVENTS_RSSIEND = crate::Reg<u32, _EVENTS_RSSIEND>;
src/radio.rs:pub type EVENTS_BCMATCH = crate::Reg<u32, _EVENTS_BCMATCH>;
src/radio.rs:pub type EVENTS_CRCOK = crate::Reg<u32, _EVENTS_CRCOK>;
src/radio.rs:pub type EVENTS_CRCERROR = crate::Reg<u32, _EVENTS_CRCERROR>;
src/temp.rs:pub type EVENTS_DATARDY = crate::Reg<u32, _EVENTS_DATARDY>;
src/ccm.rs:pub type EVENTS_ENDKSGEN = crate::Reg<u32, _EVENTS_ENDKSGEN>;
src/ccm.rs:pub type EVENTS_ENDCRYPT = crate::Reg<u32, _EVENTS_ENDCRYPT>;
src/ccm.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/i2s.rs:pub type EVENTS_RXPTRUPD = crate::Reg<u32, _EVENTS_RXPTRUPD>;
src/i2s.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/i2s.rs:pub type EVENTS_TXPTRUPD = crate::Reg<u32, _EVENTS_TXPTRUPD>;
src/uarte0.rs:pub type EVENTS_CTS = crate::Reg<u32, _EVENTS_CTS>;
src/uarte0.rs:pub type EVENTS_NCTS = crate::Reg<u32, _EVENTS_NCTS>;
src/uarte0.rs:pub type EVENTS_RXDRDY = crate::Reg<u32, _EVENTS_RXDRDY>;
src/uarte0.rs:pub type EVENTS_ENDRX = crate::Reg<u32, _EVENTS_ENDRX>;
src/uarte0.rs:pub type EVENTS_TXDRDY = crate::Reg<u32, _EVENTS_TXDRDY>;
src/uarte0.rs:pub type EVENTS_ENDTX = crate::Reg<u32, _EVENTS_ENDTX>;
src/uarte0.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/uarte0.rs:pub type EVENTS_RXTO = crate::Reg<u32, _EVENTS_RXTO>;
src/uarte0.rs:pub type EVENTS_RXSTARTED = crate::Reg<u32, _EVENTS_RXSTARTED>;
src/uarte0.rs:pub type EVENTS_TXSTARTED = crate::Reg<u32, _EVENTS_TXSTARTED>;
src/uarte0.rs:pub type EVENTS_TXSTOPPED = crate::Reg<u32, _EVENTS_TXSTOPPED>;
src/twis0.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/twis0.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/twis0.rs:pub type EVENTS_RXSTARTED = crate::Reg<u32, _EVENTS_RXSTARTED>;
src/twis0.rs:pub type EVENTS_TXSTARTED = crate::Reg<u32, _EVENTS_TXSTARTED>;
src/twis0.rs:pub type EVENTS_WRITE = crate::Reg<u32, _EVENTS_WRITE>;
src/twis0.rs:pub type EVENTS_READ = crate::Reg<u32, _EVENTS_READ>;
src/timer3.rs:pub type EVENTS_COMPARE = crate::Reg<u32, _EVENTS_COMPARE>;
src/qdec.rs:pub type EVENTS_SAMPLERDY = crate::Reg<u32, _EVENTS_SAMPLERDY>;
src/qdec.rs:pub type EVENTS_REPORTRDY = crate::Reg<u32, _EVENTS_REPORTRDY>;
src/qdec.rs:pub type EVENTS_ACCOF = crate::Reg<u32, _EVENTS_ACCOF>;
src/qdec.rs:pub type EVENTS_DBLRDY = crate::Reg<u32, _EVENTS_DBLRDY>;
src/qdec.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/aar.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/aar.rs:pub type EVENTS_RESOLVED = crate::Reg<u32, _EVENTS_RESOLVED>;
src/aar.rs:pub type EVENTS_NOTRESOLVED = crate::Reg<u32, _EVENTS_NOTRESOLVED>;
src/saadc.rs:pub type EVENTS_STARTED = crate::Reg<u32, _EVENTS_STARTED>;
src/saadc.rs:pub type EVENTS_END = crate::Reg<u32, _EVENTS_END>;
src/saadc.rs:pub type EVENTS_DONE = crate::Reg<u32, _EVENTS_DONE>;
src/saadc.rs:pub type EVENTS_RESULTDONE = crate::Reg<u32, _EVENTS_RESULTDONE>;
src/saadc.rs:pub type EVENTS_CALIBRATEDONE = crate::Reg<u32, _EVENTS_CALIBRATEDONE>;
src/saadc.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/comp.rs:pub type EVENTS_READY = crate::Reg<u32, _EVENTS_READY>;
src/comp.rs:pub type EVENTS_DOWN = crate::Reg<u32, _EVENTS_DOWN>;
src/comp.rs:pub type EVENTS_UP = crate::Reg<u32, _EVENTS_UP>;
src/comp.rs:pub type EVENTS_CROSS = crate::Reg<u32, _EVENTS_CROSS>;
src/pwm0.rs:pub type EVENTS_STOPPED = crate::Reg<u32, _EVENTS_STOPPED>;
src/pwm0.rs:pub type EVENTS_SEQSTARTED = crate::Reg<u32, _EVENTS_SEQSTARTED>;
src/pwm0.rs:pub type EVENTS_SEQEND = crate::Reg<u32, _EVENTS_SEQEND>;
src/pwm0.rs:pub type EVENTS_PWMPERIODEND = crate::Reg<u32, _EVENTS_PWMPERIODEND>;
src/pwm0.rs:pub type EVENTS_LOOPSDONE = crate::Reg<u32, _EVENTS_LOOPSDONE>;
src/nfct.rs:pub type EVENTS_READY = crate::Reg<u32, _EVENTS_READY>;
src/nfct.rs:pub type EVENTS_FIELDDETECTED = crate::Reg<u32, _EVENTS_FIELDDETECTED>;
src/nfct.rs:pub type EVENTS_FIELDLOST = crate::Reg<u32, _EVENTS_FIELDLOST>;
src/nfct.rs:pub type EVENTS_TXFRAMESTART = crate::Reg<u32, _EVENTS_TXFRAMESTART>;
src/nfct.rs:pub type EVENTS_TXFRAMEEND = crate::Reg<u32, _EVENTS_TXFRAMEEND>;
src/nfct.rs:pub type EVENTS_RXFRAMESTART = crate::Reg<u32, _EVENTS_RXFRAMESTART>;
src/nfct.rs:pub type EVENTS_RXFRAMEEND = crate::Reg<u32, _EVENTS_RXFRAMEEND>;
src/nfct.rs:pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>;
src/nfct.rs:pub type EVENTS_RXERROR = crate::Reg<u32, _EVENTS_RXERROR>;
src/nfct.rs:pub type EVENTS_ENDRX = crate::Reg<u32, _EVENTS_ENDRX>;
src/nfct.rs:pub type EVENTS_ENDTX = crate::Reg<u32, _EVENTS_ENDTX>;
src/nfct.rs:pub type EVENTS_AUTOCOLRESSTARTED = crate::Reg<u32, _EVENTS_AUTOCOLRESSTARTED>;
src/nfct.rs:pub type EVENTS_COLLISION = crate::Reg<u32, _EVENTS_COLLISION>;
src/nfct.rs:pub type EVENTS_SELECTED = crate::Reg<u32, _EVENTS_SELECTED>;
src/nfct.rs:pub type EVENTS_STARTED = crate::Reg<u32, _EVENTS_STARTED>;

rg 'type TASKS_' --type rust

src/nfct.rs:pub type TASKS_ACTIVATE = crate::Reg<u32, _TASKS_ACTIVATE>;
src/nfct.rs:pub type TASKS_DISABLE = crate::Reg<u32, _TASKS_DISABLE>;
src/nfct.rs:pub type TASKS_SENSE = crate::Reg<u32, _TASKS_SENSE>;
src/nfct.rs:pub type TASKS_STARTTX = crate::Reg<u32, _TASKS_STARTTX>;
src/nfct.rs:pub type TASKS_ENABLERXDATA = crate::Reg<u32, _TASKS_ENABLERXDATA>;
src/nfct.rs:pub type TASKS_GOIDLE = crate::Reg<u32, _TASKS_GOIDLE>;
src/nfct.rs:pub type TASKS_GOSLEEP = crate::Reg<u32, _TASKS_GOSLEEP>;
src/rng.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/rng.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/timer0.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/timer0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/timer0.rs:pub type TASKS_COUNT = crate::Reg<u32, _TASKS_COUNT>;
src/timer0.rs:pub type TASKS_CLEAR = crate::Reg<u32, _TASKS_CLEAR>;
src/timer0.rs:pub type TASKS_SHUTDOWN = crate::Reg<u32, _TASKS_SHUTDOWN>;
src/timer0.rs:pub type TASKS_CAPTURE = crate::Reg<u32, _TASKS_CAPTURE>;
src/spis0.rs:pub type TASKS_ACQUIRE = crate::Reg<u32, _TASKS_ACQUIRE>;
src/spis0.rs:pub type TASKS_RELEASE = crate::Reg<u32, _TASKS_RELEASE>;
src/uart0.rs:pub type TASKS_STARTRX = crate::Reg<u32, _TASKS_STARTRX>;
src/uart0.rs:pub type TASKS_STOPRX = crate::Reg<u32, _TASKS_STOPRX>;
src/uart0.rs:pub type TASKS_STARTTX = crate::Reg<u32, _TASKS_STARTTX>;
src/uart0.rs:pub type TASKS_STOPTX = crate::Reg<u32, _TASKS_STOPTX>;
src/uart0.rs:pub type TASKS_SUSPEND = crate::Reg<u32, _TASKS_SUSPEND>;
src/gpiote.rs:pub type TASKS_OUT = crate::Reg<u32, _TASKS_OUT>;
src/gpiote.rs:pub type TASKS_SET = crate::Reg<u32, _TASKS_SET>;
src/gpiote.rs:pub type TASKS_CLR = crate::Reg<u32, _TASKS_CLR>;
src/clock.rs:pub type TASKS_HFCLKSTART = crate::Reg<u32, _TASKS_HFCLKSTART>;
src/clock.rs:pub type TASKS_HFCLKSTOP = crate::Reg<u32, _TASKS_HFCLKSTOP>;
src/clock.rs:pub type TASKS_LFCLKSTART = crate::Reg<u32, _TASKS_LFCLKSTART>;
src/clock.rs:pub type TASKS_LFCLKSTOP = crate::Reg<u32, _TASKS_LFCLKSTOP>;
src/clock.rs:pub type TASKS_CAL = crate::Reg<u32, _TASKS_CAL>;
src/clock.rs:pub type TASKS_CTSTART = crate::Reg<u32, _TASKS_CTSTART>;
src/clock.rs:pub type TASKS_CTSTOP = crate::Reg<u32, _TASKS_CTSTOP>;
src/spim0.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/spim0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/spim0.rs:pub type TASKS_SUSPEND = crate::Reg<u32, _TASKS_SUSPEND>;
src/spim0.rs:pub type TASKS_RESUME = crate::Reg<u32, _TASKS_RESUME>;
src/power.rs:pub type TASKS_CONSTLAT = crate::Reg<u32, _TASKS_CONSTLAT>;
src/power.rs:pub type TASKS_LOWPWR = crate::Reg<u32, _TASKS_LOWPWR>;
src/twim0.rs:pub type TASKS_STARTRX = crate::Reg<u32, _TASKS_STARTRX>;
src/twim0.rs:pub type TASKS_STARTTX = crate::Reg<u32, _TASKS_STARTTX>;
src/twim0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/twim0.rs:pub type TASKS_SUSPEND = crate::Reg<u32, _TASKS_SUSPEND>;
src/twim0.rs:pub type TASKS_RESUME = crate::Reg<u32, _TASKS_RESUME>;
src/twi0.rs:pub type TASKS_STARTRX = crate::Reg<u32, _TASKS_STARTRX>;
src/twi0.rs:pub type TASKS_STARTTX = crate::Reg<u32, _TASKS_STARTTX>;
src/twi0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/twi0.rs:pub type TASKS_SUSPEND = crate::Reg<u32, _TASKS_SUSPEND>;
src/twi0.rs:pub type TASKS_RESUME = crate::Reg<u32, _TASKS_RESUME>;
src/egu0.rs:pub type TASKS_TRIGGER = crate::Reg<u32, _TASKS_TRIGGER>;
src/ecb.rs:pub type TASKS_STARTECB = crate::Reg<u32, _TASKS_STARTECB>;
src/ecb.rs:pub type TASKS_STOPECB = crate::Reg<u32, _TASKS_STOPECB>;
src/wdt.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/pdm.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/pdm.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/rtc0.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/rtc0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/rtc0.rs:pub type TASKS_CLEAR = crate::Reg<u32, _TASKS_CLEAR>;
src/rtc0.rs:pub type TASKS_TRIGOVRFLW = crate::Reg<u32, _TASKS_TRIGOVRFLW>;
src/lpcomp.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/lpcomp.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/lpcomp.rs:pub type TASKS_SAMPLE = crate::Reg<u32, _TASKS_SAMPLE>;
src/radio.rs:pub type TASKS_TXEN = crate::Reg<u32, _TASKS_TXEN>;
src/radio.rs:pub type TASKS_RXEN = crate::Reg<u32, _TASKS_RXEN>;
src/radio.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/radio.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/radio.rs:pub type TASKS_DISABLE = crate::Reg<u32, _TASKS_DISABLE>;
src/radio.rs:pub type TASKS_RSSISTART = crate::Reg<u32, _TASKS_RSSISTART>;
src/radio.rs:pub type TASKS_RSSISTOP = crate::Reg<u32, _TASKS_RSSISTOP>;
src/radio.rs:pub type TASKS_BCSTART = crate::Reg<u32, _TASKS_BCSTART>;
src/radio.rs:pub type TASKS_BCSTOP = crate::Reg<u32, _TASKS_BCSTOP>;
src/temp.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/temp.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/ccm.rs:pub type TASKS_KSGEN = crate::Reg<u32, _TASKS_KSGEN>;
src/ccm.rs:pub type TASKS_CRYPT = crate::Reg<u32, _TASKS_CRYPT>;
src/ccm.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/uarte0.rs:pub type TASKS_STARTRX = crate::Reg<u32, _TASKS_STARTRX>;
src/uarte0.rs:pub type TASKS_STOPRX = crate::Reg<u32, _TASKS_STOPRX>;
src/uarte0.rs:pub type TASKS_STARTTX = crate::Reg<u32, _TASKS_STARTTX>;
src/uarte0.rs:pub type TASKS_STOPTX = crate::Reg<u32, _TASKS_STOPTX>;
src/uarte0.rs:pub type TASKS_FLUSHRX = crate::Reg<u32, _TASKS_FLUSHRX>;
src/i2s.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/i2s.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/twis0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/twis0.rs:pub type TASKS_SUSPEND = crate::Reg<u32, _TASKS_SUSPEND>;
src/twis0.rs:pub type TASKS_RESUME = crate::Reg<u32, _TASKS_RESUME>;
src/twis0.rs:pub type TASKS_PREPARERX = crate::Reg<u32, _TASKS_PREPARERX>;
src/twis0.rs:pub type TASKS_PREPARETX = crate::Reg<u32, _TASKS_PREPARETX>;
src/timer3.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/timer3.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/timer3.rs:pub type TASKS_COUNT = crate::Reg<u32, _TASKS_COUNT>;
src/timer3.rs:pub type TASKS_CLEAR = crate::Reg<u32, _TASKS_CLEAR>;
src/timer3.rs:pub type TASKS_SHUTDOWN = crate::Reg<u32, _TASKS_SHUTDOWN>;
src/timer3.rs:pub type TASKS_CAPTURE = crate::Reg<u32, _TASKS_CAPTURE>;
src/qdec.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/qdec.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/qdec.rs:pub type TASKS_READCLRACC = crate::Reg<u32, _TASKS_READCLRACC>;
src/qdec.rs:pub type TASKS_RDCLRACC = crate::Reg<u32, _TASKS_RDCLRACC>;
src/qdec.rs:pub type TASKS_RDCLRDBL = crate::Reg<u32, _TASKS_RDCLRDBL>;
src/aar.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/aar.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/comp.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/comp.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/comp.rs:pub type TASKS_SAMPLE = crate::Reg<u32, _TASKS_SAMPLE>;
src/saadc.rs:pub type TASKS_START = crate::Reg<u32, _TASKS_START>;
src/saadc.rs:pub type TASKS_SAMPLE = crate::Reg<u32, _TASKS_SAMPLE>;
src/saadc.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/saadc.rs:pub type TASKS_CALIBRATEOFFSET = crate::Reg<u32, _TASKS_CALIBRATEOFFSET>;
src/pwm0.rs:pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
src/pwm0.rs:pub type TASKS_SEQSTART = crate::Reg<u32, _TASKS_SEQSTART>;
src/pwm0.rs:pub type TASKS_NEXTSTEP = crate::Reg<u32, _TASKS_NEXTSTEP>;

@jamesmunns
Copy link
Member

Let me know what you think of https://github.com/thalesfragoso/nrf-hal/pull/1/files, if you like it, I can do all the target gating to get the correct tasks/events for each chip. Right now it (probably) only works on the nrf52832.

@jonas-schievink
Copy link
Contributor

Looks good!

* 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]>
@jamesmunns jamesmunns merged commit 8f13227 into nrf-rs:master Jun 28, 2020
@thalesfragoso thalesfragoso deleted the ppi-impl branch July 19, 2020 02:57
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.

4 participants