Skip to content

Conversation

@jaenrig-ifx
Copy link
Member

@jaenrig-ifx jaenrig-ifx commented Dec 10, 2025

  • Added machine.Pin class to machine module
  • Created constructor machine.Pin()
  • Added Pin.init() function
  • Validated combinations of mode, pull and value configurations
  • Added initial pin test to test plan and ci
  • Currently just one pin is hardcoded: P16_0
    • User selection of all pins will be available when make-pins.py is implemented

@jaenrig-ifx jaenrig-ifx changed the title machine.Pin constructor (make) machine.Pin constructor (make) + init Dec 10, 2025

pin1_name = "P16_0"

pin_out = Pin(pin1_name, mode=Pin.OUT, value=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the other tests will be added after pin generations is it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will start the test with 2 hardcoded pins, and add the rest of the machine.Pin() tests. With the creation of the pin class I will understand all the machine_pin_obj requirements, and from there I can handle the pin generation from make-pins.py.
Then there are the alternative functions, which some ports handle them from the Pin class... In PSOC6 the usage of the HAL prevented us from doing this. But in this case, I am not sure if we can/should stick to that approach.


mp_arg_check_num(n_args, n_kw, 1, 6, true);

const machine_pin_obj_t *self = &machine_pin_p16_0; // TODO: This will be change by the proper pin allocation/find function machine_pin_finf(args[0]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead have a LUT for this pin so that we can extend it for other tests till we have pins generated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let´s discuss in the pairing how I should do that :)

Copy link
Member

@NikhitaR-IFX NikhitaR-IFX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants