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

Added U(S)ART DMA traits for HAL serial types #593

Merged
merged 3 commits into from
Apr 9, 2023

Conversation

HelloWorldTeraByte
Copy link
Contributor

DMA traits for the HAL serial type were missing for some of the U(S)ARTs. The trait was only implemented for the PAC in some places.

The users can now for example use.

let dma1 = StreamsTuple::new(cx.device.DMA1);

let uart_dma_cfg = DmaConfig::default().transfer_complete_interrupt(true).memory_increment(true);

let (tx, rx) = Serial::new(
    cx.device.UART4,
    (tx_pin, rx_pin),
    serial::Config::default()
        .baudrate(9600.bps())
        .wordlength_8()
        .parity_none()
        .stopbits(serial::config::StopBits::STOP1)
        .dma(serial::config::DmaConfig::Rx),
    &clocks,
)
.unwrap()
.split();

let mut dma_rx_transfer = Transfer::init_peripheral_to_memory(
    dma1.2,
    rx,
    cx.local.rx_buf0,
    None,
    uart_dma_cfg,
);

Without the pull request, the users would get DMASet<..> not implemented error for some the U(S)ARTs.

@burrbull
Copy link
Contributor

burrbull commented Apr 9, 2023

Note in CHANGELOG.md please

@HelloWorldTeraByte
Copy link
Contributor Author

This is my first pull request here. Do I add it under the unreleased header?

@burrbull
Copy link
Contributor

burrbull commented Apr 9, 2023

yes

@HelloWorldTeraByte
Copy link
Contributor Author

Done.

@burrbull
Copy link
Contributor

burrbull commented Apr 9, 2023

bors r+

@bors bors bot merged commit 5a30cb0 into stm32-rs:master Apr 9, 2023
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