Created
March 11, 2025 18:16
-
-
Save hlord2000/2606e2932c30125ee9c92c076da233ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zephyr/kernel.h> | |
#include <hal/nrf_grtc.h> | |
/* To use the nRF54L15's GRTC PWM output (P0.03 only) | |
* | |
* Requires enabling: | |
* CONFIG_NRFX_GRTC=y | |
*/ | |
int main(void) | |
{ | |
while (true) { | |
for (int i = 1; i < UINT8_MAX; i++) { | |
nrf_grtc_pwm_compare_set(NRF_GRTC, i); | |
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_PWM_START); | |
k_msleep(10); | |
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_PWM_STOP); | |
k_msleep(10); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment