@@ -813,6 +813,35 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_in_waiting_obj, rp2pio_statema
813813MP_PROPERTY_GETTER (rp2pio_statemachine_in_waiting_obj ,
814814 (mp_obj_t )& rp2pio_statemachine_get_in_waiting_obj );
815815
816+ //| offset: int
817+ //| """The instruction offset where the program was actually loaded"""
818+ //|
819+
820+ static mp_obj_t rp2pio_statemachine_obj_get_offset (mp_obj_t self_in ) {
821+ rp2pio_statemachine_obj_t * self = MP_OBJ_TO_PTR (self_in );
822+ check_for_deinit (self );
823+ return MP_OBJ_NEW_SMALL_INT (common_hal_rp2pio_statemachine_get_offset (self ));
824+ }
825+ MP_DEFINE_CONST_FUN_OBJ_1 (rp2pio_statemachine_get_offset_obj , rp2pio_statemachine_obj_get_offset );
826+
827+ MP_PROPERTY_GETTER (rp2pio_statemachine_offset_obj ,
828+ (mp_obj_t )& rp2pio_statemachine_get_offset_obj );
829+
830+ //| pc: int
831+ //| """The current program counter of the state machine"""
832+ //|
833+
834+ static mp_obj_t rp2pio_statemachine_obj_get_pc (mp_obj_t self_in ) {
835+ rp2pio_statemachine_obj_t * self = MP_OBJ_TO_PTR (self_in );
836+ check_for_deinit (self );
837+ return MP_OBJ_NEW_SMALL_INT (common_hal_rp2pio_statemachine_get_pc (self ));
838+ }
839+ MP_DEFINE_CONST_FUN_OBJ_1 (rp2pio_statemachine_get_pc_obj , rp2pio_statemachine_obj_get_pc );
840+
841+ MP_PROPERTY_GETTER (rp2pio_statemachine_pc_obj ,
842+ (mp_obj_t )& rp2pio_statemachine_get_pc_obj );
843+
844+
816845static const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table [] = {
817846 { MP_ROM_QSTR (MP_QSTR_deinit ), MP_ROM_PTR (& rp2pio_statemachine_deinit_obj ) },
818847 { MP_ROM_QSTR (MP_QSTR___enter__ ), MP_ROM_PTR (& default___enter___obj ) },
@@ -836,6 +865,9 @@ static const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
836865 { MP_ROM_QSTR (MP_QSTR_rxstall ), MP_ROM_PTR (& rp2pio_statemachine_rxstall_obj ) },
837866 { MP_ROM_QSTR (MP_QSTR_txstall ), MP_ROM_PTR (& rp2pio_statemachine_txstall_obj ) },
838867 { MP_ROM_QSTR (MP_QSTR_in_waiting ), MP_ROM_PTR (& rp2pio_statemachine_in_waiting_obj ) },
868+
869+ { MP_ROM_QSTR (MP_QSTR_offset ), MP_ROM_PTR (& rp2pio_statemachine_offset_obj ) },
870+ { MP_ROM_QSTR (MP_QSTR_pc ), MP_ROM_PTR (& rp2pio_statemachine_pc_obj ) },
839871};
840872static MP_DEFINE_CONST_DICT (rp2pio_statemachine_locals_dict , rp2pio_statemachine_locals_dict_table ) ;
841873
0 commit comments