Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pwmio documentation #7649

Merged
merged 1 commit into from
Feb 26, 2023

Conversation

jepler
Copy link
Member

@jepler jepler commented Feb 25, 2023

#7644 pointed out the need for better documentation.

To the best of my ability I noted the current behavior. I think that there may be some ports that do not actually read back the 'set' frequency value, but they are ports marked as beta status (mimxrt10xx) or not maintained by us (cxd56).

This isn't to say that we shouldn't improve the implementation, for instance, to make sure that out-of-range values are handled uniformly across ports. I think there's some subtlety to this; for instance on rp2040 we might want to draw a distinction between a way-too-low frequency (1) and an on-the-cusp frequency (7).

(I think we might also want to change frequency property/parameter to be a float in 9, because many attainable frequencies are not exact integers, and in many cases at the low end the attainable frequencies are within 1Hz of one another.)

adafruit#7644 pointed out the need for better documentation.

To the best of my ability I noted the current behavior.
I think that there may be some ports that do not actually read
back the 'set' frequency value, but they are ports marked as beta
status (mimxrt10xx) or not maintained by us (cxd56).
@gneverov
Copy link

There's also a trade-off to be made between frequency precision and duty-cycle precision. Right now we favor duty-cycle precision, but I think it would be acceptable to drop one bit of duty-cycle to attain better frequency precision at low frequencies. Or even make the duty-cycle precision an optional parameter to the API.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This is good - thanks.

@dhalbert dhalbert merged commit f214d6b into adafruit:main Feb 26, 2023
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.

3 participants