Skip to content

Conversation

@armandas
Copy link
Contributor

@armandas armandas commented Oct 5, 2024

This is the continuation of the @CoolSlimbo's good work in #562. Closes #561.

I've made the following changes:

  • Resolved the CS issue by adding a new constructor to Spi: new_from_usart
  • Updated usart_spi-feedback example
  • Fixed clippy warnings in the macro as well as some typos in the comments
  • Address some of the remaining comments

I have run the usart_spi-feedback example on an Arduino Mega 2560 and confirmed that USART 1, 2 and 3 work.

@armandas
Copy link
Contributor Author

armandas commented Oct 5, 2024

Hmm, atmega1284p build fails. Seems like avr-device issue?

avr-device-0.5.4/src/devices/atmega2560/usart0/ubrr0.rs

    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub fn bits(&mut self, bits: u16) -> &mut Self {
        unsafe { self.0.bits(bits) };
        self
    }

avr-device-0.5.4/src/devices/atmega1284p/usart0/ubrr0.rs:

    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }

@armandas
Copy link
Contributor Author

Turns out it was not so hard to fix the above issue.

@armandas
Copy link
Contributor Author

@Rahix I think this PR should be good to review. I tried to address the comments in #562, but let me know if there are any changes needed.

CoolSlimbo and others added 27 commits January 6, 2025 02:06
Needs to be tested. Will test via Arudino UNO when I move them ig
… doesn't have the right pins. Will fix that soon. If someone else can test would be great.
(Tested)[Rahix#562 (comment)].

Introduces points for other examples commented in.
Co-authored-by: Armandas Jarušauskas <jarusauskas@gmail.com>
Separate constructor is used to remove the need for passing a CS pin.
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.

Utilising the atmega2560's "USART in SPI Mode"

2 participants