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

cpu/sam0_common: Implement time-sharing of SERCOMs #21029

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Nov 27, 2024

  1. cpu/sam0_common: implement SERCOM time-sharing

    This adds a `periph_sercom` feature and implementation which
    `periph_i2c`, `periph_uart`, and `periph_spi` are implemented on top.
    This allows for sharing a single SERCOM instance to provide multiple
    serial interfaces (in round-robin time-sharing fashion).
    
    Note: In practice, a SERCOM can often not be shared if it needs to
          provide an UART.
    
    Background:
    
    While code using the I2C/SPI APIs is already optimized to share the
    peripheral with `i2c_acquire()`/`spi_acquire()` and
    `i2c_release()`/`spi_release()`, UARTs are typically not shared and most
    users will not call `uart_poweron()` and `uart_poweroff()` to only have
    the SERCOM in UART mode when actually needed. Worse: For many use cases
    (such as stdin), the UART will need to be constantly running, as
    receiving data happens asynchronously at unpredictable points in time.
    maribu committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    10cbb1b View commit details
    Browse the repository at this point in the history
  2. boards/adafruit-metro-m4-express: make use of SERCOM sharing

    Now that time-sharing SERCOMs is possible, we can provide the SPI on
    D11/D12/D13 (backed by SERCOM3) also when the UART on D0/D1 (also backed
    by SERCOM3) is used.
    maribu committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    f18c9a9 View commit details
    Browse the repository at this point in the history
  3. boards: fix whitespace style issues

    This adds the space missing after the comma in `GPIO_PORT(<port>,<pin>`
    at multiple places
    maribu committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    bd365b1 View commit details
    Browse the repository at this point in the history