Join Serial for USART and UART again. Make inner traits with different implementation for USART and UART. #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cc #630
@burrbull
Main idea
Note that
RegisterBlockImpl
not exports fromstm32f4xx-hal
.Changes in public API
type RegisterBlock;
toInstance
uart::{Serial, Rx, Tx}
RxListen
,TxListen
,Listen
traitsSerial.split
andSerial.release
trait bounds toUART: CommonPins
Rx.join
andTx.join
trait bounds toUART: CommonPins
Questions
PeriAddress
andDMASet
implemented forRx<UART, u8>
, notRx<UART, WORD>
? And Tx too.P.S.
I have tried use
#![feature(specialization)]
and#![feature(min_specialization)]
and failed miserably.The
min_specialization
not does not cover this case, thespecialization
cause ICE.Besides I think that current specialization RFC not suitable for our case at all, because we have
impl InstanceUsart
andimpl InstanceUart
with the same "specialization", but not trait bounds inheritance.