@@ -272,7 +272,8 @@ impl<T: RccEnable> StreamsTuple<T> {
272
272
// The implementation does the heavy lifting of mapping to the right fields on the stream
273
273
macro_rules! dma_stream {
274
274
( $( ( $name: ident, $number: expr , $ifcr: ident, $tcif: ident, $htif: ident, $teif: ident, $dmeif: ident,
275
- $feif: ident, $isr: ident, $tcisr: ident, $htisr: ident) ) ,+ $( , ) * ) => {
275
+ $feif: ident, $isr: ident, $tcisr: ident, $htisr: ident, $teisr: ident, $feisr: ident, $dmeisr: ident) ) ,+
276
+ $( , ) * ) => {
276
277
$(
277
278
impl <I : Instance > Stream for $name<I > {
278
279
@@ -346,6 +347,27 @@ macro_rules! dma_stream {
346
347
dma. $isr. read( ) . $htisr( ) . bit_is_set( )
347
348
}
348
349
350
+ #[ inline( always) ]
351
+ fn get_transfer_error_flag( ) -> bool {
352
+ //NOTE(unsafe) Atomic read with no side effects
353
+ let dma = unsafe { & * I :: ptr( ) } ;
354
+ dma. $isr. read( ) . $teisr( ) . bit_is_set( )
355
+ }
356
+
357
+ #[ inline( always) ]
358
+ fn get_fifo_error_flag( ) -> bool {
359
+ //NOTE(unsafe) Atomic read with no side effects
360
+ let dma = unsafe { & * I :: ptr( ) } ;
361
+ dma. $isr. read( ) . $feisr( ) . bit_is_set( )
362
+ }
363
+
364
+ #[ inline( always) ]
365
+ fn get_direct_mode_error_flag( ) -> bool {
366
+ //NOTE(unsafe) Atomic read with no side effects
367
+ let dma = unsafe { & * I :: ptr( ) } ;
368
+ dma. $isr. read( ) . $dmeisr( ) . bit_is_set( )
369
+ }
370
+
349
371
#[ inline( always) ]
350
372
fn set_peripheral_address( & mut self , value: u32 ) {
351
373
//NOTE(unsafe) We only access the registers that belongs to the StreamX
@@ -598,14 +620,38 @@ macro_rules! dma_stream {
598
620
}
599
621
600
622
dma_stream ! (
601
- ( Stream0 , 0 , lifcr, ctcif0, chtif0, cteif0, cdmeif0, cfeif0, lisr, tcif0, htif0) ,
602
- ( Stream1 , 1 , lifcr, ctcif1, chtif1, cteif1, cdmeif1, cfeif1, lisr, tcif1, htif1) ,
603
- ( Stream2 , 2 , lifcr, ctcif2, chtif2, cteif2, cdmeif2, cfeif2, lisr, tcif2, htif2) ,
604
- ( Stream3 , 3 , lifcr, ctcif3, chtif3, cteif3, cdmeif3, cfeif3, lisr, tcif3, htif3) ,
605
- ( Stream4 , 4 , hifcr, ctcif4, chtif4, cteif4, cdmeif4, cfeif4, hisr, tcif4, htif4) ,
606
- ( Stream5 , 5 , hifcr, ctcif5, chtif5, cteif5, cdmeif5, cfeif5, hisr, tcif5, htif5) ,
607
- ( Stream6 , 6 , hifcr, ctcif6, chtif6, cteif6, cdmeif6, cfeif6, hisr, tcif6, htif6) ,
608
- ( Stream7 , 7 , hifcr, ctcif7, chtif7, cteif7, cdmeif7, cfeif7, hisr, tcif7, htif7) ,
623
+ (
624
+ Stream0 , 0 , lifcr, ctcif0, chtif0, cteif0, cdmeif0, cfeif0, lisr, tcif0, htif0, teif0,
625
+ feif0, dmeif0
626
+ ) ,
627
+ (
628
+ Stream1 , 1 , lifcr, ctcif1, chtif1, cteif1, cdmeif1, cfeif1, lisr, tcif1, htif1, teif1,
629
+ feif1, dmeif1
630
+ ) ,
631
+ (
632
+ Stream2 , 2 , lifcr, ctcif2, chtif2, cteif2, cdmeif2, cfeif2, lisr, tcif2, htif2, teif2,
633
+ feif2, dmeif2
634
+ ) ,
635
+ (
636
+ Stream3 , 3 , lifcr, ctcif3, chtif3, cteif3, cdmeif3, cfeif3, lisr, tcif3, htif3, teif3,
637
+ feif3, dmeif3
638
+ ) ,
639
+ (
640
+ Stream4 , 4 , hifcr, ctcif4, chtif4, cteif4, cdmeif4, cfeif4, hisr, tcif4, htif4, teif4,
641
+ feif4, dmeif4
642
+ ) ,
643
+ (
644
+ Stream5 , 5 , hifcr, ctcif5, chtif5, cteif5, cdmeif5, cfeif5, hisr, tcif5, htif5, teif5,
645
+ feif5, dmeif5
646
+ ) ,
647
+ (
648
+ Stream6 , 6 , hifcr, ctcif6, chtif6, cteif6, cdmeif6, cfeif6, hisr, tcif6, htif6, teif6,
649
+ feif6, dmeif6
650
+ ) ,
651
+ (
652
+ Stream7 , 7 , hifcr, ctcif7, chtif7, cteif7, cdmeif7, cfeif7, hisr, tcif7, htif7, teif7,
653
+ feif7, dmeif7
654
+ ) ,
609
655
) ;
610
656
611
657
// Macro that defines a channel and it's conversion to u8
0 commit comments