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

SPI Robustness #2

Merged
merged 2 commits into from
Apr 11, 2024
Merged

SPI Robustness #2

merged 2 commits into from
Apr 11, 2024

Conversation

sakian
Copy link
Collaborator

@sakian sakian commented Apr 11, 2024

Implemented SPI transfer mods from here: atsamd-rs#657. This prevents write and read loops from getting out of sync and requires one read following every write. Also added a reset function to use in SPI fault recovery (reset flags and clears DATA register).

@sakian sakian requested a review from Dridus April 11, 2024 16:53
Comment on lines +1270 to +1276

/// Disable and then re-enable the SPI peripheral
#[inline]
pub fn reset(&mut self) {
self.config.as_mut().regs.disable();
self.config.as_mut().regs.enable();
}
Copy link
Member

Choose a reason for hiding this comment

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

what's this for? it doesn't reset (ala SWRST), and it's not clear from the manual what if anything it does reset

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My hope is that it will reset the DATA register, so that if we've gotten an overflow fault, there's nothing in the data register to be sent after clearing the fault

@sakian sakian merged commit 488a248 into vital-updates Apr 11, 2024
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.

2 participants