Skip to content

Implement PWM support for Zephyr Port #16046

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

Merged
merged 3 commits into from
Apr 29, 2025
Merged

Conversation

Ayush1325
Copy link
Contributor

  • Using beagleconnect freedom for testing PWM.
  • Using standard zephyr APIs, so should work for any zephyr supported board.

@jonnor
Copy link
Contributor

jonnor commented Mar 3, 2025

Looks very useful!

@Ayush1325
Copy link
Contributor Author

Looks very useful!

I can rebase things on top of master if someone wants to review this PR.

@VynDragon
Copy link
Contributor

Tested on nrf52840, it works.

order:

  • 16207 (Upgrade to Zephyr v4.0.0)
  • 16770 (Fixes for zephyr 4.0)
    merged thread analyzer as:
#ifdef CONFIG_THREAD_ANALYZER
static mp_obj_t mod_thread_analyze(mp_obj_t cpu_in) {
    #if KERNEL_VERSION_NUMBER >= ZEPHYR_VERSION(4, 0, 0)
    unsigned int cpu = mp_obj_get_int(cpu_in);
    thread_analyzer_print(cpu);
    #else
    thread_analyzer_print();
    #endif
    return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_1(mod_thread_analyze_obj, mod_thread_analyze);
#endif
  • 16046 (this PR)

Implement PWM support using standard zephyr APIs, exposed as the standard
MicroPython `machine.PWM` class.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Add docs for PWM support.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Enable PWM config for bcf.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Copy link
Member

@dpgeorge dpgeorge 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 a nice addition, and great that it matches the standard MicroPython machine.PWM class API.

@dpgeorge dpgeorge merged commit f9a755c into micropython:master Apr 29, 2025
8 checks passed
@Ayush1325 Ayush1325 deleted the zephyr-pwm branch April 29, 2025 15:37
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.

4 participants