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

Implement Rx/Tx reunification for Serial #390

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jan 9, 2022

  1. Support pin type erasure in Serial

    There are many possible pin combinations for a Serial peripheral. Many
    support at least one alternative pin group to be used, and in addition
    to that, each pin can also be configured differently. For instance,
    instead of the common Output<PushPull> with an Input<Floating>, one
    could also use Output<OpenDrain> and Input<PullUp>, e.g. when
    interfacing with a 1-Wire bus.
    
    This pin information is already lost when splitting the Serial object
    into Rx/Tx. In order to allow a reunification into a Serial object which
    represents ownership of both Tx and Rx, we need a Serial variant which
    has that pin information erased.
    horazont committed Jan 9, 2022
    Configuration menu
    Copy the full SHA
    1c285b1 View commit details
    Browse the repository at this point in the history
  2. Support reunite in serial::{Rx,Tx}

    This becomes relevant as more functions like reconfigure are added to the
    Serial structs. We use the Tx to stash away the usart instance used by
    the (Erased-)Serial struct, but this choice is arbitrary and irrelevant
    because it is zero-sized anyway.
    
    Fixes stm32-rs#386.
    horazont committed Jan 9, 2022
    Configuration menu
    Copy the full SHA
    8721f69 View commit details
    Browse the repository at this point in the history