Skip to content

ports/esp32/esp32_rmt.c: #7015 ISR-driven pulse generator in RMT #9685

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andrei-Pozolotin
Copy link

@Andrei-Pozolotin Andrei-Pozolotin commented Oct 20, 2022

See: #7015

Design Motivation:

  1. store static pulse pattern inside RMT driver only once, as a "pulse vocabulary" of available stanzas
  2. keep playing "pulse words" from this RMT pulse store with different stanza size and frequency via ISR call back

Purpose: provide high performance ISR-driven pulse generator in RMT.

This adds 2 new functions to ports/esp32/esp32_rmt.c:

// RMT.store_pulses(self, item_list:list[int]) -> None
// RMT.issue_pulses(self, tx_ready_func:callable, item_index:int, item_count:int, clock_div:int) -> None

Use case and examples are discussed here:
#7015 (comment)
#7015 (comment)

See micropython#7015. This adds 2 new functions to ports/esp32/esp32_rmt.c:
// RMT.store_pulses(self, item_list:list[int]) -> None
// RMT.issue_pulses(self, tx_ready_func:callable, item_index:int,
item_count:int, clock_div:int) -> None
@Andrei-Pozolotin
Copy link
Author

@peterhinch : please review

@peterhinch
Copy link
Contributor

As per my original suggestions in #7015, it would offer potential RAM savings if RMT.store_pulses(self, item_list:list[int]) could accept any object supporting the buffer protocol.

@peterhinch : please review

The general principle looks good, but I'm not the best qualified to review the C code. Hopefully someone with a deeper knowledge of the MP API will turn up.

@Andrei-Pozolotin
Copy link
Author

@peterhinch : thank you

@Andrei-Pozolotin
Copy link
Author

@jonathanhogg : please review

@jonathanhogg
Copy link
Contributor

@jonathanhogg : please review

Comments coming in the #7015 issue, as that seems the most useful place for discussion…

@Andrei-Pozolotin
Copy link
Author

@jonathanhogg : thank you

@Andrei-Pozolotin
Copy link
Author

@mattytrentini : please review

@Andrei-Pozolotin
Copy link
Author

@robert-hh : please review

@projectgus
Copy link
Contributor

This is an automated heads-up that we've just merged a Pull Request
that removes the STATIC macro from MicroPython's C API.

See #13763

A search suggests this PR might apply the STATIC macro to some C code. If it
does, then next time you rebase the PR (or merge from master) then you should
please replace all the STATIC keywords with static.

Although this is an automated message, feel free to @-reply to me directly if
you have any questions about this.

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

Successfully merging this pull request may close these issues.

5 participants