nrf-rs / nrf-pacs

Peripheral Access Crates (PACs) for nRF microcontrollers
BSD Zero Clause License
27 stars 12 forks source link

TIMER1/2 should not share the same definition as TIMER0 #1

Open jonas-schievink opened 5 years ago

jonas-schievink commented 5 years ago

At least on the nRF51822 and nRF51422, only TIMER0 can do 8/16/24 and 32-bit operation, while TIMER1 and 2 are restricted to 8/16-bit operation.

Because all of them share the same code, you can still do things like this:

p.device.TIMER1.bitmode.write(|w| w.bitmode()._32bit());

...which will put TIMER1 in either 8 or 16-bit mode, instead of the intended 32-bit mode.

therealprof commented 5 years ago

@jonas-schievink Thanks for noticing. @droogmic maybe something to consider for your Timer rework...

droogmic commented 5 years ago

I took this into account, it was one of the main purposes for my PR, before scope creep ;) Thanks

On Tue, 6 Nov 2018, 09:34 Daniel Egger <notifications@github.com wrote:

@jonas-schievink https://github.com/jonas-schievink Thanks for noticing. @droogmic https://github.com/droogmic maybe something to consider for your Timer rework...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nrf-rs/nrf51/issues/5#issuecomment-436171244, or mute the thread https://github.com/notifications/unsubscribe-auth/AIi9Z5OeCZDntwSwTtM8bM1w0kn1Ub8Oks5usUl3gaJpZM4YPgT4 .

jonas-schievink commented 5 years ago

Did the repo move make the Pull Request disappear? I don't see it in the commit history or PR list.

EDIT: Nevermind https://github.com/nrf-rs/nrf51-hal/pull/12