diff options
| -rw-r--r-- | embassy-stm32/src/xspi/mod.rs | 264 |
1 files changed, 131 insertions, 133 deletions
diff --git a/embassy-stm32/src/xspi/mod.rs b/embassy-stm32/src/xspi/mod.rs index 3b5406a57..c024b2ed6 100644 --- a/embassy-stm32/src/xspi/mod.rs +++ b/embassy-stm32/src/xspi/mod.rs | |||
| @@ -8,7 +8,7 @@ pub mod enums; | |||
| 8 | use core::marker::PhantomData; | 8 | use core::marker::PhantomData; |
| 9 | 9 | ||
| 10 | use embassy_embedded_hal::{GetConfig, SetConfig}; | 10 | use embassy_embedded_hal::{GetConfig, SetConfig}; |
| 11 | use embassy_hal_internal::{into_ref, PeripheralRef}; | 11 | use embassy_hal_internal::PeripheralType; |
| 12 | pub use enums::*; | 12 | pub use enums::*; |
| 13 | 13 | ||
| 14 | use crate::dma::{word, ChannelAndRequest}; | 14 | use crate::dma::{word, ChannelAndRequest}; |
| @@ -19,7 +19,7 @@ use crate::pac::xspi::Xspi as Regs; | |||
| 19 | #[cfg(xspim_v1)] | 19 | #[cfg(xspim_v1)] |
| 20 | use crate::pac::xspim::Xspim; | 20 | use crate::pac::xspim::Xspim; |
| 21 | use crate::rcc::{self, RccPeripheral}; | 21 | use crate::rcc::{self, RccPeripheral}; |
| 22 | use crate::{peripherals, Peripheral}; | 22 | use crate::{peripherals, Peri}; |
| 23 | 23 | ||
| 24 | /// XPSI driver config. | 24 | /// XPSI driver config. |
| 25 | #[derive(Clone, Copy)] | 25 | #[derive(Clone, Copy)] |
| @@ -157,28 +157,28 @@ pub enum XspiError { | |||
| 157 | 157 | ||
| 158 | /// XSPI driver. | 158 | /// XSPI driver. |
| 159 | pub struct Xspi<'d, T: Instance, M: PeriMode> { | 159 | pub struct Xspi<'d, T: Instance, M: PeriMode> { |
| 160 | _peri: PeripheralRef<'d, T>, | 160 | _peri: Peri<'d, T>, |
| 161 | clk: Option<PeripheralRef<'d, AnyPin>>, | 161 | clk: Option<Peri<'d, AnyPin>>, |
| 162 | d0: Option<PeripheralRef<'d, AnyPin>>, | 162 | d0: Option<Peri<'d, AnyPin>>, |
| 163 | d1: Option<PeripheralRef<'d, AnyPin>>, | 163 | d1: Option<Peri<'d, AnyPin>>, |
| 164 | d2: Option<PeripheralRef<'d, AnyPin>>, | 164 | d2: Option<Peri<'d, AnyPin>>, |
| 165 | d3: Option<PeripheralRef<'d, AnyPin>>, | 165 | d3: Option<Peri<'d, AnyPin>>, |
| 166 | d4: Option<PeripheralRef<'d, AnyPin>>, | 166 | d4: Option<Peri<'d, AnyPin>>, |
| 167 | d5: Option<PeripheralRef<'d, AnyPin>>, | 167 | d5: Option<Peri<'d, AnyPin>>, |
| 168 | d6: Option<PeripheralRef<'d, AnyPin>>, | 168 | d6: Option<Peri<'d, AnyPin>>, |
| 169 | d7: Option<PeripheralRef<'d, AnyPin>>, | 169 | d7: Option<Peri<'d, AnyPin>>, |
| 170 | d8: Option<PeripheralRef<'d, AnyPin>>, | 170 | d8: Option<Peri<'d, AnyPin>>, |
| 171 | d9: Option<PeripheralRef<'d, AnyPin>>, | 171 | d9: Option<Peri<'d, AnyPin>>, |
| 172 | d10: Option<PeripheralRef<'d, AnyPin>>, | 172 | d10: Option<Peri<'d, AnyPin>>, |
| 173 | d11: Option<PeripheralRef<'d, AnyPin>>, | 173 | d11: Option<Peri<'d, AnyPin>>, |
| 174 | d12: Option<PeripheralRef<'d, AnyPin>>, | 174 | d12: Option<Peri<'d, AnyPin>>, |
| 175 | d13: Option<PeripheralRef<'d, AnyPin>>, | 175 | d13: Option<Peri<'d, AnyPin>>, |
| 176 | d14: Option<PeripheralRef<'d, AnyPin>>, | 176 | d14: Option<Peri<'d, AnyPin>>, |
| 177 | d15: Option<PeripheralRef<'d, AnyPin>>, | 177 | d15: Option<Peri<'d, AnyPin>>, |
| 178 | ncs1: Option<PeripheralRef<'d, AnyPin>>, | 178 | ncs1: Option<Peri<'d, AnyPin>>, |
| 179 | ncs2: Option<PeripheralRef<'d, AnyPin>>, | 179 | ncs2: Option<Peri<'d, AnyPin>>, |
| 180 | dqs0: Option<PeripheralRef<'d, AnyPin>>, | 180 | dqs0: Option<Peri<'d, AnyPin>>, |
| 181 | dqs1: Option<PeripheralRef<'d, AnyPin>>, | 181 | dqs1: Option<Peri<'d, AnyPin>>, |
| 182 | dma: Option<ChannelAndRequest<'d>>, | 182 | dma: Option<ChannelAndRequest<'d>>, |
| 183 | _phantom: PhantomData<M>, | 183 | _phantom: PhantomData<M>, |
| 184 | config: Config, | 184 | config: Config, |
| @@ -251,35 +251,33 @@ impl<'d, T: Instance, M: PeriMode> Xspi<'d, T, M> { | |||
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | fn new_inner( | 253 | fn new_inner( |
| 254 | peri: impl Peripheral<P = T> + 'd, | 254 | peri: Peri<'d, T>, |
| 255 | d0: Option<PeripheralRef<'d, AnyPin>>, | 255 | d0: Option<Peri<'d, AnyPin>>, |
| 256 | d1: Option<PeripheralRef<'d, AnyPin>>, | 256 | d1: Option<Peri<'d, AnyPin>>, |
| 257 | d2: Option<PeripheralRef<'d, AnyPin>>, | 257 | d2: Option<Peri<'d, AnyPin>>, |
| 258 | d3: Option<PeripheralRef<'d, AnyPin>>, | 258 | d3: Option<Peri<'d, AnyPin>>, |
| 259 | d4: Option<PeripheralRef<'d, AnyPin>>, | 259 | d4: Option<Peri<'d, AnyPin>>, |
| 260 | d5: Option<PeripheralRef<'d, AnyPin>>, | 260 | d5: Option<Peri<'d, AnyPin>>, |
| 261 | d6: Option<PeripheralRef<'d, AnyPin>>, | 261 | d6: Option<Peri<'d, AnyPin>>, |
| 262 | d7: Option<PeripheralRef<'d, AnyPin>>, | 262 | d7: Option<Peri<'d, AnyPin>>, |
| 263 | d8: Option<PeripheralRef<'d, AnyPin>>, | 263 | d8: Option<Peri<'d, AnyPin>>, |
| 264 | d9: Option<PeripheralRef<'d, AnyPin>>, | 264 | d9: Option<Peri<'d, AnyPin>>, |
| 265 | d10: Option<PeripheralRef<'d, AnyPin>>, | 265 | d10: Option<Peri<'d, AnyPin>>, |
| 266 | d11: Option<PeripheralRef<'d, AnyPin>>, | 266 | d11: Option<Peri<'d, AnyPin>>, |
| 267 | d12: Option<PeripheralRef<'d, AnyPin>>, | 267 | d12: Option<Peri<'d, AnyPin>>, |
| 268 | d13: Option<PeripheralRef<'d, AnyPin>>, | 268 | d13: Option<Peri<'d, AnyPin>>, |
| 269 | d14: Option<PeripheralRef<'d, AnyPin>>, | 269 | d14: Option<Peri<'d, AnyPin>>, |
| 270 | d15: Option<PeripheralRef<'d, AnyPin>>, | 270 | d15: Option<Peri<'d, AnyPin>>, |
| 271 | clk: Option<PeripheralRef<'d, AnyPin>>, | 271 | clk: Option<Peri<'d, AnyPin>>, |
| 272 | ncs1: Option<PeripheralRef<'d, AnyPin>>, | 272 | ncs1: Option<Peri<'d, AnyPin>>, |
| 273 | ncs2: Option<PeripheralRef<'d, AnyPin>>, | 273 | ncs2: Option<Peri<'d, AnyPin>>, |
| 274 | dqs0: Option<PeripheralRef<'d, AnyPin>>, | 274 | dqs0: Option<Peri<'d, AnyPin>>, |
| 275 | dqs1: Option<PeripheralRef<'d, AnyPin>>, | 275 | dqs1: Option<Peri<'d, AnyPin>>, |
| 276 | dma: Option<ChannelAndRequest<'d>>, | 276 | dma: Option<ChannelAndRequest<'d>>, |
| 277 | config: Config, | 277 | config: Config, |
| 278 | width: XspiWidth, | 278 | width: XspiWidth, |
| 279 | dual_quad: bool, | 279 | dual_quad: bool, |
| 280 | ) -> Self { | 280 | ) -> Self { |
| 281 | into_ref!(peri); | ||
| 282 | |||
| 283 | #[cfg(xspim_v1)] | 281 | #[cfg(xspim_v1)] |
| 284 | { | 282 | { |
| 285 | // RCC for xspim should be enabled before writing register | 283 | // RCC for xspim should be enabled before writing register |
| @@ -656,11 +654,11 @@ impl<'d, T: Instance, M: PeriMode> Xspi<'d, T, M> { | |||
| 656 | impl<'d, T: Instance> Xspi<'d, T, Blocking> { | 654 | impl<'d, T: Instance> Xspi<'d, T, Blocking> { |
| 657 | /// Create new blocking XSPI driver for a single spi external chip | 655 | /// Create new blocking XSPI driver for a single spi external chip |
| 658 | pub fn new_blocking_singlespi( | 656 | pub fn new_blocking_singlespi( |
| 659 | peri: impl Peripheral<P = T> + 'd, | 657 | peri: Peri<'d, T>, |
| 660 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 658 | clk: Peri<'d, impl CLKPin<T>>, |
| 661 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 659 | d0: Peri<'d, impl D0Pin<T>>, |
| 662 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 660 | d1: Peri<'d, impl D1Pin<T>>, |
| 663 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 661 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 664 | config: Config, | 662 | config: Config, |
| 665 | ) -> Self { | 663 | ) -> Self { |
| 666 | Self::new_inner( | 664 | Self::new_inner( |
| @@ -695,11 +693,11 @@ impl<'d, T: Instance> Xspi<'d, T, Blocking> { | |||
| 695 | 693 | ||
| 696 | /// Create new blocking XSPI driver for a dualspi external chip | 694 | /// Create new blocking XSPI driver for a dualspi external chip |
| 697 | pub fn new_blocking_dualspi( | 695 | pub fn new_blocking_dualspi( |
| 698 | peri: impl Peripheral<P = T> + 'd, | 696 | peri: Peri<'d, T>, |
| 699 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 697 | clk: Peri<'d, impl CLKPin<T>>, |
| 700 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 698 | d0: Peri<'d, impl D0Pin<T>>, |
| 701 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 699 | d1: Peri<'d, impl D1Pin<T>>, |
| 702 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 700 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 703 | config: Config, | 701 | config: Config, |
| 704 | ) -> Self { | 702 | ) -> Self { |
| 705 | Self::new_inner( | 703 | Self::new_inner( |
| @@ -737,13 +735,13 @@ impl<'d, T: Instance> Xspi<'d, T, Blocking> { | |||
| 737 | 735 | ||
| 738 | /// Create new blocking XSPI driver for a quadspi external chip | 736 | /// Create new blocking XSPI driver for a quadspi external chip |
| 739 | pub fn new_blocking_quadspi( | 737 | pub fn new_blocking_quadspi( |
| 740 | peri: impl Peripheral<P = T> + 'd, | 738 | peri: Peri<'d, T>, |
| 741 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 739 | clk: Peri<'d, impl CLKPin<T>>, |
| 742 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 740 | d0: Peri<'d, impl D0Pin<T>>, |
| 743 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 741 | d1: Peri<'d, impl D1Pin<T>>, |
| 744 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 742 | d2: Peri<'d, impl D2Pin<T>>, |
| 745 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 743 | d3: Peri<'d, impl D3Pin<T>>, |
| 746 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 744 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 747 | config: Config, | 745 | config: Config, |
| 748 | ) -> Self { | 746 | ) -> Self { |
| 749 | Self::new_inner( | 747 | Self::new_inner( |
| @@ -781,17 +779,17 @@ impl<'d, T: Instance> Xspi<'d, T, Blocking> { | |||
| 781 | 779 | ||
| 782 | /// Create new blocking XSPI driver for two quadspi external chips | 780 | /// Create new blocking XSPI driver for two quadspi external chips |
| 783 | pub fn new_blocking_dualquadspi( | 781 | pub fn new_blocking_dualquadspi( |
| 784 | peri: impl Peripheral<P = T> + 'd, | 782 | peri: Peri<'d, T>, |
| 785 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 783 | clk: Peri<'d, impl CLKPin<T>>, |
| 786 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 784 | d0: Peri<'d, impl D0Pin<T>>, |
| 787 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 785 | d1: Peri<'d, impl D1Pin<T>>, |
| 788 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 786 | d2: Peri<'d, impl D2Pin<T>>, |
| 789 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 787 | d3: Peri<'d, impl D3Pin<T>>, |
| 790 | d4: impl Peripheral<P = impl D4Pin<T>> + 'd, | 788 | d4: Peri<'d, impl D4Pin<T>>, |
| 791 | d5: impl Peripheral<P = impl D5Pin<T>> + 'd, | 789 | d5: Peri<'d, impl D5Pin<T>>, |
| 792 | d6: impl Peripheral<P = impl D6Pin<T>> + 'd, | 790 | d6: Peri<'d, impl D6Pin<T>>, |
| 793 | d7: impl Peripheral<P = impl D7Pin<T>> + 'd, | 791 | d7: Peri<'d, impl D7Pin<T>>, |
| 794 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 792 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 795 | config: Config, | 793 | config: Config, |
| 796 | ) -> Self { | 794 | ) -> Self { |
| 797 | Self::new_inner( | 795 | Self::new_inner( |
| @@ -829,17 +827,17 @@ impl<'d, T: Instance> Xspi<'d, T, Blocking> { | |||
| 829 | 827 | ||
| 830 | /// Create new blocking XSPI driver for xspi external chips | 828 | /// Create new blocking XSPI driver for xspi external chips |
| 831 | pub fn new_blocking_xspi( | 829 | pub fn new_blocking_xspi( |
| 832 | peri: impl Peripheral<P = T> + 'd, | 830 | peri: Peri<'d, T>, |
| 833 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 831 | clk: Peri<'d, impl CLKPin<T>>, |
| 834 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 832 | d0: Peri<'d, impl D0Pin<T>>, |
| 835 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 833 | d1: Peri<'d, impl D1Pin<T>>, |
| 836 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 834 | d2: Peri<'d, impl D2Pin<T>>, |
| 837 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 835 | d3: Peri<'d, impl D3Pin<T>>, |
| 838 | d4: impl Peripheral<P = impl D4Pin<T>> + 'd, | 836 | d4: Peri<'d, impl D4Pin<T>>, |
| 839 | d5: impl Peripheral<P = impl D5Pin<T>> + 'd, | 837 | d5: Peri<'d, impl D5Pin<T>>, |
| 840 | d6: impl Peripheral<P = impl D6Pin<T>> + 'd, | 838 | d6: Peri<'d, impl D6Pin<T>>, |
| 841 | d7: impl Peripheral<P = impl D7Pin<T>> + 'd, | 839 | d7: Peri<'d, impl D7Pin<T>>, |
| 842 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 840 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 843 | config: Config, | 841 | config: Config, |
| 844 | ) -> Self { | 842 | ) -> Self { |
| 845 | Self::new_inner( | 843 | Self::new_inner( |
| @@ -879,12 +877,12 @@ impl<'d, T: Instance> Xspi<'d, T, Blocking> { | |||
| 879 | impl<'d, T: Instance> Xspi<'d, T, Async> { | 877 | impl<'d, T: Instance> Xspi<'d, T, Async> { |
| 880 | /// Create new blocking XSPI driver for a single spi external chip | 878 | /// Create new blocking XSPI driver for a single spi external chip |
| 881 | pub fn new_singlespi( | 879 | pub fn new_singlespi( |
| 882 | peri: impl Peripheral<P = T> + 'd, | 880 | peri: Peri<'d, T>, |
| 883 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 881 | clk: Peri<'d, impl CLKPin<T>>, |
| 884 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 882 | d0: Peri<'d, impl D0Pin<T>>, |
| 885 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 883 | d1: Peri<'d, impl D1Pin<T>>, |
| 886 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 884 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 887 | dma: impl Peripheral<P = impl XDma<T>> + 'd, | 885 | dma: Peri<'d, impl XDma<T>>, |
| 888 | config: Config, | 886 | config: Config, |
| 889 | ) -> Self { | 887 | ) -> Self { |
| 890 | Self::new_inner( | 888 | Self::new_inner( |
| @@ -919,12 +917,12 @@ impl<'d, T: Instance> Xspi<'d, T, Async> { | |||
| 919 | 917 | ||
| 920 | /// Create new blocking XSPI driver for a dualspi external chip | 918 | /// Create new blocking XSPI driver for a dualspi external chip |
| 921 | pub fn new_dualspi( | 919 | pub fn new_dualspi( |
| 922 | peri: impl Peripheral<P = T> + 'd, | 920 | peri: Peri<'d, T>, |
| 923 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 921 | clk: Peri<'d, impl CLKPin<T>>, |
| 924 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 922 | d0: Peri<'d, impl D0Pin<T>>, |
| 925 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 923 | d1: Peri<'d, impl D1Pin<T>>, |
| 926 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 924 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 927 | dma: impl Peripheral<P = impl XDma<T>> + 'd, | 925 | dma: Peri<'d, impl XDma<T>>, |
| 928 | config: Config, | 926 | config: Config, |
| 929 | ) -> Self { | 927 | ) -> Self { |
| 930 | Self::new_inner( | 928 | Self::new_inner( |
| @@ -962,14 +960,14 @@ impl<'d, T: Instance> Xspi<'d, T, Async> { | |||
| 962 | 960 | ||
| 963 | /// Create new blocking XSPI driver for a quadspi external chip | 961 | /// Create new blocking XSPI driver for a quadspi external chip |
| 964 | pub fn new_quadspi( | 962 | pub fn new_quadspi( |
| 965 | peri: impl Peripheral<P = T> + 'd, | 963 | peri: Peri<'d, T>, |
| 966 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 964 | clk: Peri<'d, impl CLKPin<T>>, |
| 967 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 965 | d0: Peri<'d, impl D0Pin<T>>, |
| 968 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 966 | d1: Peri<'d, impl D1Pin<T>>, |
| 969 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 967 | d2: Peri<'d, impl D2Pin<T>>, |
| 970 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 968 | d3: Peri<'d, impl D3Pin<T>>, |
| 971 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 969 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 972 | dma: impl Peripheral<P = impl XDma<T>> + 'd, | 970 | dma: Peri<'d, impl XDma<T>>, |
| 973 | config: Config, | 971 | config: Config, |
| 974 | ) -> Self { | 972 | ) -> Self { |
| 975 | Self::new_inner( | 973 | Self::new_inner( |
| @@ -1007,18 +1005,18 @@ impl<'d, T: Instance> Xspi<'d, T, Async> { | |||
| 1007 | 1005 | ||
| 1008 | /// Create new blocking XSPI driver for two quadspi external chips | 1006 | /// Create new blocking XSPI driver for two quadspi external chips |
| 1009 | pub fn new_dualquadspi( | 1007 | pub fn new_dualquadspi( |
| 1010 | peri: impl Peripheral<P = T> + 'd, | 1008 | peri: Peri<'d, T>, |
| 1011 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 1009 | clk: Peri<'d, impl CLKPin<T>>, |
| 1012 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 1010 | d0: Peri<'d, impl D0Pin<T>>, |
| 1013 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 1011 | d1: Peri<'d, impl D1Pin<T>>, |
| 1014 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 1012 | d2: Peri<'d, impl D2Pin<T>>, |
| 1015 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 1013 | d3: Peri<'d, impl D3Pin<T>>, |
| 1016 | d4: impl Peripheral<P = impl D4Pin<T>> + 'd, | 1014 | d4: Peri<'d, impl D4Pin<T>>, |
| 1017 | d5: impl Peripheral<P = impl D5Pin<T>> + 'd, | 1015 | d5: Peri<'d, impl D5Pin<T>>, |
| 1018 | d6: impl Peripheral<P = impl D6Pin<T>> + 'd, | 1016 | d6: Peri<'d, impl D6Pin<T>>, |
| 1019 | d7: impl Peripheral<P = impl D7Pin<T>> + 'd, | 1017 | d7: Peri<'d, impl D7Pin<T>>, |
| 1020 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 1018 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 1021 | dma: impl Peripheral<P = impl XDma<T>> + 'd, | 1019 | dma: Peri<'d, impl XDma<T>>, |
| 1022 | config: Config, | 1020 | config: Config, |
| 1023 | ) -> Self { | 1021 | ) -> Self { |
| 1024 | Self::new_inner( | 1022 | Self::new_inner( |
| @@ -1056,18 +1054,18 @@ impl<'d, T: Instance> Xspi<'d, T, Async> { | |||
| 1056 | 1054 | ||
| 1057 | /// Create new blocking XSPI driver for xspi external chips | 1055 | /// Create new blocking XSPI driver for xspi external chips |
| 1058 | pub fn new_xspi( | 1056 | pub fn new_xspi( |
| 1059 | peri: impl Peripheral<P = T> + 'd, | 1057 | peri: Peri<'d, T>, |
| 1060 | clk: impl Peripheral<P = impl CLKPin<T>> + 'd, | 1058 | clk: Peri<'d, impl CLKPin<T>>, |
| 1061 | d0: impl Peripheral<P = impl D0Pin<T>> + 'd, | 1059 | d0: Peri<'d, impl D0Pin<T>>, |
| 1062 | d1: impl Peripheral<P = impl D1Pin<T>> + 'd, | 1060 | d1: Peri<'d, impl D1Pin<T>>, |
| 1063 | d2: impl Peripheral<P = impl D2Pin<T>> + 'd, | 1061 | d2: Peri<'d, impl D2Pin<T>>, |
| 1064 | d3: impl Peripheral<P = impl D3Pin<T>> + 'd, | 1062 | d3: Peri<'d, impl D3Pin<T>>, |
| 1065 | d4: impl Peripheral<P = impl D4Pin<T>> + 'd, | 1063 | d4: Peri<'d, impl D4Pin<T>>, |
| 1066 | d5: impl Peripheral<P = impl D5Pin<T>> + 'd, | 1064 | d5: Peri<'d, impl D5Pin<T>>, |
| 1067 | d6: impl Peripheral<P = impl D6Pin<T>> + 'd, | 1065 | d6: Peri<'d, impl D6Pin<T>>, |
| 1068 | d7: impl Peripheral<P = impl D7Pin<T>> + 'd, | 1066 | d7: Peri<'d, impl D7Pin<T>>, |
| 1069 | ncs: impl Peripheral<P = impl NCS1Pin<T>> + 'd, | 1067 | ncs: Peri<'d, impl NCS1Pin<T>>, |
| 1070 | dma: impl Peripheral<P = impl XDma<T>> + 'd, | 1068 | dma: Peri<'d, impl XDma<T>>, |
| 1071 | config: Config, | 1069 | config: Config, |
| 1072 | ) -> Self { | 1070 | ) -> Self { |
| 1073 | Self::new_inner( | 1071 | Self::new_inner( |
| @@ -1296,12 +1294,12 @@ pub(crate) trait SealedInstance { | |||
| 1296 | /// XSPI instance trait. | 1294 | /// XSPI instance trait. |
| 1297 | #[cfg(xspim_v1)] | 1295 | #[cfg(xspim_v1)] |
| 1298 | #[allow(private_bounds)] | 1296 | #[allow(private_bounds)] |
| 1299 | pub trait Instance: Peripheral<P = Self> + SealedInstance + RccPeripheral + SealedXspimInstance {} | 1297 | pub trait Instance: SealedInstance + PeripheralType + RccPeripheral + SealedXspimInstance {} |
| 1300 | 1298 | ||
| 1301 | /// XSPI instance trait. | 1299 | /// XSPI instance trait. |
| 1302 | #[cfg(not(xspim_v1))] | 1300 | #[cfg(not(xspim_v1))] |
| 1303 | #[allow(private_bounds)] | 1301 | #[allow(private_bounds)] |
| 1304 | pub trait Instance: Peripheral<P = Self> + SealedInstance + RccPeripheral {} | 1302 | pub trait Instance: SealedInstance + PeripheralType + RccPeripheral {} |
| 1305 | 1303 | ||
| 1306 | pin_trait!(D0Pin, Instance); | 1304 | pin_trait!(D0Pin, Instance); |
| 1307 | pin_trait!(D1Pin, Instance); | 1305 | pin_trait!(D1Pin, Instance); |
