Whats the thinking on the machine API compatibility across ports? I'm porting micropython to the SAMD21x18 which is on the Arduino Zero. Specifically, I'm adding PWM support to the port but I'm unsure which approach to take.
The ESP8266 has a PWM class while the Teensy and STMHAL have separate timer classes that seem to reflect the underlying system. The Teensy and STMHAL approach is great for using micropython as a proxy for the underlying code but bad for portability of both code and tutorials.
If there is a standard API where is it documented? Thanks!
Standard Machine API?
Re: Standard Machine API?
We recently stumbled on a similar question: https://github.com/micropython/micropython/pull/2283
Re: Standard Machine API?
The documentation, such as it is, for the machine module is here:
https://github.com/micropython/micropyt ... rdware-API
Personally, I would continue to make it part of the Timer module. We've had long discussions about this on github in the past.
https://github.com/micropython/micropyt ... rdware-API
Personally, I would continue to make it part of the Timer module. We've had long discussions about this on github in the past.
Re: Standard Machine API?
deshipu, perfect. I followed up there with my thoughts.
dhylands, thanks! I had seen that in the past but I'll look again and make sure my port is compatible. I think its getting close to what I was thinking where there are low level classes specific to the hardware and high level classes that aren't.
dhylands, thanks! I had seen that in the past but I'll look again and make sure my port is compatible. I think its getting close to what I was thinking where there are low level classes specific to the hardware and high level classes that aren't.