avr-rust / ruduino

Reusable components for the Arduino Uno.
Apache License 2.0
704 stars 50 forks source link

Differences between ports and other registers is jarring #22

Open shepmaster opened 4 years ago

shepmaster commented 4 years ago

If I want a specific pin, I have to do both:

atmega328::port::B5::MASK;
atmega328::UCSR0B::RXCIE0.into();

This is annoying.

Restioson commented 4 years ago

What does the above code do? 😅

shepmaster commented 4 years ago

That specific code does nothing, it’s just examples of how you would get a u8 value corresponding to a specific pin in a specific register.

In context:

https://github.com/shepmaster/rust-arduino-blink-led-no-core-with-cargo/blob/b2d612142b8112a4c70f97b4f74f62be3b9a28c3/src/main.rs#L46-L49

https://github.com/shepmaster/rust-arduino-blink-led-no-core-with-cargo/blob/b2d612142b8112a4c70f97b4f74f62be3b9a28c3/src/main.rs#L475-L481