Rahix / avr-device

Register access crate for AVR microcontrollers
Apache License 2.0
168 stars 67 forks source link

Patch attiny85 PCMSK register #131

Closed mgrunwald closed 8 months ago

mgrunwald commented 1 year ago

Fix https://github.com/Rahix/avr-device/issues/130 by adding fields for pins where the pin change interrupt can be enabled. I.e. it is possible to use this

self.exint.pcmsk.modify(|_, w| w.pcint0().set_bit());

instead of this:

self.exint.pcmsk.modify(|_, w| w.bits(1));

Since the two most significant bits of PCMSK on the attiny85 are reserved, it would make sense to change the write constraint to [0, 63], but I failed to achieve this. the code is commented in commit https://github.com/Rahix/avr-device/commit/78b331fd41c9228ba10e3354f5c7d1482eae47e0 . Because of this, the PR is still a draft.