-
Notifications
You must be signed in to change notification settings - Fork 139
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
Working to impl embedded-dma for SPIM #234
base: master
Are you sure you want to change the base?
Conversation
Looks great to me! Perhaps return the buffers aswell in |
mut rx_buffer: RxB, | ||
) -> Result<TransferSplit<T, TxB, RxB>, (Self, Error)> | ||
where | ||
TxB: ReadBuffer<Word = TxW>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TxB: ReadBuffer<Word = TxW>, | |
TxB: ReadBuffer<Word = TxW> + 'static, |
Based on the matrix channel discussion today it looks like we need + 'static bounds on these buffers aswell
) -> Result<TransferSplit<T, TxB, RxB>, (Self, Error)> | ||
where | ||
TxB: ReadBuffer<Word = TxW>, | ||
RxB: WriteBuffer<Word = RxW>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RxB: WriteBuffer<Word = RxW>, | |
RxB: WriteBuffer<Word = RxW> + 'static, |
// | ||
// This event is triggered once both transmitting and receiving are | ||
// done. | ||
while !self.is_spi_dma_transfer_complete() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an alternative to spinning here: could we setup an interrupt and go to sleep? I'm not an expert at all so apologies if this is a silly suggestion.
I'm trying to use this SPI master abstraction, but am struggling because power consumption is very important and I can't see a way to disable the SPI in the current API. This patch would solve the problem for me I think. |
CC @kalkyl, also fixed a SPIS item