dd tx_pulldown pin

This commit is contained in:
Jörn-Michael Miehe 2024-03-25 14:49:27 +00:00
parent e88f73bf81
commit f5c4b5faff
2 changed files with 4 additions and 0 deletions

View file

@ -76,6 +76,7 @@ impl<const DMX_LEN: usize> TxDMA<DMX_LEN> {
#[allow(clippy::upper_case_acronyms)] #[allow(clippy::upper_case_acronyms)]
pub struct DMX<const DMX_LEN: usize> { pub struct DMX<const DMX_LEN: usize> {
tx_universe: DMXUniverse<DMX_LEN>, tx_universe: DMXUniverse<DMX_LEN>,
tx_pulldown: gpio::PA8<gpio::Output<gpio::OpenDrain>>,
sender: TxDMA<DMX_LEN>, sender: TxDMA<DMX_LEN>,
} }
@ -84,6 +85,7 @@ impl<const DMX_LEN: usize> DMX<DMX_LEN> {
pub fn new( pub fn new(
mem: &'static mut [u8], mem: &'static mut [u8],
mut dma_channel: dma::dma1::C4, mut dma_channel: dma::dma1::C4,
pa8: gpio::PA8,
pa9: gpio::PA9, pa9: gpio::PA9,
pa10: gpio::PA10, pa10: gpio::PA10,
acrh: &mut gpio::Cr<'A', true>, acrh: &mut gpio::Cr<'A', true>,
@ -125,6 +127,7 @@ impl<const DMX_LEN: usize> DMX<DMX_LEN> {
Self { Self {
tx_universe, tx_universe,
tx_pulldown: pa8.into_open_drain_output_with_state(acrh, gpio::PinState::High),
sender: TxDMA::new(TxDMAIdle { sender: TxDMA::new(TxDMAIdle {
tx: serial.tx.with_dma(dma_channel), tx: serial.tx.with_dma(dma_channel),
buffer: tx_buffer, buffer: tx_buffer,

View file

@ -82,6 +82,7 @@ mod app {
dmx: DMX::new( dmx: DMX::new(
cx.local.buffer, cx.local.buffer,
dma1.4, dma1.4,
gpioa.pa8,
gpioa.pa9, gpioa.pa9,
gpioa.pa10, gpioa.pa10,
&mut gpioa.crh, &mut gpioa.crh,