Skip to content

Commit 6d3ac1c

Browse files
committed
psoc-edge/machine_pin: Added pin init() function.
Signed-off-by: jaenrig-ifx <[email protected]>
1 parent cf20f87 commit 6d3ac1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ports/psoc-edge/machine_pin.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw,
166166
return MP_OBJ_FROM_PTR(self);
167167
}
168168

169+
static mp_obj_t machine_pin_obj_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
170+
return machine_pin_obj_init_helper(args[0], n_args - 1, args + 1, kw_args);
171+
}
172+
MP_DEFINE_CONST_FUN_OBJ_KW(machine_pin_obj_init_obj, 1, machine_pin_obj_init);
173+
169174
static void machine_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
170175
// TODO: Placeholder.
171176
}
@@ -186,6 +191,7 @@ static const mp_pin_p_t pin_pin_p = {
186191

187192
static const mp_rom_map_elem_t machine_pin_locals_dict_table[] = {
188193
// Instance methods
194+
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_pin_obj_init_obj) },
189195

190196
// Const
191197
{ MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_IN) },

0 commit comments

Comments
 (0)