@@ -708,6 +708,18 @@ STATIC mp_obj_t rp2pio_statemachine_obj_clear_rxfifo(mp_obj_t self_in) {
708
708
}
709
709
MP_DEFINE_CONST_FUN_OBJ_1 (rp2pio_statemachine_clear_rxfifo_obj , rp2pio_statemachine_obj_clear_rxfifo );
710
710
711
+ //| def clear_txstall(self) -> None:
712
+ //| """Clears the txstall flag."""
713
+ //| ...
714
+ //|
715
+ STATIC mp_obj_t rp2pio_statemachine_obj_clear_txstall (mp_obj_t self_in ) {
716
+ rp2pio_statemachine_obj_t * self = MP_OBJ_TO_PTR (self_in );
717
+ common_hal_rp2pio_statemachine_clear_txstall (self );
718
+ return mp_const_none ;
719
+ }
720
+ MP_DEFINE_CONST_FUN_OBJ_1 (rp2pio_statemachine_clear_txstall_obj , rp2pio_statemachine_obj_clear_txstall );
721
+
722
+
711
723
//| frequency: int
712
724
//| """The actual state machine frequency. This may not match the frequency requested
713
725
//| due to internal limitations."""
@@ -736,6 +748,26 @@ const mp_obj_property_t rp2pio_statemachine_frequency_obj = {
736
748
MP_ROM_NONE },
737
749
};
738
750
751
+ //| txstall: bool
752
+ //| """True when the state machine has stalled due to a full TX FIFO since the last
753
+ //| `clear_txstall` call."""
754
+ //|
755
+
756
+ STATIC mp_obj_t rp2pio_statemachine_obj_get_txstall (mp_obj_t self_in ) {
757
+ rp2pio_statemachine_obj_t * self = MP_OBJ_TO_PTR (self_in );
758
+ check_for_deinit (self );
759
+ return MP_OBJ_NEW_SMALL_INT (common_hal_rp2pio_statemachine_get_txstall (self ));
760
+ }
761
+ MP_DEFINE_CONST_FUN_OBJ_1 (rp2pio_statemachine_get_txstall_obj , rp2pio_statemachine_obj_get_txstall );
762
+
763
+ const mp_obj_property_t rp2pio_statemachine_txstall_obj = {
764
+ .base .type = & mp_type_property ,
765
+ .proxy = {(mp_obj_t )& rp2pio_statemachine_get_txstall_obj ,
766
+ MP_ROM_NONE ,
767
+ MP_ROM_NONE },
768
+ };
769
+
770
+
739
771
//| rxstall: bool
740
772
//| """True when the state machine has stalled due to a full RX FIFO since the last
741
773
//| `clear_rxfifo` call."""
@@ -782,6 +814,7 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
782
814
{ MP_ROM_QSTR (MP_QSTR_restart ), MP_ROM_PTR (& rp2pio_statemachine_restart_obj ) },
783
815
{ MP_ROM_QSTR (MP_QSTR_run ), MP_ROM_PTR (& rp2pio_statemachine_run_obj ) },
784
816
{ MP_ROM_QSTR (MP_QSTR_clear_rxfifo ), MP_ROM_PTR (& rp2pio_statemachine_clear_rxfifo_obj ) },
817
+ { MP_ROM_QSTR (MP_QSTR_clear_txstall ), MP_ROM_PTR (& rp2pio_statemachine_clear_txstall_obj ) },
785
818
786
819
{ MP_ROM_QSTR (MP_QSTR_readinto ), MP_ROM_PTR (& rp2pio_statemachine_readinto_obj ) },
787
820
{ MP_ROM_QSTR (MP_QSTR_write ), MP_ROM_PTR (& rp2pio_statemachine_write_obj ) },
@@ -793,6 +826,7 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
793
826
794
827
{ MP_ROM_QSTR (MP_QSTR_frequency ), MP_ROM_PTR (& rp2pio_statemachine_frequency_obj ) },
795
828
{ MP_ROM_QSTR (MP_QSTR_rxstall ), MP_ROM_PTR (& rp2pio_statemachine_rxstall_obj ) },
829
+ { MP_ROM_QSTR (MP_QSTR_txstall ), MP_ROM_PTR (& rp2pio_statemachine_txstall_obj ) },
796
830
{ MP_ROM_QSTR (MP_QSTR_in_waiting ), MP_ROM_PTR (& rp2pio_statemachine_in_waiting_obj ) },
797
831
};
798
832
STATIC MP_DEFINE_CONST_DICT (rp2pio_statemachine_locals_dict , rp2pio_statemachine_locals_dict_table );
0 commit comments