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

Add imxrt1010 sai pins #40

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/imxrt1010/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mod flexpwm;
mod lpi2c;
mod lpspi;
mod lpuart;
mod sai;

mod pads;
pub use pads::*;
Expand Down
43 changes: 43 additions & 0 deletions src/imxrt1010/sai.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//! SAI / I2S pin implementation

use super::{gpio::*, gpio_sd::*};
use crate::{consts::*, sai::*, Daisy};

/// SAI1 multiplexed TX / RX pin
///
/// Implements both `RxDataSignal` and `TxDataSignal`.
pub enum TxData1RxData1 {}

impl Signal for TxData1RxData1 {}
impl TxDataSignal for TxData1RxData1 {
type Index = U1;
}
impl RxDataSignal for TxData1RxData1 {
type Index = U1;
}
impl private::Sealed for TxData1RxData1 {}

//
// SAI1
//

sai! { module: U1, alt: 0, pad: GPIO_08, signal: Mclk, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_01, signal: RxBclk, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_03, signal: RxData, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_02, signal: RxSync, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_06, signal: TxBclk, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_04, signal: TxData, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_05, signal: TxData1RxData1, daisy: None }
sai! { module: U1, alt: 0, pad: GPIO_07, signal: TxSync, daisy: None }

//
// SAI3
//

sai! { module: U3, alt: 1, pad: GPIO_00, signal: Mclk, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_13, signal: RxBclk, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_03, signal: RxData, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_04, signal: RxSync, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_01, signal: TxBclk, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_02, signal: TxData, daisy: None }
sai! { module: U3, alt: 1, pad: GPIO_SD_00, signal: TxSync, daisy: None }
Loading