From 24a940de4ff29573a658b94357bfd4647d2102fd Mon Sep 17 00:00:00 2001 From: Michal Gorecki Date: Wed, 29 Jan 2025 14:16:35 +0100 Subject: [PATCH] hw/drivers: Refactor nrf5x PWM driver This renames the driver from pwm_nrf52 to pwm_nrf5x as it is used with other supported nrf5x devices --- .../include/pwm_nrf5x/pwm_nrf5x.h} | 8 +- .../pwm/{pwm_nrf52 => pwm_nrf5x}/pkg.yml | 4 +- .../pwm_nrf52.c => pwm_nrf5x/src/pwm_nrf5x.c} | 82 +++++++++---------- hw/mcu/nordic/nrf52xxx/pkg.yml | 8 +- hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c | 10 +-- hw/mcu/nordic/nrf5340/pkg.yml | 9 +- hw/mcu/nordic/nrf5340/src/nrf5340_periph.c | 10 +-- hw/mcu/nordic/nrf54lxx/pkg.yml | 7 +- hw/mcu/nordic/nrf54lxx/src/nrf54l_periph.c | 8 +- 9 files changed, 72 insertions(+), 74 deletions(-) rename hw/drivers/pwm/{pwm_nrf52/include/pwm_nrf52/pwm_nrf52.h => pwm_nrf5x/include/pwm_nrf5x/pwm_nrf5x.h} (87%) rename hw/drivers/pwm/{pwm_nrf52 => pwm_nrf5x}/pkg.yml (92%) rename hw/drivers/pwm/{pwm_nrf52/src/pwm_nrf52.c => pwm_nrf5x/src/pwm_nrf5x.c} (91%) diff --git a/hw/drivers/pwm/pwm_nrf52/include/pwm_nrf52/pwm_nrf52.h b/hw/drivers/pwm/pwm_nrf5x/include/pwm_nrf5x/pwm_nrf5x.h similarity index 87% rename from hw/drivers/pwm/pwm_nrf52/include/pwm_nrf52/pwm_nrf52.h rename to hw/drivers/pwm/pwm_nrf5x/include/pwm_nrf5x/pwm_nrf5x.h index 307451eca0..40d6eec229 100644 --- a/hw/drivers/pwm/pwm_nrf52/include/pwm_nrf52/pwm_nrf52.h +++ b/hw/drivers/pwm/pwm_nrf5x/include/pwm_nrf5x/pwm_nrf5x.h @@ -17,8 +17,8 @@ * under the License. */ -#ifndef __PWM_NRF52_H__ -#define __PWM_NRF52_H__ +#ifndef __PWM_NRF5X_H__ +#define __PWM_NRF5X_H__ #include @@ -28,10 +28,10 @@ extern "C" { #endif -int nrf52_pwm_dev_init(struct os_dev *, void *); +int nrf5x_pwm_dev_init(struct os_dev *odev, void *arg); #ifdef __cplusplus } #endif -#endif /* __PWM_NRF52_H__ */ +#endif /* __PWM_NRF5X_H__ */ diff --git a/hw/drivers/pwm/pwm_nrf52/pkg.yml b/hw/drivers/pwm/pwm_nrf5x/pkg.yml similarity index 92% rename from hw/drivers/pwm/pwm_nrf52/pkg.yml rename to hw/drivers/pwm/pwm_nrf5x/pkg.yml index 75c3028b73..6caeec4ec5 100644 --- a/hw/drivers/pwm/pwm_nrf52/pkg.yml +++ b/hw/drivers/pwm/pwm_nrf5x/pkg.yml @@ -17,8 +17,8 @@ # under the License. # -pkg.name: hw/drivers/pwm/pwm_nrf52 -pkg.description: PWM driver for the NRF52 +pkg.name: hw/drivers/pwm/pwm_nrf5x +pkg.description: PWM driver for the NRF5x devices pkg.author: "Apache Mynewt " pkg.homepage: "http://mynewt.apache.org/" pkg.keywords: diff --git a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c b/hw/drivers/pwm/pwm_nrf5x/src/pwm_nrf5x.c similarity index 91% rename from hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c rename to hw/drivers/pwm/pwm_nrf5x/src/pwm_nrf5x.c index 69f11dba6e..6202d52621 100644 --- a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c +++ b/hw/drivers/pwm/pwm_nrf5x/src/pwm_nrf5x.c @@ -32,13 +32,13 @@ #include /* Mynewt Nordic driver */ -#include "pwm_nrf52/pwm_nrf52.h" +#include "pwm_nrf5x/pwm_nrf5x.h" -/* Max number on PWM instances on existing nRF52xxx MCUs */ +/* Max number on PWM instances on existing nRF5x MCUs */ #if MYNEWT_VAL(BSP_NRF54) -#define NRF52_PWM_MAX_INSTANCES 3 +#define NRF_PWM_MAX_INSTANCES 3 #else -#define NRF52_PWM_MAX_INSTANCES 4 +#define NRF_PWM_MAX_INSTANCES 4 #endif #if MYNEWT_VAL(BSP_NRF54) @@ -58,7 +58,7 @@ #define PWM_3_ID 3 #endif -struct nrf52_pwm_dev_global { +struct nrf5x_pwm_dev_global { bool in_use; bool playing; nrfx_pwm_t drv_instance; @@ -73,7 +73,7 @@ struct nrf52_pwm_dev_global { void* seq_end_data; }; -static struct nrf52_pwm_dev_global instances[] = +static struct nrf5x_pwm_dev_global instances[] = { #if MYNEWT_VAL(PWM_0) [0].in_use = false, @@ -307,7 +307,7 @@ cleanup_instance(int inst_id) } /** - * Open the NRF52 PWM device + * Open the NRF5x PWM device * * This function locks the device for access from other tasks. * @@ -322,7 +322,7 @@ cleanup_instance(int inst_id) * @return 0 on success, non-zero error code on failure. */ static int -nrf52_pwm_open(struct os_dev *odev, uint32_t wait, void *arg) +nrf5x_pwm_open(struct os_dev *odev, uint32_t wait, void *arg) { struct pwm_dev *dev; int stat = 0; @@ -359,7 +359,7 @@ nrf52_pwm_open(struct os_dev *odev, uint32_t wait, void *arg) } /** - * Close the NRF52 PWM device. + * Close the NRF5x PWM device. * * This function unlocks the device. * @@ -368,7 +368,7 @@ nrf52_pwm_open(struct os_dev *odev, uint32_t wait, void *arg) * @return 0 on success, non-zero error code on failure. */ static int -nrf52_pwm_close(struct os_dev *odev) +nrf5x_pwm_close(struct os_dev *odev) { struct pwm_dev *dev; int inst_id; @@ -397,7 +397,7 @@ nrf52_pwm_close(struct os_dev *odev) * Play using current configuration. */ static void -play_current_config(struct nrf52_pwm_dev_global *instance) +play_current_config(struct nrf5x_pwm_dev_global *instance) { nrf_pwm_sequence_t const seq = { @@ -423,10 +423,10 @@ play_current_config(struct nrf52_pwm_dev_global *instance) * @return 0 on success, non-zero error code on failure. */ int -nrf52_pwm_configure_device(struct pwm_dev *dev, struct pwm_dev_cfg *cfg) +nrf5x_pwm_configure_device(struct pwm_dev *dev, struct pwm_dev_cfg *cfg) { int inst_id = dev->pwm_instance_id; - struct nrf52_pwm_dev_global *instance = &instances[inst_id]; + struct nrf5x_pwm_dev_global *instance = &instances[inst_id]; instance->n_cycles = (cfg->n_cycles) ? cfg->n_cycles : 1; @@ -474,12 +474,12 @@ nrf52_pwm_configure_device(struct pwm_dev *dev, struct pwm_dev_cfg *cfg) * @return 0 on success, non-zero error code on failure. */ static int -nrf52_pwm_configure_channel(struct pwm_dev *dev, - uint8_t cnum, - struct pwm_chan_cfg *cfg) +nrf5x_pwm_configure_channel(struct pwm_dev *dev, + uint8_t cnum, + struct pwm_chan_cfg *cfg) { int inst_id = dev->pwm_instance_id; - struct nrf52_pwm_dev_global *instance = &instances[inst_id]; + struct nrf5x_pwm_dev_global *instance = &instances[inst_id]; nrfx_pwm_config_t *config = &instance->config; if (!instance->in_use) { @@ -515,7 +515,7 @@ nrf52_pwm_configure_channel(struct pwm_dev *dev, * @return 0 on success, non-zero error code on failure. */ static int -nrf52_pwm_set_duty_cycle(struct pwm_dev *dev, uint8_t cnum, uint16_t fraction) +nrf5x_pwm_set_duty_cycle(struct pwm_dev *dev, uint8_t cnum, uint16_t fraction) { int inst_id = dev->pwm_instance_id; nrfx_pwm_config_t *config; @@ -547,10 +547,10 @@ nrf52_pwm_set_duty_cycle(struct pwm_dev *dev, uint8_t cnum, uint16_t fraction) * @return 0 on success, non-zero error code on failure. */ int -nrf52_pwm_enable(struct pwm_dev *dev) +nrf5x_pwm_enable(struct pwm_dev *dev) { int inst_id = dev->pwm_instance_id; - struct nrf52_pwm_dev_global *instance = &instances[inst_id]; + struct nrf5x_pwm_dev_global *instance = &instances[inst_id]; nrfx_pwm_init(&instance->drv_instance, &instance->config, @@ -571,7 +571,7 @@ nrf52_pwm_enable(struct pwm_dev *dev) * @return true if enabled, false if not. */ static bool -nrf52_pwm_is_enabled(struct pwm_dev *dev) +nrf5x_pwm_is_enabled(struct pwm_dev *dev) { return (instances[dev->pwm_instance_id].playing); } @@ -584,7 +584,7 @@ nrf52_pwm_is_enabled(struct pwm_dev *dev) * @return 0 on success, non-zero error code on failure. */ static int -nrf52_pwm_disable(struct pwm_dev *dev) +nrf5x_pwm_disable(struct pwm_dev *dev) { int inst_id = dev->pwm_instance_id; if (!instances[inst_id].in_use) { @@ -613,7 +613,7 @@ nrf52_pwm_disable(struct pwm_dev *dev) * @return A value is in Hz on success, negative error code on failure. */ static int -nrf52_pwm_set_frequency(struct pwm_dev *dev, uint32_t freq_hz) +nrf5x_pwm_set_frequency(struct pwm_dev *dev, uint32_t freq_hz) { int inst_id = dev->pwm_instance_id; if (!instances[inst_id].in_use) { @@ -676,7 +676,7 @@ nrf52_pwm_set_frequency(struct pwm_dev *dev, uint32_t freq_hz) * @return value is in Hz on success, error code on failure. */ static int -nrf52_pwm_get_clock_freq(struct pwm_dev *dev) +nrf5x_pwm_get_clock_freq(struct pwm_dev *dev) { int inst_id = dev->pwm_instance_id; if (!instances[inst_id].in_use) { @@ -713,7 +713,7 @@ nrf52_pwm_get_clock_freq(struct pwm_dev *dev) * @return value in cycles on success, negative error code on failure. */ int -nrf52_pwm_get_top_value(struct pwm_dev *dev) +nrf5x_pwm_get_top_value(struct pwm_dev *dev) { int inst_id = dev->pwm_instance_id; if (!instances[inst_id].in_use) { @@ -731,7 +731,7 @@ nrf52_pwm_get_top_value(struct pwm_dev *dev) * @return The value in bits on success, negative error code on failure. */ static int -nrf52_pwm_get_resolution_bits(struct pwm_dev *dev) +nrf5x_pwm_get_resolution_bits(struct pwm_dev *dev) { int inst_id = dev->pwm_instance_id; if (!instances[inst_id].in_use) { @@ -825,11 +825,11 @@ pwm_3_irq_handler(void) /** * Callback to initialize an adc_dev structure from the os device - * initialization callback. This sets up a nrf52_pwm_device(), so + * initialization callback. This sets up a nrf5x_pwm_device(), so * that subsequent lookups to this device allow us to manipulate it. */ int -nrf52_pwm_dev_init(struct os_dev *odev, void *arg) +nrf5x_pwm_dev_init(struct os_dev *odev, void *arg) { struct pwm_dev *dev; struct pwm_driver_funcs *pwm_funcs; @@ -847,29 +847,29 @@ nrf52_pwm_dev_init(struct os_dev *odev, void *arg) * - if number is valid instance_id, let's use it directly * - otherwise assume it's a valid pointer */ - if (POINTER_TO_UINT(arg) < NRF52_PWM_MAX_INSTANCES) { + if (POINTER_TO_UINT(arg) < NRF_PWM_MAX_INSTANCES) { dev->pwm_instance_id = POINTER_TO_UINT(arg); } else { dev->pwm_instance_id = *((int*) arg); - assert(dev->pwm_instance_id < NRF52_PWM_MAX_INSTANCES); + assert(dev->pwm_instance_id < NRF_PWM_MAX_INSTANCES); } dev->pwm_chan_count = NRF_PWM_CHANNEL_COUNT; os_mutex_init(&dev->pwm_lock); - OS_DEV_SETHANDLERS(odev, nrf52_pwm_open, nrf52_pwm_close); + OS_DEV_SETHANDLERS(odev, nrf5x_pwm_open, nrf5x_pwm_close); pwm_funcs = &dev->pwm_funcs; - pwm_funcs->pwm_configure_device = nrf52_pwm_configure_device; - pwm_funcs->pwm_configure_channel = nrf52_pwm_configure_channel; - pwm_funcs->pwm_set_duty_cycle = nrf52_pwm_set_duty_cycle; - pwm_funcs->pwm_enable = nrf52_pwm_enable; - pwm_funcs->pwm_is_enabled = nrf52_pwm_is_enabled; - pwm_funcs->pwm_set_frequency = nrf52_pwm_set_frequency; - pwm_funcs->pwm_get_clock_freq = nrf52_pwm_get_clock_freq; - pwm_funcs->pwm_get_top_value = nrf52_pwm_get_top_value; - pwm_funcs->pwm_get_resolution_bits = nrf52_pwm_get_resolution_bits; - pwm_funcs->pwm_disable = nrf52_pwm_disable; + pwm_funcs->pwm_configure_device = nrf5x_pwm_configure_device; + pwm_funcs->pwm_configure_channel = nrf5x_pwm_configure_channel; + pwm_funcs->pwm_set_duty_cycle = nrf5x_pwm_set_duty_cycle; + pwm_funcs->pwm_enable = nrf5x_pwm_enable; + pwm_funcs->pwm_is_enabled = nrf5x_pwm_is_enabled; + pwm_funcs->pwm_set_frequency = nrf5x_pwm_set_frequency; + pwm_funcs->pwm_get_clock_freq = nrf5x_pwm_get_clock_freq; + pwm_funcs->pwm_get_top_value = nrf5x_pwm_get_top_value; + pwm_funcs->pwm_get_resolution_bits = nrf5x_pwm_get_resolution_bits; + pwm_funcs->pwm_disable = nrf5x_pwm_disable; switch (dev->pwm_instance_id) { #if MYNEWT_VAL(PWM_0) diff --git a/hw/mcu/nordic/nrf52xxx/pkg.yml b/hw/mcu/nordic/nrf52xxx/pkg.yml index cbe050d81f..fbdf787ddc 100644 --- a/hw/mcu/nordic/nrf52xxx/pkg.yml +++ b/hw/mcu/nordic/nrf52xxx/pkg.yml @@ -66,16 +66,16 @@ pkg.deps.ADC_0: - "@apache-mynewt-core/hw/drivers/adc/adc_nrf52" pkg.deps.PWM_0: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_1: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_2: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_3: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.TEMP: - "@apache-mynewt-core/hw/drivers/temp/temp_nrf52" diff --git a/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c b/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c index f3413ca271..5bb135b789 100644 --- a/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c +++ b/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c @@ -44,7 +44,7 @@ #endif #if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2) || MYNEWT_VAL(PWM_3) #include "pwm/pwm.h" -#include "pwm_nrf52/pwm_nrf52.h" +#include "pwm_nrf5x/pwm_nrf5x.h" #endif #if MYNEWT_VAL(TRNG) #include "trng/trng.h" @@ -307,25 +307,25 @@ nrf52_periph_create_pwm(void) #if MYNEWT_VAL(PWM_0) rc = os_dev_create(&os_bsp_pwm0.pwm_os_dev, "pwm0", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(0)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(0)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_1) rc = os_dev_create(&os_bsp_pwm1.pwm_os_dev, "pwm1", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(1)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(1)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_2) rc = os_dev_create(&os_bsp_pwm2.pwm_os_dev, "pwm2", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(2)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(2)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_3) rc = os_dev_create(&os_bsp_pwm3.pwm_os_dev, "pwm3", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(3)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(3)); assert(rc == 0); #endif } diff --git a/hw/mcu/nordic/nrf5340/pkg.yml b/hw/mcu/nordic/nrf5340/pkg.yml index ddc93e25a7..372eb1f32d 100644 --- a/hw/mcu/nordic/nrf5340/pkg.yml +++ b/hw/mcu/nordic/nrf5340/pkg.yml @@ -59,18 +59,17 @@ pkg.deps.UART_3: pkg.deps.ADC_0: - "@apache-mynewt-core/hw/drivers/adc/adc_nrf52" -#nrf52 driver is using nrfx so we can just reuse it pkg.deps.PWM_0: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_1: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_2: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_3: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.SPI_0_MASTER: - "@apache-mynewt-core/hw/bus" diff --git a/hw/mcu/nordic/nrf5340/src/nrf5340_periph.c b/hw/mcu/nordic/nrf5340/src/nrf5340_periph.c index 0c3b20ca39..0cb869ffed 100644 --- a/hw/mcu/nordic/nrf5340/src/nrf5340_periph.c +++ b/hw/mcu/nordic/nrf5340/src/nrf5340_periph.c @@ -37,7 +37,7 @@ #if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2) || MYNEWT_VAL(PWM_3) #include -#include +#include "pwm_nrf5x/pwm_nrf5x.h" #endif #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1) || MYNEWT_VAL(UART_2) || MYNEWT_VAL(UART_3) @@ -284,25 +284,25 @@ nrf5340_periph_create_pwm(void) #if MYNEWT_VAL(PWM_0) rc = os_dev_create(&os_bsp_pwm0.pwm_os_dev, "pwm0", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(0)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(0)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_1) rc = os_dev_create(&os_bsp_pwm1.pwm_os_dev, "pwm1", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(1)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(1)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_2) rc = os_dev_create(&os_bsp_pwm2.pwm_os_dev, "pwm2", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(2)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(2)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_3) rc = os_dev_create(&os_bsp_pwm3.pwm_os_dev, "pwm3", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(3)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(3)); assert(rc == 0); #endif } diff --git a/hw/mcu/nordic/nrf54lxx/pkg.yml b/hw/mcu/nordic/nrf54lxx/pkg.yml index c48a95ae57..618e6f6c89 100644 --- a/hw/mcu/nordic/nrf54lxx/pkg.yml +++ b/hw/mcu/nordic/nrf54lxx/pkg.yml @@ -47,12 +47,11 @@ pkg.deps.UART_3: pkg.deps.BLE_CONTROLLER: - "@apache-mynewt-nimble/nimble/drivers/nrf5x" -#nrf52 driver is using nrfx so we can just reuse it pkg.deps.PWM_0: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_1: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" pkg.deps.PWM_2: - - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf52" + - "@apache-mynewt-core/hw/drivers/pwm/pwm_nrf5x" diff --git a/hw/mcu/nordic/nrf54lxx/src/nrf54l_periph.c b/hw/mcu/nordic/nrf54lxx/src/nrf54l_periph.c index 1f2de39863..a5b440c5ba 100644 --- a/hw/mcu/nordic/nrf54lxx/src/nrf54l_periph.c +++ b/hw/mcu/nordic/nrf54lxx/src/nrf54l_periph.c @@ -31,7 +31,7 @@ #if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2) #include -#include +#include "pwm_nrf5x/pwm_nrf5x.h" #endif #if MYNEWT_VAL(UART_0) @@ -148,19 +148,19 @@ nrf54l_periph_create_pwm(void) { #if MYNEWT_VAL(PWM_0) rc = os_dev_create(&os_bsp_pwm0.pwm_os_dev, "pwm0", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(0)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(0)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_1) rc = os_dev_create(&os_bsp_pwm1.pwm_os_dev, "pwm1", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(1)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(1)); assert(rc == 0); #endif #if MYNEWT_VAL(PWM_2) rc = os_dev_create(&os_bsp_pwm2.pwm_os_dev, "pwm2", OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT, - nrf52_pwm_dev_init, UINT_TO_POINTER(2)); + nrf5x_pwm_dev_init, UINT_TO_POINTER(2)); assert(rc == 0); #endif }