diff --git a/nrfx/samples/CHANGELOG.md b/nrfx/samples/CHANGELOG.md index a1e3d7ae..441d5766 100644 --- a/nrfx/samples/CHANGELOG.md +++ b/nrfx/samples/CHANGELOG.md @@ -1,6 +1,15 @@ # Changelog All notable changes to this project are documented in this file. +## [3.14.0] - 2025-08-22 +### Added +- Added support for the nRF54L15 DK to all existing samples except for the RNG sample. +- Added sample for the CRACEN driver. + +### Changed +- Divided existing loopback definitions in `common/nrfx_example.h` into individual header files for each board in `common/boards`. +- Moved pin definitions from individual samples to board header files in `common/boards`. + ## [3.8.0] - 2024-10-17 ### Changed - Aligned Kconfig definitions to DPPIC multi-instance support in the GPPI and SAADC driver samples. diff --git a/nrfx/samples/README.md b/nrfx/samples/README.md new file mode 100644 index 00000000..8cf26d23 --- /dev/null +++ b/nrfx/samples/README.md @@ -0,0 +1,93 @@ +## Introduction and configuration + +This repository contains sample applications showing the usage examples of the [nrfx drivers] within [Zephyr RTOS]. + +## Installation + +1. Set up Zephyr by following [Getting started] guide. + +> Always activate the virtual environment with previously installed `west` and set up `Zephyr`. + +## Requirements + +Samples support the following development kits: + +| **Hardware platforms** | **Board name** | **Build target** | +| ------------------------ | ------------------------- | ------------------------------- | +| nR52 DK | nrf52dk_nrf52832 | `nrf52dk_nrf52832` | +| nRF52833 DK | nrf52833dk_nrf52833 | `nrf52833dk_nrf52833` | +| nRF52840 DK | nrf52840dk_nrf52840 | `nrf52840dk_nrf52840` | +| nRF5340 DK | nrf5340dk_nrf5340 | `nrf5340dk_nrf5340_cpuapp` | +| nRF5340 DK | nrf5340dk_nrf5340 | `nrf5340dk_nrf5340_cpunet` | +| nRF54L15 DK | nrf54l15dk_nrf54l15 | `nrf54l15dk_nrf54l15_cpuapp` | +| nRF9160 DK | nrf9160dk_nrf9160 | `nrf9160dk_nrf9160` | + +## Wiring + +Samples use a unified system of pins assignment. +Refer to their definitnions in `common/nrfx_example.h`. +By default, pins are connected through different boards as follows: + +| **Board name** | **1A** | **1B** | **2A** | **2B** | **3A** | **3B** | **4A** | **4B** | +|--------------------- | ------ | -------- | ------- | ------ | ------ | ------ | ------ | ------ | +| nrf52dk_nrf52832 | P0.03 | P0.31 | P0.04 | P0.30 | P0.28 | P0.29 | P0.26 | P0.27 | +| nrf52833dk_nrf52833 | P0.03 | P0.31 | P0.04 | P0.30 | P0.28 | P0.29 | P0.26 | P0.27 | +| nrf52840dk_nrf52840 | P0.03 | P0.31 | P0.04 | P0.30 | P0.28 | P0.29 | P0.26 | P0.27 | +| nrf5340dk_nrf5340 | P0.04 | P0.26 | P0.05 | P0.25 | P0.06 | P0.07 | P1.02 | P1.03 | +| nrf54l15dk_nrf54l15 | P1.13 | P1.12 | P1.11 | P1.10 | P1.09 | P1.08 | P2.06 | P1.04 | +| nrf9160dk_nrf9160 | P0.14 | P0.19 | P0.15 | P0.18 | P0.16 | P0.17 | P0.30 | P0.31 | + +> If a specific sample is using some loopback pins, their corresponding pins should be connected together. +> For example, `LOOPBACK_PIN_1A` should be connected with `LOOPBACK_PIN_1B` and `LOOPBACK_PIN_2A` with `LOOPBACK_PIN_2B`. + +@anchor building_and_running +## Building and running + +1. Change the directory in `zephyrproject-rtos` repository to one of the samples: +``` +cd modules/hal/nordic/nrfx/samples/src/nrfx_timer/timer/ +``` +2. Build the sample with the `west` on one of the supported boards. +``` +west build -b +``` +3. Flash the application on the connected target. +``` +west flash +``` +4. Configure a serial monitor to recognize the port connection with the following parameters: + - 115200 baud rate, + - 8 data bits, + - no parity bit, + - 1 stop bit, + - RTS/CTS flow control. +## Directories + +``` +. +├── common # Various boards and examples common files +├── doc # Project documentation files +└── src # Examples base + ├── nrfx_cracen # Examples related to CRACEN peripheral + ├── nrfx_egu # Examples related to EGU peripheral + ├── nrfx_gppi # Examples related to GPPI helper + ├── nrfx_pwm # Examples related to PWM peripheral + ├── nrfx_rng # Examples related to RNG peripheral + . + . + . +``` + +@cond DOXYGEN_EXCLUDE +## Generating documentation + +Documentation for the samples is available in the `doc/html` folder. +For more details refer to [Documentation]. +@endcond + +[//]: # +[nrfx drivers]: https://infocenter.nordicsemi.com/topic/struct_drivers/struct/nrfx_latest.html +[Zephyr RTOS]: https://docs.zephyrproject.org/latest/index.html +[Getting started]: https://docs.zephyrproject.org/latest/develop/getting_started/index.html +[Documentation]: doc/README.md + diff --git a/nrfx/samples/common/boards/nrf52833dk_nrf52833_config.h b/nrfx/samples/common/boards/nrf52833dk_nrf52833_config.h new file mode 100644 index 00000000..bf0019ef --- /dev/null +++ b/nrfx/samples/common/boards/nrf52833dk_nrf52833_config.h @@ -0,0 +1,143 @@ +#ifndef NRF52833DK_NRF52833_CONFIG_H__ +#define NRF52833DK_NRF52833_CONFIG_H__ + +#define LOOPBACK_PIN_1A 3 +#define LOOPBACK_PIN_1B 31 +#define LOOPBACK_PIN_2A 4 +#define LOOPBACK_PIN_2B 30 +#define LOOPBACK_PIN_3A 28 +#define LOOPBACK_PIN_3B 29 +#define LOOPBACK_PIN_4A 26 +#define LOOPBACK_PIN_4B 27 + +#define LED1_PIN 13 +#define LED2_PIN 14 +#define LED3_PIN 15 +#define LED4_PIN 16 + +/** @brief Symbol specifying analog input associated with analog pin A0 on the Development Kit. */ +#define ANALOG_INPUT_A0 1 +/** @brief Symbol specifying analog input associated with analog pin A1 on the Development Kit. */ +#define ANALOG_INPUT_A1 2 +/** @brief Symbol specifying analog input associated with analog pin A2 on the Development Kit. */ +#define ANALOG_INPUT_A2 4 + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 0 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 0 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED2_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 0 + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN LED2_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN LED4_PIN + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 0 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + */ +#define SAADC_MAX_CHANNELS 3 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) +/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 1 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 1 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 2 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 0 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 1 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 0 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 1 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 1 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF52833DK_NRF52833_CONFIG_H__ diff --git a/nrfx/samples/common/boards/nrf52840dk_nrf52840_config.h b/nrfx/samples/common/boards/nrf52840dk_nrf52840_config.h new file mode 100644 index 00000000..0880df01 --- /dev/null +++ b/nrfx/samples/common/boards/nrf52840dk_nrf52840_config.h @@ -0,0 +1,143 @@ +#ifndef NRF52840DK_NRF52840_CONFIG_H__ +#define NRF52840DK_NRF52840_CONFIG_H__ + +#define LOOPBACK_PIN_1A 3 +#define LOOPBACK_PIN_1B 31 +#define LOOPBACK_PIN_2A 4 +#define LOOPBACK_PIN_2B 30 +#define LOOPBACK_PIN_3A 28 +#define LOOPBACK_PIN_3B 29 +#define LOOPBACK_PIN_4A 26 +#define LOOPBACK_PIN_4B 27 + +#define LED1_PIN 13 +#define LED2_PIN 14 +#define LED3_PIN 15 +#define LED4_PIN 16 + +/** @brief Symbol specifying analog input associated with analog pin A0 on the Development Kit. */ +#define ANALOG_INPUT_A0 1 +/** @brief Symbol specifying analog input associated with analog pin A1 on the Development Kit. */ +#define ANALOG_INPUT_A1 2 +/** @brief Symbol specifying analog input associated with analog pin A2 on the Development Kit. */ +#define ANALOG_INPUT_A2 4 + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 0 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 0 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED2_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 0 + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN LED2_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN LED4_PIN + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 0 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + */ +#define SAADC_MAX_CHANNELS 3 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) +/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 1 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 1 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 2 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 0 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 1 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 0 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 1 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 1 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF52840DK_NRF52840_CONFIG_H__ diff --git a/nrfx/samples/common/boards/nrf52dk_nrf52832_config.h b/nrfx/samples/common/boards/nrf52dk_nrf52832_config.h new file mode 100644 index 00000000..bce27bba --- /dev/null +++ b/nrfx/samples/common/boards/nrf52dk_nrf52832_config.h @@ -0,0 +1,143 @@ +#ifndef NRF52DK_NRF52832_CONFIG_H__ +#define NRF52DK_NRF52832_CONFIG_H__ + +#define LOOPBACK_PIN_1A 3 +#define LOOPBACK_PIN_1B 31 +#define LOOPBACK_PIN_2A 4 +#define LOOPBACK_PIN_2B 30 +#define LOOPBACK_PIN_3A 28 +#define LOOPBACK_PIN_3B 29 +#define LOOPBACK_PIN_4A 26 +#define LOOPBACK_PIN_4B 27 + +#define LED1_PIN 17 +#define LED2_PIN 18 +#define LED3_PIN 19 +#define LED4_PIN 20 + +/** @brief Symbol specifying analog input associated with analog pin A0 on the Development Kit. */ +#define ANALOG_INPUT_A0 1 +/** @brief Symbol specifying analog input associated with analog pin A1 on the Development Kit. */ +#define ANALOG_INPUT_A1 2 +/** @brief Symbol specifying analog input associated with analog pin A2 on the Development Kit. */ +#define ANALOG_INPUT_A2 4 + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 0 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 0 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED2_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 0 + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN LED2_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN LED4_PIN + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 0 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + */ +#define SAADC_MAX_CHANNELS 3 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) +/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 1 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 1 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 2 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 0 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 1 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 0 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 1 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 1 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF52DK_NRF52832_CONFIG_H__ diff --git a/nrfx/samples/common/boards/nrf5340dk_nrf5340_config.h b/nrfx/samples/common/boards/nrf5340dk_nrf5340_config.h new file mode 100644 index 00000000..0c085623 --- /dev/null +++ b/nrfx/samples/common/boards/nrf5340dk_nrf5340_config.h @@ -0,0 +1,143 @@ +#ifndef NRF5340DK_NRF5340_CONFIG_H__ +#define NRF5340DK_NRF5340_CONFIG_H__ + +#define LOOPBACK_PIN_1A 4 +#define LOOPBACK_PIN_1B 26 +#define LOOPBACK_PIN_2A 5 +#define LOOPBACK_PIN_2B 25 +#define LOOPBACK_PIN_3A 6 +#define LOOPBACK_PIN_3B 7 +#define LOOPBACK_PIN_4A 34 +#define LOOPBACK_PIN_4B 35 + +#define LED1_PIN 28 +#define LED2_PIN 29 +#define LED3_PIN 30 +#define LED4_PIN 31 + +/** @brief Symbol specifying analog input associated with analog pin A0 on the Development Kit. */ +#define ANALOG_INPUT_A0 0 +/** @brief Symbol specifying analog input associated with analog pin A1 on the Development Kit. */ +#define ANALOG_INPUT_A1 1 +/** @brief Symbol specifying analog input associated with analog pin A2 on the Development Kit. */ +#define ANALOG_INPUT_A2 2 + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 0 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 0 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED2_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 0 + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN LED2_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN LED4_PIN + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 0 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + */ +#define SAADC_MAX_CHANNELS 3 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) +/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 1 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 1 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 2 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 0 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 1 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 1 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 2 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 1 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF5340DK_NRF5340_CONFIG_H__ diff --git a/nrfx/samples/common/boards/nrf54l15dk_nrf54l15_config.h b/nrfx/samples/common/boards/nrf54l15dk_nrf54l15_config.h new file mode 100644 index 00000000..8a9bc2b5 --- /dev/null +++ b/nrfx/samples/common/boards/nrf54l15dk_nrf54l15_config.h @@ -0,0 +1,140 @@ +#ifndef NRF54L15DK_NRF54L15_CONFIG_H__ +#define NRF54L15DK_NRF54L15_CONFIG_H__ + +#define LOOPBACK_PIN_1A NRF_GPIO_PIN_MAP(1,13) +#define LOOPBACK_PIN_1B NRF_GPIO_PIN_MAP(1,12) +#define LOOPBACK_PIN_2A NRF_GPIO_PIN_MAP(1,11) +#define LOOPBACK_PIN_2B NRF_GPIO_PIN_MAP(1,10) +#define LOOPBACK_PIN_3A NRF_GPIO_PIN_MAP(1,9) +#define LOOPBACK_PIN_3B NRF_GPIO_PIN_MAP(1,8) +#define LOOPBACK_PIN_4A NRF_GPIO_PIN_MAP(2,6) +#define LOOPBACK_PIN_4B NRF_GPIO_PIN_MAP(1,4) + +#define LED0_PIN NRF_GPIO_PIN_MAP(2,9) +#define LED1_PIN NRF_GPIO_PIN_MAP(1,10) +#define LED2_PIN NRF_GPIO_PIN_MAP(2,7) +#define LED3_PIN NRF_GPIO_PIN_MAP(1,14) + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 10 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 20 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 20 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gpi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED3_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 20 + +/** + * @note On nRF54L15 only two out of four LED pins are connected to port 1, + * which is accessible by PWM. + */ + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN NRF_PWM_PIN_NOT_CONNECTED +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN NRF_PWM_PIN_NOT_CONNECTED + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 20 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 20 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + * + * @note In order to keep the loopbacks consistent for all the examples only two SAADC + * channels are used on nRF54L15 DK. + */ +#define SAADC_MAX_CHANNELS 2 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN LOOPBACK_PIN_1A +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN LOOPBACK_PIN_2A + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 20 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 20 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 21 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_4B +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_4A +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_1B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 00 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 00 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 20 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 21 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 22 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 20 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF54L15DK_NRF54L15_CONFIG_H__ diff --git a/nrfx/samples/common/boards/nrf9160dk_nrf9160_config.h b/nrfx/samples/common/boards/nrf9160dk_nrf9160_config.h new file mode 100644 index 00000000..7f53a224 --- /dev/null +++ b/nrfx/samples/common/boards/nrf9160dk_nrf9160_config.h @@ -0,0 +1,143 @@ +#ifndef NRF9160DK_NRF9160_CONFIG_H__ +#define NRF9160DK_NRF9160_CONFIG_H__ + +#define LOOPBACK_PIN_1A 14 +#define LOOPBACK_PIN_1B 19 +#define LOOPBACK_PIN_2A 15 +#define LOOPBACK_PIN_2B 18 +#define LOOPBACK_PIN_3A 16 +#define LOOPBACK_PIN_3B 17 +#define LOOPBACK_PIN_4A 30 +#define LOOPBACK_PIN_4B 31 + +#define LED1_PIN 2 +#define LED2_PIN 3 +#define LED3_PIN 4 +#define LED4_PIN 5 + +/** @brief Symbol specifying analog input associated with analog pin A0 on the Development Kit. */ +#define ANALOG_INPUT_A0 1 +/** @brief Symbol specifying analog input associated with analog pin A1 on the Development Kit. */ +#define ANALOG_INPUT_A1 2 +/** @brief Symbol specifying analog input associated with analog pin A2 on the Development Kit. */ +#define ANALOG_INPUT_A2 3 + +/* EXAMPLE-SPECIFIC DEFINES: */ + +/* NRFX_EGU */ +/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */ +#define EGU_INST_IDX 0 + +/* NRFX_GPPI */ +/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */ +#define GPPI_TIMER_INST_IDX 0 + +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */ +#define GPPI_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN + +/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */ +#define GPPI_OUTPUT_PIN_FORK LED2_PIN + +/* NRFX_PWM */ +/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */ +#define PWM_INST_IDX 0 + +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED1_PIN LED1_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED2_PIN LED2_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED3_PIN LED3_PIN +/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */ +#define PWM_LED4_PIN LED4_PIN + +/* NRFX_SAADC */ +/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */ +#define SAADC_GPIOTE_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */ +#define SAADC_TIMER_INST_IDX 0 +/** + * @brief Symbol specifying the maximum number of SAADC channels that can be used in the + * nrfx_saadc examples. + */ +#define SAADC_MAX_CHANNELS 3 + +/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) +/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) +/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) + +/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */ +#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */ +#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B +/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */ +#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B + +/* NRFX_SPIM */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */ +#define SPIM_INST_IDX 1 + +/* NRFX_SPIM_SPIS */ +/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIM_INST_IDX 1 +/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SPIS_INST_IDX 2 + +/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A +/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B +/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A +/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */ +#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B +/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A +/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B +/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */ +#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A +/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */ +#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B + +/* NRFX_TIMER */ +/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */ +#define TIMER_INST_IDX 0 + +/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */ +#define TIMER_T_INST_IDX 0 +/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */ +#define TIMER_C_INST_IDX 1 + +/* NRFX_TWIM_TWIS */ +/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */ +#define TWIM_INST_IDX 1 +/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */ +#define TWIS_INST_IDX 2 + +/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B +/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A +/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */ +#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B + +/* NRFX_UARTE */ +/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */ +#define UARTE_INST_IDX 1 + +/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_TX_PIN LOOPBACK_PIN_1A +/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */ +#define UARTE_RX_PIN LOOPBACK_PIN_1B + +#endif // NRF9160DK_NRF9160_CONFIG_H__ diff --git a/nrfx/samples/common/common.cmake b/nrfx/samples/common/common.cmake index bf35e866..6bd1b960 100644 --- a/nrfx/samples/common/common.cmake +++ b/nrfx/samples/common/common.cmake @@ -2,16 +2,60 @@ # This file should be included in each CMakeLists.txt if compiled with west tool under Zephyr. # Add common Kconfig file to project. -list(APPEND CONF_FILE "${CMAKE_CURRENT_LIST_DIR}/common.conf") +list(APPEND EXTRA_CONF_FILE "${CMAKE_CURRENT_LIST_DIR}/common.conf") -# Add project Kconfig file if it exists. -set(PRJ_CONF_FILE "${CMAKE_CURRENT_SOURCE_DIR}/prj.conf") -if(EXISTS ${PRJ_CONF_FILE}) - list(APPEND CONF_FILE ${PRJ_CONF_FILE}) +# Function stripping the version from a BOARD string, useful for matching .conf files +# e.g. nrf9160dk@0.14.0/nrf9160 -> nrf9160dk/nrf9160 +function(strip_board_version INPUT OUTPUT) + # Check if "@" exists + string(FIND "${INPUT}" "@" AT_POS) + if(AT_POS EQUAL -1) + set(${OUTPUT} "${INPUT}" PARENT_SCOPE) + return() + endif() + + # Find position of first "/" after "@" + string(SUBSTRING "${INPUT}" ${AT_POS} -1 SUB_AFTER_AT) + string(FIND "${SUB_AFTER_AT}" "/" SLASH_RELATIVE_POS) + if(SLASH_RELATIVE_POS EQUAL -1) + # If no "/", remove from @ to end + string(SUBSTRING "${INPUT}" 0 ${AT_POS} PREFIX) + set(${OUTPUT} "${PREFIX}" PARENT_SCOPE) + return() + endif() + + math(EXPR SLASH_POS "${AT_POS} + ${SLASH_RELATIVE_POS}") + + # Get parts before "@" and after "/" + string(SUBSTRING "${INPUT}" 0 ${AT_POS} PREFIX) + math(EXPR AFTER_SLASH_POS "${SLASH_POS} + 1") + string(SUBSTRING "${INPUT}" ${AFTER_SLASH_POS} -1 SUFFIX) + + # Join parts + set(${OUTPUT} "${PREFIX}/${SUFFIX}" PARENT_SCOPE) +endfunction() + +function(get_board_from_sysbuild_cache SYSBUILD_BOARD) + # Read the sysbuild cache file into a variable + file(READ "${SYSBUILD_CACHE}" _sysbuild_cache_content) + + # Extract the BOARD value + string(REGEX MATCH "BOARD:STRING=([^\n\r]+)" _match "${_sysbuild_cache_content}") + + # The captured group is in CMAKE_MATCH_1 + set(${SYSBUILD_BOARD} "${CMAKE_MATCH_1}" PARENT_SCOPE) + + message(STATUS "BOARD from Sysbuild cache: ${CMAKE_MATCH_1}") + +endfunction() + +# When building with Sysbuild, get the BOARD variable from cache as it is not present. +if(SYSBUILD) + get_board_from_sysbuild_cache(BOARD) endif() -# Macro adding overlay file and Kconfig file for specified board in given directory. -# If board-specific files have been found they are added to DTC_OVERLAY_FILE and CONF_FILE +# Macro adding .overlay and .conf file for specified board in given directory. +# If board-specific files have been found they are added to DTC_OVERLAY_FILE and EXTRA_CONF_FILE # symbols that are used in west build system. macro(GET_DEVICE_CONFIG_FILES BOARD BOARDS_DIR) if(NOT IS_ABSOLUTE BOARDS_DIR) @@ -21,14 +65,17 @@ macro(GET_DEVICE_CONFIG_FILES BOARD BOARDS_DIR) set(BOARDS_DIR_ABSOLUTE {BOARDS_DIR}) endif() - string(REPLACE "/" "_" BOARD_UNDERSCORES ${BOARD}) + # for the .conf and .overlay file path remove version + strip_board_version(${BOARD} BOARD_WITHOUT_VERSION) + string(REPLACE "/" "_" BOARD_UNDERSCORES ${BOARD_WITHOUT_VERSION}) + set(OVERLAY_FILE "${BOARDS_DIR_ABSOLUTE}/${BOARD_UNDERSCORES}.overlay") if(EXISTS ${OVERLAY_FILE}) list(APPEND DTC_OVERLAY_FILE "${OVERLAY_FILE}") endif() - set(CONFIG_FILE "${BOARDS_DIR_ABSOLUTE}/${BOARD_UNDERSCORES}.conf") - if(EXISTS ${CONFIG_FILE}) - list(APPEND CONF_FILE "${CONFIG_FILE}") + set(BOARD_CONFIG_FILE "${BOARDS_DIR_ABSOLUTE}/${BOARD_UNDERSCORES}.conf") + if(EXISTS ${BOARD_CONFIG_FILE}) + list(APPEND EXTRA_CONF_FILE "${BOARD_CONFIG_FILE}") endif() endmacro() diff --git a/nrfx/samples/common/nrfx_build_boilerplate_common.cmake b/nrfx/samples/common/nrfx_build_boilerplate_common.cmake new file mode 100644 index 00000000..e6e4e2ae --- /dev/null +++ b/nrfx/samples/common/nrfx_build_boilerplate_common.cmake @@ -0,0 +1,7 @@ +# Add project source files +list(APPEND APP_SPECIFIC_SOURCES ${CMAKE_SOURCE_DIR}/main.c) + +set(EXAMPLE_BOILERPLATE_PATH "source/tests/scripts.cmake/boilerplate_example.cmake") +include(${CMAKE_CURRENT_LIST_DIR}/../../nrfx-verification/${EXAMPLE_BOILERPLATE_PATH}) + +project(nrfx_example LANGUAGES C ASM) diff --git a/nrfx/samples/common/nrfx_example.h b/nrfx/samples/common/nrfx_example.h index 173d4384..ec5231ec 100644 --- a/nrfx/samples/common/nrfx_example.h +++ b/nrfx/samples/common/nrfx_example.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -34,6 +34,8 @@ #ifndef NRFX_EXAMPLE_H__ #define NRFX_EXAMPLE_H__ +#include + #if defined(__ZEPHYR__) #include #define NRFX_EXAMPLE_LOG_INIT() LOG_INIT() @@ -43,67 +45,35 @@ #define NRFX_EXAMPLE_LOG_PROCESS() #endif -#if defined(NRF52_SERIES) -#define LOOPBACK_PIN_1A 3 -#define LOOPBACK_PIN_1B 31 -#define LOOPBACK_PIN_2A 4 -#define LOOPBACK_PIN_2B 30 -#define LOOPBACK_PIN_3A 28 -#define LOOPBACK_PIN_3B 29 -#define LOOPBACK_PIN_4A 26 -#define LOOPBACK_PIN_4B 27 -#define ANALOG_INPUT_A0 1 -#define ANALOG_INPUT_A1 2 -#define ANALOG_INPUT_A2 4 -#if defined(NRF52832_XXAA) || defined (NRF52832_XXAB) -#define LED1_PIN 17 -#define LED2_PIN 18 -#define LED3_PIN 19 -#define LED4_PIN 20 -#else -#define LED1_PIN 13 -#define LED2_PIN 14 -#define LED3_PIN 15 -#define LED4_PIN 16 +#if defined(NRF52_SERIES) || defined(NRF53_SERIES) \ + || defined(NRF91_SERIES) || defined(__NRFX_DOXYGEN__) +/** + * @brief Macro for converting analog input number into analog input enumerator + * compatible with SAADC channel configuration. + * + * @param[in] input Analog input number. + * + * @return Analog input enumerator. + */ +#define ANALOG_INPUT_TO_SAADC_AIN(x) ((x) + 1) #endif + +#if defined(NRF52832_XXAA) || defined(NRF52832_XXAB) + #include "boards/nrf52dk_nrf52832_config.h" +#elif defined(NRF52830_XXAA) + #include "boards/nrf52833dk_nrf52833_config.h" +#elif defined(NRF52833_XXAA) + #include "boards/nrf52833dk_nrf52833_config.h" +#elif defined(NRF52840_XXAA) + #include "boards/nrf52840dk_nrf52840_config.h" #elif defined(NRF53_SERIES) -#define LOOPBACK_PIN_1A 4 -#define LOOPBACK_PIN_1B 26 -#define LOOPBACK_PIN_2A 5 -#define LOOPBACK_PIN_2B 25 -#define LOOPBACK_PIN_3A 6 -#define LOOPBACK_PIN_3B 7 -#define LOOPBACK_PIN_4A 34 -#define LOOPBACK_PIN_4B 35 -#define ANALOG_INPUT_A0 0 -#define ANALOG_INPUT_A1 1 -#define ANALOG_INPUT_A2 2 -#define LED1_PIN 28 -#define LED2_PIN 29 -#define LED3_PIN 30 -#define LED4_PIN 31 + #include "boards/nrf5340dk_nrf5340_config.h" #elif defined(NRF91_SERIES) -#define LOOPBACK_PIN_1A 14 -#define LOOPBACK_PIN_1B 19 -#define LOOPBACK_PIN_2A 15 -#define LOOPBACK_PIN_2B 18 -#define LOOPBACK_PIN_3A 16 -#define LOOPBACK_PIN_3B 17 -#define LOOPBACK_PIN_4A 30 -#define LOOPBACK_PIN_4B 31 -#define ANALOG_INPUT_A0 1 -#define ANALOG_INPUT_A1 2 -#define ANALOG_INPUT_A2 3 -#define LED1_PIN 2 -#define LED2_PIN 3 -#define LED3_PIN 4 -#define LED4_PIN 5 + #include "boards/nrf9160dk_nrf9160_config.h" +#elif defined(NRF54L15_XXAA) + #include "boards/nrf54l15dk_nrf54l15_config.h" #else #error "Unknown device." #endif -#define ANALOG_INPUT_TO_SAADC_AIN(x) ((x) + 1) - -#define ANALOG_INPUT_TO_COMP_AIN(x) (x) - #endif // NRFX_EXAMPLE_H__ diff --git a/nrfx/samples/doc/nrfx_examples.doxyfile b/nrfx/samples/doc/nrfx_examples.doxyfile index 8bfeec48..9243b228 100644 --- a/nrfx/samples/doc/nrfx_examples.doxyfile +++ b/nrfx/samples/doc/nrfx_examples.doxyfile @@ -50,7 +50,7 @@ PROJECT_NAME = "nrfx-examples" ### EDIT THIS ### -PROJECT_NUMBER = "3.8" +PROJECT_NUMBER = "3.14" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/nrfx/samples/doc/nrfx_examples_descriptions.dox b/nrfx/samples/doc/nrfx_examples_descriptions.dox index 0c62f247..c4abcd57 100644 --- a/nrfx/samples/doc/nrfx_examples_descriptions.dox +++ b/nrfx/samples/doc/nrfx_examples_descriptions.dox @@ -1,6 +1,7 @@ /** @page nrfx_examples_desc Samples descriptions The complete base, where you can find all the necessary information about samples: +- @subpage nrfx_cracen_example_desc - @subpage nrfx_egu_example_desc - @subpage nrfx_gppi_example_desc - @subpage nrfx_pwm_example_desc @@ -13,6 +14,10 @@ The complete base, where you can find all the necessary information about sample - @subpage nrfx_twim_twis_example_desc - @subpage nrfx_uarte_example_desc +@page nrfx_cracen_example_desc CRACEN +Here you can find all the necessary information about following samples: +- @subpage cracen_basic_desc + @page nrfx_egu_example_desc EGU Here you can find all the necessary information about following samples: - @subpage egu_basic_desc diff --git a/nrfx/samples/src/README.md b/nrfx/samples/src/README.md index 875cf6e4..2bb89713 100644 --- a/nrfx/samples/src/README.md +++ b/nrfx/samples/src/README.md @@ -1,5 +1,6 @@ # Samples Samples are grouped into the following subdirectories: +- [nrfx_cracen] - samples showing the functionality of the CRACEN driver. - [nrfx_egu] - samples showing the functionality of the EGU driver. - [nrfx_gppi] - samples showing the functionality of the GPPI driver. - [nrfx_pwm] - samples showing the functionality of the PWM driver. @@ -13,6 +14,7 @@ Samples are grouped into the following subdirectories: - [nrfx_uarte] - samples showing the functionality of the UARTE driver. [//]: # +[nrfx_cracen]: [nrfx_egu]: [nrfx_gppi]: [nrfx_pwm]: diff --git a/nrfx/samples/src/nrfx_cracen/CMakeLists.txt b/nrfx/samples/src/nrfx_cracen/CMakeLists.txt new file mode 100644 index 00000000..c0807261 --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.20.0) + +if(DEFINED CUSTOM_BOILERPLATE) + include(${CUSTOM_BOILERPLATE}) + return() +endif() + +set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../common) +include(${COMMON_PATH}/common.cmake) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(nrfx_example) +target_sources(app PRIVATE main.c) +target_include_directories(app PRIVATE ../../common) diff --git a/nrfx/samples/src/nrfx_cracen/README.md b/nrfx/samples/src/nrfx_cracen/README.md new file mode 100644 index 00000000..ed40fd56 --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/README.md @@ -0,0 +1,44 @@ +# CRACEN {#cracen_basic_desc} + +The sample demonstrates a basic functionality of the nrfx_cracen driver. + +## Requirements + +The sample supports the following development kits: + +| **Board** | **Support** | +|---------------------|:-----------:| +| nrf52dk_nrf52832 | No | +| nrf52833dk_nrf52833 | No | +| nrf52840dk_nrf52840 | No | +| nrf5340dk_nrf5340 | No | +| nrf54l15dk_nrf54l15 | Yes | +| nrf9160dk_nrf9160 | No | + +## Overview + +Application initializes nrfx_cracen driver and fills a buffer with random data. + +> For more information, see **CRACEN driver - nrfx documentation**. + +## Wiring + +To run this sample, no special configuration is needed. +You should monitor the output from the board to check if it is as expected. + +## Building and running + +To run this sample, build it for the appropriate board and then flash it as per instructions in [Building and running](@ref building_and_running) section. + +## Testing + +You should see the following output: + +``` + - "Starting nrfx_cracen example" + - "Generated value: (.*)" +``` +> `(.*)` stands for the generated random number [0..255]. + +[//]: # +[Building and running]: <../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_cracen/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_cracen/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..6c87b9bb --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,17 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&rng { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_cracen/main.c b/nrfx/samples/src/nrfx_cracen/main.c new file mode 100644 index 00000000..c09d3eba --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/main.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2025, Nordic Semiconductor ASA + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#define NRFX_LOG_MODULE EXAMPLE +#define NRFX_EXAMPLE_CONFIG_LOG_ENABLED 1 +#define NRFX_EXAMPLE_CONFIG_LOG_LEVEL 3 +#include + +/** + * @defgroup nrfx_cracen_example Basic CRACEN example + * @{ + * @ingroup nrfx_cracen_examples + * + * @brief Example showing basic functionality of nrfx_cracen driver. + * + * @details Application initializes nrfx_cracen driver and fills a buffer with random data. + */ + +/** @brief Symbol specifying number of random values to generate. */ +#define RANDOM_BYTES_COUNT 5UL + +/** + * @brief Function for application main entry. + * + * @return Nothing. + */ +int main(void) +{ + nrfx_err_t status; + (void)status; + + NRFX_EXAMPLE_LOG_INIT(); + + NRFX_LOG_INFO("Starting nrfx_cracen example:"); + NRFX_EXAMPLE_LOG_PROCESS(); + + status = nrfx_cracen_ctr_drbg_init(); + NRFX_ASSERT(status == NRFX_SUCCESS); + + uint8_t buffer[RANDOM_BYTES_COUNT]; + status = nrfx_cracen_ctr_drbg_random_get(buffer, RANDOM_BYTES_COUNT); + NRFX_ASSERT(status == NRFX_SUCCESS); + + for (size_t i = 0; i < RANDOM_BYTES_COUNT; i++) + { + NRFX_LOG_INFO("Generated value: %d", buffer[i]); + } + + nrfx_cracen_ctr_drbg_uninit(); + NRFX_ASSERT(status == NRFX_SUCCESS); + + while (1) + { + NRFX_EXAMPLE_LOG_PROCESS(); + } +} + +/** @} */ diff --git a/nrfx/samples/src/nrfx_cracen/prj.conf b/nrfx/samples/src/nrfx_cracen/prj.conf new file mode 100644 index 00000000..33483fe9 --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/prj.conf @@ -0,0 +1 @@ +CONFIG_NRFX_CRACEN=y diff --git a/nrfx/samples/src/nrfx_cracen/sample.yaml b/nrfx/samples/src/nrfx_cracen/sample.yaml new file mode 100644 index 00000000..87019038 --- /dev/null +++ b/nrfx/samples/src/nrfx_cracen/sample.yaml @@ -0,0 +1,17 @@ +sample: + description: An example to showcase usage of the nrfx_cracen driver + name: nrfx_cracen example +tests: + examples.nrfx_cracen: + tags: cracen + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "Starting nrfx_cracen example" + - "Generated value: (.*)" diff --git a/nrfx/samples/src/nrfx_egu/CMakeLists.txt b/nrfx/samples/src/nrfx_egu/CMakeLists.txt index a6e9d310..c0807261 100644 --- a/nrfx/samples/src/nrfx_egu/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_egu/CMakeLists.txt @@ -9,6 +9,7 @@ set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../common) include(${COMMON_PATH}/common.cmake) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + project(nrfx_example) target_sources(app PRIVATE main.c) target_include_directories(app PRIVATE ../../common) diff --git a/nrfx/samples/src/nrfx_egu/README.md b/nrfx/samples/src/nrfx_egu/README.md index 9fb5d165..4bbbe440 100644 --- a/nrfx/samples/src/nrfx_egu/README.md +++ b/nrfx/samples/src/nrfx_egu/README.md @@ -11,6 +11,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview @@ -41,4 +42,4 @@ You should see the following output: ``` [//]: # -[Building and running]: <../../README.md#building-and-running> \ No newline at end of file +[Building and running]: <../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_egu/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 00000000..dfbd971e --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU0=y diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_egu/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000..dfbd971e --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU0=y diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_egu/boards/nrf52dk_nrf52832.conf new file mode 100644 index 00000000..dfbd971e --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf52dk_nrf52832.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU0=y diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_egu/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000..dfbd971e --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU0=y diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..defb2b51 --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU10=y diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..7732db88 --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,17 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&egu10 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_egu/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_egu/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 00000000..dfbd971e --- /dev/null +++ b/nrfx/samples/src/nrfx_egu/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1 @@ +CONFIG_NRFX_EGU0=y diff --git a/nrfx/samples/src/nrfx_egu/main.c b/nrfx/samples/src/nrfx_egu/main.c index aed00468..1fb7c97f 100644 --- a/nrfx/samples/src/nrfx_egu/main.c +++ b/nrfx/samples/src/nrfx_egu/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -51,9 +51,6 @@ * for each triggered channel with relevant log message. */ -/** @brief Symbol specifying EGU instance to use. */ -#define EGU_INST_IDX 0 - /** * @brief Function for handling EGU driver events. * diff --git a/nrfx/samples/src/nrfx_egu/prj.conf b/nrfx/samples/src/nrfx_egu/prj.conf index dfbd971e..72801566 100644 --- a/nrfx/samples/src/nrfx_egu/prj.conf +++ b/nrfx/samples/src/nrfx_egu/prj.conf @@ -1 +1 @@ -CONFIG_NRFX_EGU0=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_egu/sample.yaml b/nrfx/samples/src/nrfx_egu/sample.yaml index b9aaad67..35dee375 100644 --- a/nrfx/samples/src/nrfx_egu/sample.yaml +++ b/nrfx/samples/src/nrfx_egu/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_egu: tags: egu - filter: dt_compat_enabled("nordic,nrf-egu") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf52833dk_nrf52833.conf index 50474282..a9dc76e4 100644 --- a/nrfx/samples/src/nrfx_gppi/boards/nrf52833dk_nrf52833.conf +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf52833dk_nrf52833.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_GPIOTE0=y diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf52840dk_nrf52840.conf index 50474282..a9dc76e4 100644 --- a/nrfx/samples/src/nrfx_gppi/boards/nrf52840dk_nrf52840.conf +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf52840dk_nrf52840.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_GPIOTE0=y diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf52dk_nrf52832.conf index 50474282..a9dc76e4 100644 --- a/nrfx/samples/src/nrfx_gppi/boards/nrf52dk_nrf52832.conf +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf52dk_nrf52832.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_GPIOTE0=y diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf5340dk_nrf5340_cpuapp.conf index f8fc5b0c..58f9040d 100644 --- a/nrfx/samples/src/nrfx_gppi/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1 +1,3 @@ CONFIG_NRFX_DPPI0=y +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_GPIOTE0=y diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..ed64c3d3 --- /dev/null +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_GPIOTE20=y +CONFIG_NRFX_TIMER20=y diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..bfa07c63 --- /dev/null +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,21 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&timer20 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_gppi/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_gppi/boards/nrf9160dk_nrf9160.conf index f8fc5b0c..58f9040d 100644 --- a/nrfx/samples/src/nrfx_gppi/boards/nrf9160dk_nrf9160.conf +++ b/nrfx/samples/src/nrfx_gppi/boards/nrf9160dk_nrf9160.conf @@ -1 +1,3 @@ CONFIG_NRFX_DPPI0=y +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_GPIOTE0=y diff --git a/nrfx/samples/src/nrfx_gppi/fork/CMakeLists.txt b/nrfx/samples/src/nrfx_gppi/fork/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_gppi/fork/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_gppi/fork/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_gppi/fork/README.md b/nrfx/samples/src/nrfx_gppi/fork/README.md index a4743914..f5ce2fbe 100644 --- a/nrfx/samples/src/nrfx_gppi/fork/README.md +++ b/nrfx/samples/src/nrfx_gppi/fork/README.md @@ -11,6 +11,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | PPI | | nrf52840dk_nrf52840 | Yes | PPI | | nrf5340dk_nrf5340 | Yes | DPPI | +| nrf54l15dk_nrf54l15 | Yes | DPPI | | nrf9160dk_nrf9160 | Yes | DPPI | ## Overview diff --git a/nrfx/samples/src/nrfx_gppi/fork/main.c b/nrfx/samples/src/nrfx_gppi/fork/main.c index cc7e7b87..ee9f46b5 100644 --- a/nrfx/samples/src/nrfx_gppi/fork/main.c +++ b/nrfx/samples/src/nrfx_gppi/fork/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -53,21 +53,9 @@ * Fork mechanism in PPI/DPPI is also set up to toggle a second pin in GPIOTE at the same time. */ -/** @brief Symbol specifying timer instance to be used. */ -#define TIMER_INST_IDX 0 - /** @brief Symbol specifying time in milliseconds to wait for handler execution. */ #define TIME_TO_WAIT_MS 1000UL -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - -/** @brief Symbol specifying output pin associated with primary task. */ -#define OUTPUT_PIN_PRIMARY LED1_PIN - -/** @brief Symbol specifying output pin associated with fork task. */ -#define OUTPUT_PIN_FORK LED2_PIN - /** * @brief Function for handling TIMER driver events. * @@ -82,10 +70,10 @@ static void timer_handler(nrf_timer_event_t event_type, void * p_context) { char * p_msg = p_context; NRFX_LOG_INFO("Timer finished. Context passed to the handler: >%s<", p_msg); - NRFX_LOG_INFO("GPIOTE output pin (primary): %d is %s", OUTPUT_PIN_PRIMARY, - nrfx_gpiote_in_is_set(OUTPUT_PIN_PRIMARY) ? "high" : "low"); - NRFX_LOG_INFO("GPIOTE output pin (fork): %d is %s", OUTPUT_PIN_FORK, - nrfx_gpiote_in_is_set(OUTPUT_PIN_FORK) ? "high" : "low"); + NRFX_LOG_INFO("GPIOTE output pin (primary): %d is %s", GPPI_OUTPUT_PIN_PRIMARY, + nrfx_gpiote_in_is_set(GPPI_OUTPUT_PIN_PRIMARY) ? "high" : "low"); + NRFX_LOG_INFO("GPIOTE output pin (fork): %d is %s", GPPI_OUTPUT_PIN_FORK, + nrfx_gpiote_in_is_set(GPPI_OUTPUT_PIN_FORK) ? "high" : "low"); } } @@ -103,10 +91,10 @@ int main(void) uint8_t gppi_channel; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_TIMER_INST_GET(TIMER_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_TIMER_INST_HANDLER_GET(TIMER_INST_IDX), 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_TIMER_INST_GET(GPPI_TIMER_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_TIMER_INST_HANDLER_GET(GPPI_TIMER_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPPI_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(GPPI_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -114,7 +102,7 @@ int main(void) NRFX_LOG_INFO("Starting nrfx_gppi basic fork example."); NRFX_EXAMPLE_LOG_PROCESS(); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPPI_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", @@ -145,12 +133,12 @@ int main(void) }; status = nrfx_gpiote_output_configure(&gpiote_inst, - OUTPUT_PIN_PRIMARY, + GPPI_OUTPUT_PIN_PRIMARY, &output_config, &task_config); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_out_task_enable(&gpiote_inst, OUTPUT_PIN_PRIMARY); + nrfx_gpiote_out_task_enable(&gpiote_inst, GPPI_OUTPUT_PIN_PRIMARY); /* * Initialize the output pin associated with the fork task. @@ -160,14 +148,14 @@ int main(void) task_config.init_val = NRF_GPIOTE_INITIAL_VALUE_LOW; status = nrfx_gpiote_output_configure(&gpiote_inst, - OUTPUT_PIN_FORK, + GPPI_OUTPUT_PIN_FORK, &output_config, &task_config); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_out_task_enable(&gpiote_inst, OUTPUT_PIN_FORK); + nrfx_gpiote_out_task_enable(&gpiote_inst, GPPI_OUTPUT_PIN_FORK); - nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX); + nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(GPPI_TIMER_INST_IDX); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer_inst.p_reg); nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); timer_config.bit_width = NRF_TIMER_BIT_WIDTH_32; @@ -199,14 +187,14 @@ int main(void) */ nrfx_gppi_channel_endpoints_setup(gppi_channel, nrfx_timer_compare_event_address_get(&timer_inst, NRF_TIMER_CC_CHANNEL0), - nrfx_gpiote_out_task_address_get(&gpiote_inst, OUTPUT_PIN_PRIMARY)); + nrfx_gpiote_out_task_address_get(&gpiote_inst, GPPI_OUTPUT_PIN_PRIMARY)); /* * Set up the task endpoint for a given PPI fork or for associating the DPPI channel * with an additional task register depending on which driver the GPPI helper is using. */ nrfx_gppi_fork_endpoint_setup(gppi_channel, - nrfx_gpiote_out_task_address_get(&gpiote_inst, OUTPUT_PIN_FORK)); + nrfx_gpiote_out_task_address_get(&gpiote_inst, GPPI_OUTPUT_PIN_FORK)); nrfx_gppi_channels_enable(BIT(gppi_channel)); diff --git a/nrfx/samples/src/nrfx_gppi/fork/prj.conf b/nrfx/samples/src/nrfx_gppi/fork/prj.conf index bef26865..a2ddb4c8 100644 --- a/nrfx/samples/src/nrfx_gppi/fork/prj.conf +++ b/nrfx/samples/src/nrfx_gppi/fork/prj.conf @@ -1,4 +1,2 @@ -CONFIG_NRFX_TIMER0=y CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_GPPI=y diff --git a/nrfx/samples/src/nrfx_gppi/fork/sample.yaml b/nrfx/samples/src/nrfx_gppi/fork/sample.yaml index b9f80bbb..c03a7836 100644 --- a/nrfx/samples/src/nrfx_gppi/fork/sample.yaml +++ b/nrfx/samples/src/nrfx_gppi/fork/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_gppi.fork: tags: gppi - filter: dt_compat_enabled("nordic,nrf-ppi") or dt_compat_enabled("nordic,nrf-dppic") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_gppi/one_to_one/CMakeLists.txt b/nrfx/samples/src/nrfx_gppi/one_to_one/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_gppi/one_to_one/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_gppi/one_to_one/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_gppi/one_to_one/README.md b/nrfx/samples/src/nrfx_gppi/one_to_one/README.md index 3f91d89b..2d53db57 100644 --- a/nrfx/samples/src/nrfx_gppi/one_to_one/README.md +++ b/nrfx/samples/src/nrfx_gppi/one_to_one/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | PPI | | nrf52840dk_nrf52840 | Yes | PPI | | nrf5340dk_nrf5340 | Yes | DPPI | +| nrf54l15dk_nrf54l15 | Yes | DPPI | | nrf9160dk_nrf9160 | Yes | DPPI | ## Overview diff --git a/nrfx/samples/src/nrfx_gppi/one_to_one/main.c b/nrfx/samples/src/nrfx_gppi/one_to_one/main.c index 89c157e3..68f54848 100644 --- a/nrfx/samples/src/nrfx_gppi/one_to_one/main.c +++ b/nrfx/samples/src/nrfx_gppi/one_to_one/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -52,18 +52,9 @@ * TIMER compare event is set up to be forwarded via PPI/DPPI to GPIOTE and toggle a pin. */ -/** @brief Symbol specifying timer instance to be used. */ -#define TIMER_INST_IDX 0 - /** @brief Symbol specifying time in milliseconds to wait for handler execution. */ #define TIME_TO_WAIT_MS 1000UL -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - -/** @brief Symbol specifying ouput pin associated with the task. */ -#define OUTPUT_PIN LED1_PIN - /** * @brief Function for handling TIMER driver events. * @@ -78,8 +69,8 @@ static void timer_handler(nrf_timer_event_t event_type, void * p_context) { char * p_msg = p_context; NRFX_LOG_INFO("Timer finished. Context passed to the handler: >%s<", p_msg); - NRFX_LOG_INFO("GPIOTE output pin: %d is %s", OUTPUT_PIN, - nrfx_gpiote_in_is_set(OUTPUT_PIN) ? "high" : "low"); + NRFX_LOG_INFO("GPIOTE output pin: %d is %s", GPPI_OUTPUT_PIN_PRIMARY, + nrfx_gpiote_in_is_set(GPPI_OUTPUT_PIN_PRIMARY) ? "high" : "low"); } } @@ -97,10 +88,10 @@ int main(void) uint8_t gppi_channel; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_TIMER_INST_GET(TIMER_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_TIMER_INST_HANDLER_GET(TIMER_INST_IDX), 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_TIMER_INST_GET(GPPI_TIMER_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_TIMER_INST_HANDLER_GET(GPPI_TIMER_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPPI_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(GPPI_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -108,7 +99,7 @@ int main(void) NRFX_LOG_INFO("Starting nrfx_gppi basic one-to-one example."); NRFX_EXAMPLE_LOG_PROCESS(); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPPI_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", @@ -135,12 +126,12 @@ int main(void) .init_val = NRF_GPIOTE_INITIAL_VALUE_HIGH, }; - status = nrfx_gpiote_output_configure(&gpiote_inst, OUTPUT_PIN, &output_config, &task_config); + status = nrfx_gpiote_output_configure(&gpiote_inst, GPPI_OUTPUT_PIN_PRIMARY, &output_config, &task_config); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_out_task_enable(&gpiote_inst, OUTPUT_PIN); + nrfx_gpiote_out_task_enable(&gpiote_inst, GPPI_OUTPUT_PIN_PRIMARY); - nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX); + nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(GPPI_TIMER_INST_IDX); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer_inst.p_reg); nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); timer_config.bit_width = NRF_TIMER_BIT_WIDTH_32; @@ -172,7 +163,7 @@ int main(void) */ nrfx_gppi_channel_endpoints_setup(gppi_channel, nrfx_timer_compare_event_address_get(&timer_inst, NRF_TIMER_CC_CHANNEL0), - nrfx_gpiote_out_task_address_get(&gpiote_inst, OUTPUT_PIN)); + nrfx_gpiote_out_task_address_get(&gpiote_inst, GPPI_OUTPUT_PIN_PRIMARY)); nrfx_gppi_channels_enable(BIT(gppi_channel)); diff --git a/nrfx/samples/src/nrfx_gppi/one_to_one/prj.conf b/nrfx/samples/src/nrfx_gppi/one_to_one/prj.conf index bef26865..a2ddb4c8 100644 --- a/nrfx/samples/src/nrfx_gppi/one_to_one/prj.conf +++ b/nrfx/samples/src/nrfx_gppi/one_to_one/prj.conf @@ -1,4 +1,2 @@ -CONFIG_NRFX_TIMER0=y CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_GPPI=y diff --git a/nrfx/samples/src/nrfx_gppi/one_to_one/sample.yaml b/nrfx/samples/src/nrfx_gppi/one_to_one/sample.yaml index 4b188f39..d72d0fa6 100644 --- a/nrfx/samples/src/nrfx_gppi/one_to_one/sample.yaml +++ b/nrfx/samples/src/nrfx_gppi/one_to_one/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_gppi.one_to_one: tags: gppi - filter: dt_compat_enabled("nordic,nrf-ppi") or dt_compat_enabled("nordic,nrf-dppic") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 00000000..de992e27 --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM0=y diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000..de992e27 --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM0=y diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf52dk_nrf52832.conf new file mode 100644 index 00000000..de992e27 --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf52dk_nrf52832.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM0=y diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000..de992e27 --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM0=y diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..9eb3c6fd --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM20=y diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..9450d04c --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,17 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&pwm20 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_pwm/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_pwm/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 00000000..de992e27 --- /dev/null +++ b/nrfx/samples/src/nrfx_pwm/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1 @@ +CONFIG_NRFX_PWM0=y diff --git a/nrfx/samples/src/nrfx_pwm/common_mode/CMakeLists.txt b/nrfx/samples/src/nrfx_pwm/common_mode/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_pwm/common_mode/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_pwm/common_mode/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_pwm/common_mode/README.md b/nrfx/samples/src/nrfx_pwm/common_mode/README.md index 70496e52..274ee15b 100644 --- a/nrfx/samples/src/nrfx_pwm/common_mode/README.md +++ b/nrfx/samples/src/nrfx_pwm/common_mode/README.md @@ -6,14 +6,14 @@ The sample demonstrates a basic functionality of the nrfx_pwm driver for a seque The sample supports the following development kits: - -| **Board** | **Support** | -|---------------------|:-----------:| -| nrf52dk_nrf52832 | Yes | -| nrf52833dk_nrf52833 | Yes | -| nrf52840dk_nrf52840 | Yes | -| nrf5340dk_nrf5340 | Yes | -| nrf9160dk_nrf9160 | Yes | +| **Board** | **Support** | **Number of LEDs expected to blink** | +|---------------------|:-----------:|:-------------------------------------:| +| nrf52dk_nrf52832 | Yes | 4 | +| nrf52833dk_nrf52833 | Yes | 4 | +| nrf52840dk_nrf52840 | Yes | 4 | +| nrf5340dk_nrf5340 | Yes | 4 | +| nrf54l15dk_nrf54l15 | Yes | 2 | +| nrf9160dk_nrf9160 | Yes | 4 | ## Overview @@ -43,7 +43,7 @@ You should see the following output: - "Loops: 3 / 3" - "PWM finished" ``` -4 LEDs on the development kit should blink in the following sequence: +Two or four LEDs on the development kit should blink in the following sequence: @cond DOXYGEN_EXCLUDE ![pwm_common_gif](../../../doc/images/pwm_common_desc.gif "PWM common example") diff --git a/nrfx/samples/src/nrfx_pwm/common_mode/main.c b/nrfx/samples/src/nrfx_pwm/common_mode/main.c index b920ed88..3dde9742 100644 --- a/nrfx/samples/src/nrfx_pwm/common_mode/main.c +++ b/nrfx/samples/src/nrfx_pwm/common_mode/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -51,9 +51,6 @@ * executed with relevant log message after every loop. */ -/** @brief Symbol specifying PWM instance to be used. */ -#define PWM_INST_IDX 0 - /** * @brief Symbol specifying number of times that each duty cycle is to be repeated (after being * played once) and is strictly correlated with the "breath" effect speed. @@ -120,7 +117,9 @@ int main(void) NRFX_EXAMPLE_LOG_PROCESS(); nrfx_pwm_t pwm_instance = NRFX_PWM_INSTANCE(PWM_INST_IDX); - nrfx_pwm_config_t config = NRFX_PWM_DEFAULT_CONFIG(LED1_PIN, LED2_PIN, LED3_PIN, LED4_PIN); + nrfx_pwm_config_t config = NRFX_PWM_DEFAULT_CONFIG(PWM_LED1_PIN, PWM_LED2_PIN, + PWM_LED3_PIN, PWM_LED4_PIN); + status = nrfx_pwm_init(&pwm_instance, &config, pwm_handler, &pwm_instance); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_pwm/common_mode/prj.conf b/nrfx/samples/src/nrfx_pwm/common_mode/prj.conf index de992e27..72801566 100644 --- a/nrfx/samples/src/nrfx_pwm/common_mode/prj.conf +++ b/nrfx/samples/src/nrfx_pwm/common_mode/prj.conf @@ -1 +1 @@ -CONFIG_NRFX_PWM0=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_pwm/common_mode/sample.yaml b/nrfx/samples/src/nrfx_pwm/common_mode/sample.yaml index 45541268..acc42bca 100644 --- a/nrfx/samples/src/nrfx_pwm/common_mode/sample.yaml +++ b/nrfx/samples/src/nrfx_pwm/common_mode/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_pwm.common_mode: tags: pwm - filter: dt_compat_enabled("nordic,nrf-pwm") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_pwm/grouped_mode/CMakeLists.txt b/nrfx/samples/src/nrfx_pwm/grouped_mode/CMakeLists.txt index 410fabc1..24cae47c 100644 --- a/nrfx/samples/src/nrfx_pwm/grouped_mode/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_pwm/grouped_mode/CMakeLists.txt @@ -8,6 +8,8 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) + +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_pwm/grouped_mode/README.md b/nrfx/samples/src/nrfx_pwm/grouped_mode/README.md index 7c9ee3e9..74794223 100644 --- a/nrfx/samples/src/nrfx_pwm/grouped_mode/README.md +++ b/nrfx/samples/src/nrfx_pwm/grouped_mode/README.md @@ -6,13 +6,14 @@ The sample demonstrates a basic functionality of the nrfx_pwm driver for a seque The sample supports the following development kits: -| **Board** | **Support** | -|---------------------|:-----------:| -| nrf52dk_nrf52832 | Yes | -| nrf52833dk_nrf52833 | Yes | -| nrf52840dk_nrf52840 | Yes | -| nrf5340dk_nrf5340 | Yes | -| nrf9160dk_nrf9160 | Yes | +| **Board** | **Support** | **Number of LEDs expected to blink** | +|---------------------|:-----------:|:-------------------------------------:| +| nrf52dk_nrf52832 | Yes | 4 | +| nrf52833dk_nrf52833 | Yes | 4 | +| nrf52840dk_nrf52840 | Yes | 4 | +| nrf5340dk_nrf5340 | Yes | 4 | +| nrf54l15dk_nrf54l15 | Yes | 2 | +| nrf9160dk_nrf9160 | Yes | 4 | ## Overview @@ -52,7 +53,7 @@ You should see the following output: - SEQ1 changed to sequence number 1 from the seq array - PWM finished ``` -4 LEDs on the development kit should blink in the following sequence: +Two or four LEDs on the development kit should blink in the following sequence: @cond DOXYGEN_EXCLUDE ![pwm_grouped_gif](../../../doc/images/pwm_grouped_desc.gif "PWM grouped example") diff --git a/nrfx/samples/src/nrfx_pwm/grouped_mode/main.c b/nrfx/samples/src/nrfx_pwm/grouped_mode/main.c index 2b56c526..6ba4a5fb 100644 --- a/nrfx/samples/src/nrfx_pwm/grouped_mode/main.c +++ b/nrfx/samples/src/nrfx_pwm/grouped_mode/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -53,9 +53,6 @@ * called. */ -/** @brief Symbol specifying PWM instance to be used. */ -#define PWM_INST_IDX 0 - /** * @brief Symbol specifying number of times that each duty cycle is to be repeated (after being * played once) and is strictly correlated with the speed of LEDs brightness change. @@ -204,7 +201,8 @@ int main(void) NRFX_EXAMPLE_LOG_PROCESS(); nrfx_pwm_t pwm_instance = NRFX_PWM_INSTANCE(PWM_INST_IDX); - nrfx_pwm_config_t config = NRFX_PWM_DEFAULT_CONFIG(LED1_PIN, LED4_PIN, LED2_PIN, LED3_PIN); + nrfx_pwm_config_t config = NRFX_PWM_DEFAULT_CONFIG(PWM_LED1_PIN, PWM_LED2_PIN, + PWM_LED3_PIN, PWM_LED4_PIN); config.load_mode = NRF_PWM_LOAD_GROUPED; status = nrfx_pwm_init(&pwm_instance, &config, pwm_handler, &pwm_instance); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_pwm/grouped_mode/prj.conf b/nrfx/samples/src/nrfx_pwm/grouped_mode/prj.conf index de992e27..72801566 100644 --- a/nrfx/samples/src/nrfx_pwm/grouped_mode/prj.conf +++ b/nrfx/samples/src/nrfx_pwm/grouped_mode/prj.conf @@ -1 +1 @@ -CONFIG_NRFX_PWM0=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_pwm/grouped_mode/sample.yaml b/nrfx/samples/src/nrfx_pwm/grouped_mode/sample.yaml index 13b9736b..2104e1a6 100644 --- a/nrfx/samples/src/nrfx_pwm/grouped_mode/sample.yaml +++ b/nrfx/samples/src/nrfx_pwm/grouped_mode/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_pwm.grouped_mode: tags: pwm - filter: dt_compat_enabled("nordic,nrf-pwm") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_rng/CMakeLists.txt b/nrfx/samples/src/nrfx_rng/CMakeLists.txt index a6e9d310..c0807261 100644 --- a/nrfx/samples/src/nrfx_rng/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_rng/CMakeLists.txt @@ -9,6 +9,7 @@ set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../common) include(${COMMON_PATH}/common.cmake) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + project(nrfx_example) target_sources(app PRIVATE main.c) target_include_directories(app PRIVATE ../../common) diff --git a/nrfx/samples/src/nrfx_rng/README.md b/nrfx/samples/src/nrfx_rng/README.md index 65751eb1..50a9269f 100644 --- a/nrfx/samples/src/nrfx_rng/README.md +++ b/nrfx/samples/src/nrfx_rng/README.md @@ -12,7 +12,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | No | | nrf9160dk_nrf9160 | No | + ## Overview Application initializes the nrfx_rng driver. diff --git a/nrfx/samples/src/nrfx_rng/main.c b/nrfx/samples/src/nrfx_rng/main.c index ad9ddfa2..e7020671 100644 --- a/nrfx/samples/src/nrfx_rng/main.c +++ b/nrfx/samples/src/nrfx_rng/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause diff --git a/nrfx/samples/src/nrfx_rng/prj.conf b/nrfx/samples/src/nrfx_rng/prj.conf index fe53aed1..58e39288 100644 --- a/nrfx/samples/src/nrfx_rng/prj.conf +++ b/nrfx/samples/src/nrfx_rng/prj.conf @@ -1 +1,2 @@ CONFIG_NRFX_RNG=y +CONFIG_ENTROPY_NRF5_RNG=n diff --git a/nrfx/samples/src/nrfx_rng/sample.yaml b/nrfx/samples/src/nrfx_rng/sample.yaml index 9c22c313..1ffaacc9 100644 --- a/nrfx/samples/src/nrfx_rng/sample.yaml +++ b/nrfx/samples/src/nrfx_rng/sample.yaml @@ -4,17 +4,15 @@ sample: tests: examples.nrfx_rng: tags: rng - filter: dt_compat_enabled("nordic,nrf-rng") platform_allow: + - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpunet integration_platforms: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpunet harness: console harness_config: type: multi_line diff --git a/nrfx/samples/src/nrfx_saadc/advanced_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_saadc/advanced_blocking/CMakeLists.txt index 051c260e..bf7c4b77 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_saadc/advanced_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_saadc/advanced_blocking/README.md b/nrfx/samples/src/nrfx_saadc/advanced_blocking/README.md index 530ef516..bfa2666a 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_blocking/README.md +++ b/nrfx/samples/src/nrfx_saadc/advanced_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview @@ -50,24 +51,24 @@ You should see the following output: - "Starting nrfx_saadc advanced blocking example." - "Calibration in the blocking manner finished successfully." - "Sampling 1 / 5" -- ".Sample 0. value == ([0-9]{3})" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 0. value == ([0-9]{4})" +- ".Sample 1. value == ([0-9]{4})" - "Calibration in the blocking manner finished successfully." - "Sampling 2 / 5" - ".Sample 0. value == -?[0-9]" - ".Sample 1. value == -?[0-9]" - "Calibration in the blocking manner finished successfully." - "Sampling 3 / 5" -- ".Sample 0. value == ([0-9]{3})" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 0. value == ([0-9]{4})" +- ".Sample 1. value == ([0-9]{4})" - "Calibration in the blocking manner finished successfully." - "Sampling 4 / 5" - ".Sample 0. value == -?[0-9]" - ".Sample 1. value == -?[0-9]" - "Calibration in the blocking manner finished successfully." - "Sampling 5 / 5" -- ".Sample 0. value == ([0-9]{3})" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 0. value == ([0-9]{4})" +- ".Sample 1. value == ([0-9]{4})" ``` [//]: # [Building and running]: <../../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_saadc/advanced_blocking/main.c b/nrfx/samples/src/nrfx_saadc/advanced_blocking/main.c index 95fcebe4..0bfe323f 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_blocking/main.c +++ b/nrfx/samples/src/nrfx_saadc/advanced_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -58,14 +58,8 @@ * is being triggered between successive samplings to verify the functionality of the SAADC on the non-constant analog signal. */ -/** @brief Symbol specifying analog input to be observed by SAADC channel 0. */ -#define CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) - -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - /** @brief Symbol specifying GPIO pin used to test the functionality of SAADC. */ -#define OUT_GPIO_PIN LOOPBACK_PIN_1B +#define OUT_GPIO_PIN SAADC_CH0_LOOPBACK_PIN /** @brief Symbol specifying the size of singular sample buffer ( @ref m_samples_buffer ). */ #define BUFFER_SIZE 2UL @@ -77,7 +71,7 @@ #define RESOLUTION NRF_SAADC_RESOLUTION_10BIT /** @brief SAADC channel configuration structure for single channel use. */ -static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(CH0_AIN, 0); +static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(SAADC_CH0_AIN, 0); /** @brief Samples buffer to store values from a SAADC channel. */ static uint16_t m_samples_buffer[BUFFER_SIZE]; @@ -93,8 +87,8 @@ int main(void) (void)status; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(SAADC_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(SAADC_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -104,7 +98,7 @@ int main(void) status = nrfx_saadc_init(NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(SAADC_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", diff --git a/nrfx/samples/src/nrfx_saadc/advanced_blocking/prj.conf b/nrfx/samples/src/nrfx_saadc/advanced_blocking/prj.conf index 773c30e2..605714a4 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_saadc/advanced_blocking/prj.conf @@ -1,4 +1,3 @@ CONFIG_LOG_BUFFER_SIZE=4096 CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_SAADC=y diff --git a/nrfx/samples/src/nrfx_saadc/advanced_blocking/sample.yaml b/nrfx/samples/src/nrfx_saadc/advanced_blocking/sample.yaml index f5a747e3..4ba47a4c 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_saadc/advanced_blocking/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_saadc.advanced_blocking: tags: saadc - filter: dt_compat_enabled("nordic,nrf-saadc") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: @@ -26,21 +27,21 @@ tests: - "Starting nrfx_saadc advanced blocking example." - "Calibration in the blocking manner finished successfully." - "Sampling 1 / 5" - - ".Sample 0. value == ([0-9]{3})" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 0. value == ([0-9]{4})" + - ".Sample 1. value == ([0-9]{4})" - "Calibration in the blocking manner finished successfully." - "Sampling 2 / 5" - ".Sample 0. value == -?[0-9]" - ".Sample 1. value == -?[0-9]" - "Calibration in the blocking manner finished successfully." - "Sampling 3 / 5" - - ".Sample 0. value == ([0-9]{3})" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 0. value == ([0-9]{4})" + - ".Sample 1. value == ([0-9]{4})" - "Calibration in the blocking manner finished successfully." - "Sampling 4 / 5" - ".Sample 0. value == -?[0-9]" - ".Sample 1. value == -?[0-9]" - "Calibration in the blocking manner finished successfully." - "Sampling 5 / 5" - - ".Sample 0. value == ([0-9]{3})" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 0. value == ([0-9]{4})" + - ".Sample 1. value == ([0-9]{4})" diff --git a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/CMakeLists.txt b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/CMakeLists.txt index 051c260e..bf7c4b77 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/README.md b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/README.md index f7494dcd..2c34085a 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/README.md +++ b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview @@ -52,26 +53,26 @@ You should see the following output: - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 1. value == ([0-9]{4})" - ".Sample 2. value == -?[0-9]" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" -- ".Sample 0. value == ([0-9]{3})" +- ".Sample 0. value == ([0-9]{4})" - ".Sample 1. value == -?[0-9]" -- ".Sample 2. value == ([0-9]{3})" +- ".Sample 2. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 1. value == ([0-9]{4})" - ".Sample 2. value == -?[0-9]" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" -- ".Sample 0. value == ([0-9]{3})" +- ".Sample 0. value == ([0-9]{4})" - ".Sample 1. value == -?[0-9]" -- ".Sample 2. value == ([0-9]{3})" +- ".Sample 2. value == ([0-9]{4})" - "SAADC event: FINISHED" ``` diff --git a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/main.c b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/main.c index 89cc7a0a..589d73b8 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/main.c +++ b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -63,14 +63,8 @@ * Please note that the internal timer can only be used in the non-blocking mode with only a single input channel enabled. */ -/** @brief Symbol specifying analog input to be observed by SAADC channel 0. */ -#define CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) - -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - /** @brief Symbol specifying GPIO pin used to test the functionality of SAADC. */ -#define OUT_GPIO_PIN LOOPBACK_PIN_1B +#define OUT_GPIO_PIN SAADC_CH0_LOOPBACK_PIN /** @brief Acquisition time [us] for source resistance <= 10 kOhm (see SAADC electrical specification). */ #define ACQ_TIME_10K 3UL @@ -103,7 +97,7 @@ #define RESOLUTION NRF_SAADC_RESOLUTION_10BIT /** @brief SAADC channel configuration structure for single channel use. */ -static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(CH0_AIN, 0); +static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(SAADC_CH0_AIN, 0); /** @brief Samples buffer to store values from a single channel ( @ref m_single_channel). */ static uint16_t m_sample_buffers[BUFFER_COUNT][BUFFER_SIZE]; @@ -188,8 +182,8 @@ int main(void) (void)status; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(SAADC_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(SAADC_GPIOTE_INST_IDX), 0, 0); IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SAADC), IRQ_PRIO_LOWEST, nrfx_saadc_irq_handler, 0, 0); #endif @@ -217,7 +211,7 @@ int main(void) status = nrfx_saadc_buffer_set(m_sample_buffers[0], BUFFER_SIZE); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(SAADC_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", diff --git a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/prj.conf b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/prj.conf index 8429899a..0a76f24f 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/prj.conf +++ b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/prj.conf @@ -1,4 +1,3 @@ CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_SAADC=y CONFIG_NRFX_GPPI=y diff --git a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/sample.yaml b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/sample.yaml index 3f145bf1..0da6d464 100644 --- a/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/sample.yaml +++ b/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer/sample.yaml @@ -4,16 +4,17 @@ sample: tests: examples.nrfx_saadc.advanced_non_blocking_internal_timer: tags: saadc - filter: dt_compat_enabled("nordic,nrf-saadc") platform_allow: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: @@ -28,24 +29,24 @@ tests: - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{4})" - ".Sample 2. value == -?[0-9]" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - - ".Sample 0. value == ([0-9]{3})" + - ".Sample 0. value == ([0-9]{4})" - ".Sample 1. value == -?[0-9]" - - ".Sample 2. value == ([0-9]{3})" + - ".Sample 2. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{4})" - ".Sample 2. value == -?[0-9]" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - - ".Sample 0. value == ([0-9]{3})" + - ".Sample 0. value == ([0-9]{4})" - ".Sample 1. value == -?[0-9]" - - ".Sample 2. value == ([0-9]{3})" + - ".Sample 2. value == ([0-9]{4})" - "SAADC event: FINISHED" diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf52833dk_nrf52833.conf index 50474282..f9c291ef 100644 --- a/nrfx/samples/src/nrfx_saadc/boards/nrf52833dk_nrf52833.conf +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf52833dk_nrf52833.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_GPIOTE0=y +CONFIG_NRFX_TIMER0=y diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf52840dk_nrf52840.conf index 50474282..f9c291ef 100644 --- a/nrfx/samples/src/nrfx_saadc/boards/nrf52840dk_nrf52840.conf +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf52840dk_nrf52840.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_GPIOTE0=y +CONFIG_NRFX_TIMER0=y diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf52dk_nrf52832.conf index 50474282..f9c291ef 100644 --- a/nrfx/samples/src/nrfx_saadc/boards/nrf52dk_nrf52832.conf +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf52dk_nrf52832.conf @@ -1 +1,3 @@ CONFIG_NRFX_PPI=y +CONFIG_NRFX_GPIOTE0=y +CONFIG_NRFX_TIMER0=y diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf5340dk_nrf5340_cpuapp.conf index f8fc5b0c..d9bf8e13 100644 --- a/nrfx/samples/src/nrfx_saadc/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1 +1,3 @@ CONFIG_NRFX_DPPI0=y +CONFIG_NRFX_GPIOTE0=y +CONFIG_NRFX_TIMER0=y diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..ed64c3d3 --- /dev/null +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_GPIOTE20=y +CONFIG_NRFX_TIMER20=y diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..12263962 --- /dev/null +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,18 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&adc { + status = "okay"; + compatible = "nordic,nrf-saadc"; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_saadc/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_saadc/boards/nrf9160dk_nrf9160.conf index f8fc5b0c..d9bf8e13 100644 --- a/nrfx/samples/src/nrfx_saadc/boards/nrf9160dk_nrf9160.conf +++ b/nrfx/samples/src/nrfx_saadc/boards/nrf9160dk_nrf9160.conf @@ -1 +1,3 @@ CONFIG_NRFX_DPPI0=y +CONFIG_NRFX_GPIOTE0=y +CONFIG_NRFX_TIMER0=y diff --git a/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.c b/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.c index 9a3fe7e7..17bafe79 100644 --- a/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.c +++ b/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause diff --git a/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.h b/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.h index ebdb0830..5b223738 100644 --- a/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.h +++ b/nrfx/samples/src/nrfx_saadc/common/saadc_examples_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -50,8 +50,8 @@ * analog pin is less than 10 kOhm. * * This configuration sets up single-ended SAADC channel with the following options: - * - resistor ladder disabled - * - gain: 1/6 + * - resistor ladder inactive + * - gain: 1 * - reference voltage: internal 0.6 V * - sample acquisition time: 3 us * - burst disabled @@ -61,21 +61,25 @@ * * @sa nrfx_saadc_channel_t */ -#define SAADC_CHANNEL_SE_ACQ_3US(_pin_p, _index) \ -{ \ - .channel_config = \ - { \ - .resistor_p = NRF_SAADC_RESISTOR_DISABLED, \ - .resistor_n = NRF_SAADC_RESISTOR_DISABLED, \ - .gain = NRF_SAADC_GAIN1_6, \ - .reference = NRF_SAADC_REFERENCE_INTERNAL, \ - .acq_time = NRF_SAADC_ACQTIME_3US, \ - .mode = NRF_SAADC_MODE_SINGLE_ENDED, \ - .burst = NRF_SAADC_BURST_DISABLED, \ - }, \ - .pin_p = (nrf_saadc_input_t)_pin_p, \ - .pin_n = NRF_SAADC_INPUT_DISABLED, \ - .channel_index = _index, \ + #define SAADC_CHANNEL_SE_ACQ_3US(_pin_p, _index) \ +{ \ + .channel_config = \ + { \ + NRFX_COND_CODE_1(NRF_SAADC_HAS_CH_CONFIG_RES, \ + (.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \ + .resistor_n = NRF_SAADC_RESISTOR_DISABLED,), \ + ()) \ + .gain = NRF_SAADC_GAIN1, \ + .reference = NRF_SAADC_REFERENCE_INTERNAL, \ + NRFX_COND_CODE_1(NRF_SAADC_HAS_ACQTIME_ENUM, \ + (.acq_time = NRF_SAADC_ACQTIME_3US,), \ + (.acq_time = 3,)) \ + .mode = NRF_SAADC_MODE_SINGLE_ENDED, \ + .burst = NRF_SAADC_BURST_DISABLED, \ + }, \ + .pin_p = (nrf_saadc_input_t)_pin_p, \ + .pin_n = NRF_SAADC_INPUT_DISABLED, \ + .channel_index = _index, \ } /** diff --git a/nrfx/samples/src/nrfx_saadc/maximum_performance/CMakeLists.txt b/nrfx/samples/src/nrfx_saadc/maximum_performance/CMakeLists.txt index 051c260e..bf7c4b77 100644 --- a/nrfx/samples/src/nrfx_saadc/maximum_performance/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_saadc/maximum_performance/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_saadc/maximum_performance/README.md b/nrfx/samples/src/nrfx_saadc/maximum_performance/README.md index 83bdde01..7b931fff 100644 --- a/nrfx/samples/src/nrfx_saadc/maximum_performance/README.md +++ b/nrfx/samples/src/nrfx_saadc/maximum_performance/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | No | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview @@ -54,16 +55,16 @@ You should see the following output: - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 1. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 1. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - ".Sample 0. value == -?[0-9]" -- ".Sample 1. value == ([0-9]{3})" +- ".Sample 1. value == ([0-9]{4})" ``` [//]: # [Building and running]: <../../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_saadc/maximum_performance/main.c b/nrfx/samples/src/nrfx_saadc/maximum_performance/main.c index 78c188cd..d0614ccc 100644 --- a/nrfx/samples/src/nrfx_saadc/maximum_performance/main.c +++ b/nrfx/samples/src/nrfx_saadc/maximum_performance/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -69,17 +69,8 @@ * that @p NRF_SAADC_EVENT_RESULTDONE event is connected with the GPIOTE task that toggles the @ref OUT_GPIO_PIN pin. */ -/** @brief Symbol specifying timer instance to be used. */ -#define TIMER_INST_IDX 0 - -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - -/** @brief Symbol specifying analog input to be observed by SAADC channel 0. */ -#define CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) - /** @brief Symbol specifying GPIO pin used to test the functionality of SAADC. */ -#define OUT_GPIO_PIN LOOPBACK_PIN_1B +#define OUT_GPIO_PIN SAADC_CH0_LOOPBACK_PIN /** @brief Acquisition time [us] for source resistance <= 10 kOhm (see SAADC electrical specification). */ #define ACQ_TIME_10K 3UL @@ -112,7 +103,7 @@ #define RESOLUTION NRF_SAADC_RESOLUTION_10BIT /** @brief SAADC channel configuration structure for single channel use. */ -static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(CH0_AIN, 0); +static const nrfx_saadc_channel_t m_single_channel = SAADC_CHANNEL_SE_ACQ_3US(SAADC_CH0_AIN, 0); /** @brief Samples buffer to store values from a SAADC channel. */ static uint16_t m_sample_buffers[BUFFER_COUNT][BUFFER_SIZE]; @@ -227,8 +218,8 @@ int main(void) #if defined(__ZEPHYR__) IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SAADC), IRQ_PRIO_LOWEST, nrfx_saadc_irq_handler, 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(SAADC_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(SAADC_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -238,7 +229,7 @@ int main(void) status = nrfx_saadc_init(NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX); + nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(SAADC_TIMER_INST_IDX); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer_inst.p_reg); nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); timer_config.bit_width = NRF_TIMER_BIT_WIDTH_32; @@ -308,7 +299,7 @@ int main(void) nrf_saadc_event_address_get(NRF_SAADC, NRF_SAADC_EVENT_END), nrf_saadc_task_address_get(NRF_SAADC, NRF_SAADC_TASK_START)); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(SAADC_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", diff --git a/nrfx/samples/src/nrfx_saadc/maximum_performance/prj.conf b/nrfx/samples/src/nrfx_saadc/maximum_performance/prj.conf index df52a3b6..5405a7ba 100644 --- a/nrfx/samples/src/nrfx_saadc/maximum_performance/prj.conf +++ b/nrfx/samples/src/nrfx_saadc/maximum_performance/prj.conf @@ -1,5 +1,4 @@ -CONFIG_NRFX_TIMER0=y CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_SAADC=y +CONFIG_NRFX_GPPI=y CONFIG_LOG_BUFFER_SIZE=4096 diff --git a/nrfx/samples/src/nrfx_saadc/maximum_performance/sample.yaml b/nrfx/samples/src/nrfx_saadc/maximum_performance/sample.yaml index 5a520b1d..af679eba 100644 --- a/nrfx/samples/src/nrfx_saadc/maximum_performance/sample.yaml +++ b/nrfx/samples/src/nrfx_saadc/maximum_performance/sample.yaml @@ -4,15 +4,16 @@ sample: tests: examples.nrfx_saadc.maximum_performance: tags: saadc - filter: dt_compat_enabled("nordic,nrf-saadc") platform_allow: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf9160dk/nrf9160 + - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf9160dk/nrf9160 + - nrf54l15dk/nrf54l15/cpuapp harness: console harness_config: fixture: nrfx_example_loopbacks @@ -26,13 +27,13 @@ tests: - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - "Sample buffer address == 0x([0-9a-z]{8})" - ".Sample 0. value == -?[0-9]" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{4})" - "SAADC event: BUF_REQ" - "SAADC event: DONE" - ".Sample 0. value == -?[0-9]" - - ".Sample 1. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{4})" diff --git a/nrfx/samples/src/nrfx_saadc/simple_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_saadc/simple_blocking/CMakeLists.txt index 051c260e..bf7c4b77 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_saadc/simple_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_saadc/simple_blocking/README.md b/nrfx/samples/src/nrfx_saadc/simple_blocking/README.md index dbca175e..b463fdf2 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_blocking/README.md +++ b/nrfx/samples/src/nrfx_saadc/simple_blocking/README.md @@ -12,7 +12,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | + ## Overview Application initializes the nrfx_saadc driver and starts operating in the blocking mode. @@ -116,5 +118,70 @@ You should see the following output: - "[CHANNEL 1] Sampled value == -?[0-9]" - "[CHANNEL 2] Sampled value == -?[0-9]" ``` + +On nRF54L15 DK, in order to keep the loopbacks consistent for all the samples, just two channels are used so the output should look something like: + +``` +- "Starting nrfx_saadc simple blocking example." +- "Single channel SAADC test." +- "Calibration in the blocking manner finished successfully." +- "Sampling 1 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 2 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 3 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 4 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 5 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 6 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 7 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 8 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "Multiple channels SAADC test." +- "Calibration in the blocking manner finished successfully." +- "Sampling 1 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "[CHANNEL 1] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 2 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "[CHANNEL 1] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 3 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "[CHANNEL 1] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 4 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "[CHANNEL 1] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 5 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "[CHANNEL 1] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 6 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "[CHANNEL 1] Sampled value == -?[0-9]" +- "Calibration in the blocking manner finished successfully." +- "Sampling 7 / 8" +- "[CHANNEL 0] Sampled value == ([0-9]{3})" +- "[CHANNEL 1] Sampled value == ([0-9]{3})" +- "Calibration in the blocking manner finished successfully." +- "Sampling 8 / 8" +- "[CHANNEL 0] Sampled value == -?[0-9]" +- "[CHANNEL 1] Sampled value == -?[0-9]" +``` + [//]: # [Building and running]: <../../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_saadc/simple_blocking/main.c b/nrfx/samples/src/nrfx_saadc/simple_blocking/main.c index 76a82ab5..b004a0e4 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_blocking/main.c +++ b/nrfx/samples/src/nrfx_saadc/simple_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -65,53 +65,48 @@ * are being triggered between successive samplings to verify the functionality of the SAADC on the non-constant analog signal. */ -/** @brief Symbol specifying analog input to be observed by SAADC channel 0. */ -#define CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) - -/** @brief Symbol specifying analog input to be observed by SAADC channel 1. */ -#define CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) - -/** @brief Symbol specifying analog input to be observed by SAADC channel 2. */ -#define CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) - -/** @brief Declaration of enum containing a set of states for the simple state machine. */ -typedef enum -{ - STATE_SINGLE_CONFIG, ///< Configure a single SAADC channel and set the SAADC driver in the simple mode. - STATE_SINGLE_SAMPLING, ///< Trigger SAADC sampling on the single channel. - STATE_MULTIPLE_CONFIG, ///< Configure multiple SAADC channels and set the SAADC driver in the simple mode. - STATE_MULTIPLE_SAMPLING, ///< Trigger SAADC sampling on multiple channels. -} state_t; - -/** @brief SAADC channel configuration structure for single channel use. */ -static const nrfx_saadc_channel_t m_single_channel = NRFX_SAADC_DEFAULT_CHANNEL_SE(CH0_AIN, 0); - /** @brief SAADC channel configuration structure for multiple channel use. */ static const nrfx_saadc_channel_t m_multiple_channels[] = { - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH0_AIN, 0), - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH1_AIN, 1), - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH2_AIN, 2), + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH0_AIN, 0), + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH1_AIN, 1), +#if SAADC_MAX_CHANNELS == 3 + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH2_AIN, 2) +#endif }; - /** @brief Symbol specifying numbers of multiple channels ( @ref m_multiple_channels) used by SAADC. */ #define CHANNEL_COUNT NRFX_ARRAY_SIZE(m_multiple_channels) +/** @brief Array specifying GPIO pins used to test the functionality of SAADC. */ +static uint8_t m_out_pins[CHANNEL_COUNT] = { + SAADC_CH0_LOOPBACK_PIN, + SAADC_CH1_LOOPBACK_PIN, +#if SAADC_MAX_CHANNELS == 3 + SAADC_CH2_LOOPBACK_PIN +#endif +}; + +/** @brief SAADC channel configuration structure for single channel use. */ +static const nrfx_saadc_channel_t m_single_channel = NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH0_AIN, 0); + /** @brief Symbol specifying the number of SAADC samplings to trigger. */ #define SAMPLING_ITERATIONS 8 /** @brief Symbol specifying the resolution of the SAADC. */ #define RESOLUTION NRF_SAADC_RESOLUTION_8BIT -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - -/** @brief Array specifying GPIO pins used to test the functionality of SAADC. */ -static uint8_t m_out_pins[CHANNEL_COUNT] = {LOOPBACK_PIN_1B, LOOPBACK_PIN_2B, LOOPBACK_PIN_3B}; - /** @brief Samples buffer defined with the size of @ref CHANNEL_COUNT symbol to store values from each channel ( @ref m_multiple_channels). */ static uint16_t samples_buffer[CHANNEL_COUNT]; +/** @brief Declaration of enum containing a set of states for the simple state machine. */ +typedef enum +{ + STATE_SINGLE_CONFIG, ///< Configure a single SAADC channel and set the SAADC driver in the simple mode. + STATE_SINGLE_SAMPLING, ///< Trigger SAADC sampling on the single channel. + STATE_MULTIPLE_CONFIG, ///< Configure multiple SAADC channels and set the SAADC driver in the simple mode. + STATE_MULTIPLE_SAMPLING, ///< Trigger SAADC sampling on multiple channels. +} state_t; + /** @brief Enum with the current state of the simple state machine. */ static state_t m_current_state = STATE_SINGLE_CONFIG; @@ -126,8 +121,8 @@ int main(void) (void)status; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(SAADC_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(SAADC_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -137,7 +132,7 @@ int main(void) status = nrfx_saadc_init(NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(SAADC_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", diff --git a/nrfx/samples/src/nrfx_saadc/simple_blocking/prj.conf b/nrfx/samples/src/nrfx_saadc/simple_blocking/prj.conf index 6db06f07..76d9c89e 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_saadc/simple_blocking/prj.conf @@ -1,3 +1,2 @@ CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_SAADC=y diff --git a/nrfx/samples/src/nrfx_saadc/simple_blocking/sample.yaml b/nrfx/samples/src/nrfx_saadc/simple_blocking/sample.yaml index c4e7c29a..d0a40e6f 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_saadc/simple_blocking/sample.yaml @@ -4,7 +4,6 @@ sample: tests: examples.nrfx_saadc.simple_blocking: tags: saadc - filter: dt_compat_enabled("nordic,nrf-saadc") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 @@ -90,3 +89,74 @@ tests: - ".CHANNEL 0. Sampled value == -?[0-9]" - ".CHANNEL 1. Sampled value == -?[0-9]" - ".CHANNEL 2. Sampled value == -?[0-9]" + examples.nrfx_saadc.simple_blocking.nrf54l15: + tags: saadc + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + harness: console + harness_config: + fixture: nrfx_example_loopbacks + type: multi_line + ordered: true + regex: + - "Starting nrfx_saadc simple blocking example." + - "Single channel SAADC test." + - "Calibration in the blocking manner finished successfully." + - "Sampling 1 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 2 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 3 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 4 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 5 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 6 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 7 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 8 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - "Multiple channels SAADC test." + - "Calibration in the blocking manner finished successfully." + - "Sampling 1 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - ".CHANNEL 1. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 2 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - ".CHANNEL 1. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 3 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - ".CHANNEL 1. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 4 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - ".CHANNEL 1. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 5 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - ".CHANNEL 1. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 6 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - ".CHANNEL 1. Sampled value == -?[0-9]" + - "Calibration in the blocking manner finished successfully." + - "Sampling 7 / 8" + - ".CHANNEL 0. Sampled value == ([0-9]{3})" + - ".CHANNEL 1. Sampled value == ([0-9]{3})" + - "Calibration in the blocking manner finished successfully." + - "Sampling 8 / 8" + - ".CHANNEL 0. Sampled value == -?[0-9]" + - ".CHANNEL 1. Sampled value == -?[0-9]" diff --git a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/CMakeLists.txt index 051c260e..bf7c4b77 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/README.md b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/README.md index ee700971..1fed593f 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/README.md +++ b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview @@ -119,5 +120,70 @@ You should see the following output: - "[Sample 2] value == -?[0-9]" ``` +On nRF54L15 DK, in order to keep the loopbacks consistent for all the samples, just two channels are used so the output should look something like: + +``` +- "Starting nrfx_saadc simple non-blocking example." +- "Single channel SAADC test." +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "Multiple channels SAADC test." +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "[Sample 1] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "[Sample 1] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "[Sample 1] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "[Sample 1] value == -?[0-9]" +- "[Sample 2] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "[Sample 1] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "[Sample 1] value == -?[0-9]" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == ([0-9]{3})" +- "[Sample 1] value == ([0-9]{3})" +- "SAADC event: CALIBRATEDONE" +- "SAADC event: DONE" +- "[Sample 0] value == -?[0-9]" +- "[Sample 1] value == -?[0-9]" +``` + [//]: # [Building and running]: <../../../README.md#building-and-running> diff --git a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/main.c b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/main.c index ae486d8c..fe87823f 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/main.c +++ b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -65,53 +65,47 @@ * are being triggered between successive samplings to verify the functionality of the SAADC on the non-constant analog signal. */ -/** @brief Symbol specifying analog input to be observed by SAADC channel 0. */ -#define CH0_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A0) - -/** @brief Symbol specifying analog input to be observed by SAADC channel 1. */ -#define CH1_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A1) - -/** @brief Symbol specifying analog input to be observed by SAADC channel 2. */ -#define CH2_AIN ANALOG_INPUT_TO_SAADC_AIN(ANALOG_INPUT_A2) - -/** @brief Declaration of enum containing a set of states for the simple state machine. */ -typedef enum -{ - STATE_SINGLE_CONFIG, ///< Configure a single SAADC channel and set the SAADC driver in the simple mode. - STATE_SINGLE_SAMPLING, ///< Trigger SAADC sampling on the single channel. - STATE_MULTIPLE_CONFIG, ///< Configure multiple SAADC channels and set the SAADC driver in the simple mode. - STATE_MULTIPLE_SAMPLING, ///< Trigger SAADC sampling on multiple channels. -} state_t; - /** @brief SAADC channel configuration structure for single channel use. */ -static const nrfx_saadc_channel_t m_single_channel = NRFX_SAADC_DEFAULT_CHANNEL_SE(CH0_AIN, 0); +static const nrfx_saadc_channel_t m_single_channel = NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH0_AIN, 0); -/** @brief SAADC channel configuration structure for multiple channel use. */ static const nrfx_saadc_channel_t m_multiple_channels[] = { - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH0_AIN, 0), - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH1_AIN, 1), - NRFX_SAADC_DEFAULT_CHANNEL_SE(CH2_AIN, 2) + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH0_AIN, 0), + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH1_AIN, 1), +#if SAADC_MAX_CHANNELS == 3 + NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_CH2_AIN, 2) +#endif }; - /** @brief Symbol specifying numbers of multiple channels ( @ref m_multiple_channels) used by SAADC. */ #define CHANNEL_COUNT NRFX_ARRAY_SIZE(m_multiple_channels) +/** @brief Array specifying GPIO pins used to test the functionality of SAADC. */ +static uint8_t m_out_pins[CHANNEL_COUNT] = { + SAADC_CH0_LOOPBACK_PIN, + SAADC_CH1_LOOPBACK_PIN, +#if SAADC_MAX_CHANNELS == 3 + SAADC_CH2_LOOPBACK_PIN +#endif +}; + /** @brief Symbol specifying the number of SAADC samplings to trigger. */ #define SAMPLING_ITERATIONS 8 /** @brief Symbol specifying the resolution of the SAADC. */ #define RESOLUTION NRF_SAADC_RESOLUTION_8BIT -/** @brief Symbol specifying GPIOTE instance to be used. */ -#define GPIOTE_INST_IDX 0 - -/** @brief Array specifying GPIO pins used to test the functionality of SAADC. */ -static uint8_t m_out_pins[CHANNEL_COUNT] = {LOOPBACK_PIN_1B, LOOPBACK_PIN_2B, LOOPBACK_PIN_3B}; - /** @brief Samples buffer defined with the size of @ref CHANNEL_COUNT symbol to store values from each channel ( @ref m_multiple_channels). */ static uint16_t m_samples_buffer[CHANNEL_COUNT]; +/** @brief Declaration of enum containing a set of states for the simple state machine. */ +typedef enum +{ + STATE_SINGLE_CONFIG, ///< Configure a single SAADC channel and set the SAADC driver in the simple mode. + STATE_SINGLE_SAMPLING, ///< Trigger SAADC sampling on the single channel. + STATE_MULTIPLE_CONFIG, ///< Configure multiple SAADC channels and set the SAADC driver in the simple mode. + STATE_MULTIPLE_SAMPLING, ///< Trigger SAADC sampling on multiple channels. +} state_t; + /** @brief Enum with the current state of the simple state machine. */ static state_t m_current_state = STATE_SINGLE_CONFIG; @@ -168,8 +162,8 @@ int main(void) #if defined(__ZEPHYR__) IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SAADC), IRQ_PRIO_LOWEST, nrfx_saadc_irq_handler, 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(SAADC_GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_GPIOTE_INST_HANDLER_GET(SAADC_GPIOTE_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -179,7 +173,7 @@ int main(void) status = nrfx_saadc_init(NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(GPIOTE_INST_IDX); + nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(SAADC_GPIOTE_INST_IDX); status = nrfx_gpiote_init(&gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY); NRFX_ASSERT(status == NRFX_SUCCESS); NRFX_LOG_INFO("GPIOTE status: %s", diff --git a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/prj.conf b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/prj.conf index 6db06f07..76d9c89e 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/prj.conf @@ -1,3 +1,2 @@ CONFIG_GPIO=n -CONFIG_NRFX_GPIOTE0=y CONFIG_NRFX_SAADC=y diff --git a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/sample.yaml b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/sample.yaml index fa248def..de5d396f 100644 --- a/nrfx/samples/src/nrfx_saadc/simple_non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_saadc/simple_non_blocking/sample.yaml @@ -4,7 +4,6 @@ sample: tests: examples.nrfx_saadc.simple_non_blocking: tags: saadc - filter: dt_compat_enabled("nordic,nrf-saadc") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 @@ -90,3 +89,74 @@ tests: - ".Sample 0. value == -?[0-9]" - ".Sample 1. value == -?[0-9]" - ".Sample 2. value == -?[0-9]" + examples.nrfx_saadc.simple_non_blocking.nrf54l15: + tags: saadc + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + harness: console + harness_config: + fixture: nrfx_example_loopbacks + type: multi_line + ordered: true + regex: + - "Starting nrfx_saadc simple non-blocking example." + - "Single channel SAADC test." + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - "Multiple channels SAADC test." + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - ".Sample 1. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - ".Sample 1. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - ".Sample 1. value == -?[0-9]" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == ([0-9]{3})" + - ".Sample 1. value == ([0-9]{3})" + - "SAADC event: CALIBRATEDONE" + - "SAADC event: DONE" + - ".Sample 0. value == -?[0-9]" + - ".Sample 1. value == -?[0-9]" diff --git a/nrfx/samples/src/nrfx_spim/blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_spim/blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_spim/blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_spim/blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_spim/blocking/README.md b/nrfx/samples/src/nrfx_spim/blocking/README.md index b6746967..2b6cc451 100644 --- a/nrfx/samples/src/nrfx_spim/blocking/README.md +++ b/nrfx/samples/src/nrfx_spim/blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_spim/blocking/main.c b/nrfx/samples/src/nrfx_spim/blocking/main.c index 8ac85b82..ad8707c4 100644 --- a/nrfx/samples/src/nrfx_spim/blocking/main.c +++ b/nrfx/samples/src/nrfx_spim/blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -51,9 +51,6 @@ * the transfer is finished received message is read from @ref m_rx_buffer. */ -/** @brief Symbol specifying SPIM instance to be used. */ -#define SPIM_INST_IDX 1 - /** @brief Symbol specifying pin number for MOSI. */ #define MOSI_PIN LOOPBACK_PIN_1A diff --git a/nrfx/samples/src/nrfx_spim/blocking/prj.conf b/nrfx/samples/src/nrfx_spim/blocking/prj.conf index 05c227a8..72801566 100644 --- a/nrfx/samples/src/nrfx_spim/blocking/prj.conf +++ b/nrfx/samples/src/nrfx_spim/blocking/prj.conf @@ -1 +1 @@ -CONFIG_NRFX_SPIM1=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_spim/blocking/sample.yaml b/nrfx/samples/src/nrfx_spim/blocking/sample.yaml index 0195e4f3..437df344 100644 --- a/nrfx/samples/src/nrfx_spim/blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_spim/blocking/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_spim.blocking: tags: spim - filter: dt_compat_enabled("nordic,nrf-spim") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_spim/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 00000000..05c227a8 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM1=y diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_spim/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000..05c227a8 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM1=y diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_spim/boards/nrf52dk_nrf52832.conf new file mode 100644 index 00000000..05c227a8 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf52dk_nrf52832.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM1=y diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_spim/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000..05c227a8 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM1=y diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..1d704774 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM20=y diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..b569b2f0 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,22 @@ +#include "../../../common/common-pinctrl.dtsi" + +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&spi20 { + status = "okay"; + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi_dummy>; + pinctrl-names = "default"; +}; diff --git a/nrfx/samples/src/nrfx_spim/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_spim/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 00000000..05c227a8 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1 @@ +CONFIG_NRFX_SPIM1=y diff --git a/nrfx/samples/src/nrfx_spim/non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_spim/non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_spim/non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_spim/non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_spim/non_blocking/README.md b/nrfx/samples/src/nrfx_spim/non_blocking/README.md index b2d447a0..c0ac2f64 100644 --- a/nrfx/samples/src/nrfx_spim/non_blocking/README.md +++ b/nrfx/samples/src/nrfx_spim/non_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_spim/non_blocking/main.c b/nrfx/samples/src/nrfx_spim/non_blocking/main.c index 775fbeab..0efe6901 100644 --- a/nrfx/samples/src/nrfx_spim/non_blocking/main.c +++ b/nrfx/samples/src/nrfx_spim/non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -51,9 +51,6 @@ * is finished @ref spim_handler() is executed and the received message is read from @ref m_rx_buffer. */ -/** @brief Symbol specifying SPIM instance to be used. */ -#define SPIM_INST_IDX 1 - /** @brief Symbol specifying pin number for MOSI. */ #define MOSI_PIN LOOPBACK_PIN_1A diff --git a/nrfx/samples/src/nrfx_spim/non_blocking/prj.conf b/nrfx/samples/src/nrfx_spim/non_blocking/prj.conf index 48835945..b4b3896e 100644 --- a/nrfx/samples/src/nrfx_spim/non_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_spim/non_blocking/prj.conf @@ -1,4 +1,3 @@ CONFIG_LOG=y -CONFIG_NRFX_SPIM1=y CONFIG_BOOT_BANNER=n CONFIG_ASSERT=y diff --git a/nrfx/samples/src/nrfx_spim/non_blocking/sample.yaml b/nrfx/samples/src/nrfx_spim/non_blocking/sample.yaml index 7fc11004..0e3149bb 100644 --- a/nrfx/samples/src/nrfx_spim/non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_spim/non_blocking/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_spim.non_blocking: tags: spim - filter: dt_compat_enabled("nordic,nrf-spim") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/README.md b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/README.md index 3ba2e2a0..0edcc91c 100644 --- a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/README.md +++ b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/main.c b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/main.c index adb6b222..862fc864 100644 --- a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/main.c +++ b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -61,36 +61,6 @@ * from @ref m_master_messages is sent by SPIS. */ -/** @brief Symbol specifying SPIM instance to be used. */ -#define SPIM_INST_IDX 1 - -/** @brief Symbol specifying SPIS instance to be used. */ -#define SPIS_INST_IDX 2 - -/** @brief Symbol specifying master's pin number for MOSI. */ -#define MOSI_PIN_MASTER LOOPBACK_PIN_1A - -/** @brief Symbol specifying slave's pin number for MOSI. */ -#define MOSI_PIN_SLAVE LOOPBACK_PIN_1B - -/** @brief Symbol specifying master's pin number for MISO. */ -#define MISO_PIN_MASTER LOOPBACK_PIN_2A - -/** @brief Symbol specifying slave's pin number for MISO. */ -#define MISO_PIN_SLAVE LOOPBACK_PIN_2B - -/** @brief Symbol specifying master's pin number for SCK. */ -#define SCK_PIN_MASTER LOOPBACK_PIN_3A - -/** @brief Symbol specifying slave's pin number for SCK. */ -#define SCK_PIN_SLAVE LOOPBACK_PIN_3B - -/** @brief Symbol specifying master's pin number for CS. */ -#define SS_PIN_MASTER LOOPBACK_PIN_4A - -/** @brief Symbol specifying slave's pin number for CS. */ -#define CSN_PIN_SLAVE LOOPBACK_PIN_4B - /** @brief Symbol specifying the master's command. */ #define NORDIC_CMD "Nordic" @@ -226,7 +196,7 @@ static void spis_handler(nrfx_spis_evt_t const * p_event, void * p_context) } else { - memcpy(m_tx_buffer_slave, ERROR_RESP, BUFF_SIZE); + memcpy(m_tx_buffer_slave, ERROR_RESP, sizeof(ERROR_RESP)); } status = nrfx_spis_buffers_set(p_spis_inst, m_tx_buffer_slave, BUFF_SIZE, NULL, 0); @@ -246,10 +216,10 @@ int main(void) (void)status; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM_INST_GET(SPIM_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_SPIM_INST_HANDLER_GET(SPIM_INST_IDX), 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS_INST_GET(SPIS_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_SPIS_INST_HANDLER_GET(SPIS_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM_INST_GET(SPIM_SPIS_SPIM_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_SPIM_INST_HANDLER_GET(SPIM_SPIS_SPIM_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS_INST_GET(SPIM_SPIS_SPIS_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_SPIS_INST_HANDLER_GET(SPIM_SPIS_SPIS_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -257,22 +227,22 @@ int main(void) NRFX_LOG_INFO("Starting nrfx_spim_spis advanced non-blocking example."); NRFX_EXAMPLE_LOG_PROCESS(); - nrfx_spim_t spim_inst = NRFX_SPIM_INSTANCE(SPIM_INST_IDX); + nrfx_spim_t spim_inst = NRFX_SPIM_INSTANCE(SPIM_SPIS_SPIM_INST_IDX); - nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG(SCK_PIN_MASTER, - MOSI_PIN_MASTER, - MISO_PIN_MASTER, - SS_PIN_MASTER); + nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG(SPIM_SPIS_SCK_PIN_MASTER, + SPIM_SPIS_MOSI_PIN_MASTER, + SPIM_SPIS_MISO_PIN_MASTER, + SPIM_SPIS_SS_PIN_MASTER); void * p_context = "Some context"; status = nrfx_spim_init(&spim_inst, &spim_config, spim_handler, p_context); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_spis_t spis_inst = NRFX_SPIS_INSTANCE(SPIS_INST_IDX); - nrfx_spis_config_t spis_config = NRFX_SPIS_DEFAULT_CONFIG(SCK_PIN_SLAVE, - MOSI_PIN_SLAVE, - MISO_PIN_SLAVE, - CSN_PIN_SLAVE); + nrfx_spis_t spis_inst = NRFX_SPIS_INSTANCE(SPIM_SPIS_SPIS_INST_IDX); + nrfx_spis_config_t spis_config = NRFX_SPIS_DEFAULT_CONFIG(SPIM_SPIS_SCK_PIN_SLAVE, + SPIM_SPIS_MOSI_PIN_SLAVE, + SPIM_SPIS_MISO_PIN_SLAVE, + SPIM_SPIS_CSN_PIN_SLAVE); status = nrfx_spis_init(&spis_inst, &spis_config, spis_handler, &spis_inst); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/prj.conf b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/prj.conf index d2053ab2..bf2a09df 100644 --- a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/prj.conf @@ -1,3 +1 @@ -CONFIG_NRFX_SPIM1=y -CONFIG_NRFX_SPIS2=y CONFIG_ASSERT=y diff --git a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/sample.yaml b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/sample.yaml index 991de1f7..a119619f 100644 --- a/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_spim_spis/advanced_non_blocking/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - spim - spis - filter: dt_compat_enabled("nordic,nrf-spim") and dt_compat_enabled("nordic,nrf-spis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 00000000..fa643215 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM1=y +CONFIG_NRFX_SPIS2=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.overlay b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.overlay index 15ab26d7..3fbb3416 100644 --- a/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.overlay +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52833dk_nrf52833.overlay @@ -10,5 +10,6 @@ status = "okay"; compatible = "nordic,nrf-spis"; pinctrl-0 = <&spi_slave_dummy>; + pinctrl-names = "default"; def-char = <0xFF>; }; diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000..fa643215 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM1=y +CONFIG_NRFX_SPIS2=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52dk_nrf52832.conf new file mode 100644 index 00000000..fa643215 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf52dk_nrf52832.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM1=y +CONFIG_NRFX_SPIS2=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000..fa643215 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM1=y +CONFIG_NRFX_SPIS2=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.overlay b/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.overlay index 15ab26d7..ab3e1631 100644 --- a/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,11 +4,13 @@ status = "okay"; compatible = "nordic,nrf-spim"; pinctrl-0 = <&spi_master_default>; + pinctrl-names = "default"; }; &spi2 { status = "okay"; compatible = "nordic,nrf-spis"; pinctrl-0 = <&spi_slave_dummy>; + pinctrl-names = "default"; def-char = <0xFF>; }; diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..c933da05 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM20=y +CONFIG_NRFX_SPIS21=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..03cb765f --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,32 @@ +#include "../../../common/common-pinctrl.dtsi" + +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&spi20 { + status = "okay"; + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi_master_default>; + pinctrl-names = "default"; +}; + +&spi21 { + status = "okay"; + compatible = "nordic,nrf-spis"; + pinctrl-0 = <&spi_slave_dummy>; + pinctrl-names = "default"; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; + def-char = <0x00>; +}; diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 00000000..fa643215 --- /dev/null +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_SPIM1=y +CONFIG_NRFX_SPIS2=y diff --git a/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.overlay b/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.overlay index 8b40d5c2..37041e3e 100644 --- a/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.overlay +++ b/nrfx/samples/src/nrfx_spim_spis/boards/nrf9160dk_nrf9160.overlay @@ -4,6 +4,7 @@ status = "okay"; compatible = "nordic,nrf-spim"; pinctrl-0 = <&spi_master_default>; + pinctrl-names = "default"; }; &uart1 { @@ -14,5 +15,6 @@ status = "okay"; compatible = "nordic,nrf-spis"; pinctrl-0 = <&spi_slave_dummy>; + pinctrl-names = "default"; def-char = <0xFF>; }; diff --git a/nrfx/samples/src/nrfx_spim_spis/non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_spim_spis/non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_spim_spis/non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_spim_spis/non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_spim_spis/non_blocking/README.md b/nrfx/samples/src/nrfx_spim_spis/non_blocking/README.md index 7b9cc6d2..0000745e 100644 --- a/nrfx/samples/src/nrfx_spim_spis/non_blocking/README.md +++ b/nrfx/samples/src/nrfx_spim_spis/non_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_spim_spis/non_blocking/main.c b/nrfx/samples/src/nrfx_spim_spis/non_blocking/main.c index 3346b15e..cd599f4e 100644 --- a/nrfx/samples/src/nrfx_spim_spis/non_blocking/main.c +++ b/nrfx/samples/src/nrfx_spim_spis/non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -54,36 +54,6 @@ * Then received messages are read from @ref m_rx_buffer_master and @ref m_rx_buffer_slave. */ -/** @brief Symbol specifying SPIM instance to be used. */ -#define SPIM_INST_IDX 1 - -/** @brief Symbol specifying SPIS instance to be used. */ -#define SPIS_INST_IDX 2 - -/** @brief Symbol specifying master's pin number for MOSI. */ -#define MOSI_PIN_MASTER LOOPBACK_PIN_1A - -/** @brief Symbol specifying slave's pin number for MOSI. */ -#define MOSI_PIN_SLAVE LOOPBACK_PIN_1B - -/** @brief Symbol specifying master's pin number for MISO. */ -#define MISO_PIN_MASTER LOOPBACK_PIN_2A - -/** @brief Symbol specifying slave's pin number for MISO. */ -#define MISO_PIN_SLAVE LOOPBACK_PIN_2B - -/** @brief Symbol specifying master's pin number for SCK. */ -#define SCK_PIN_MASTER LOOPBACK_PIN_3A - -/** @brief Symbol specifying slave's pin number for SCK. */ -#define SCK_PIN_SLAVE LOOPBACK_PIN_3B - -/** @brief Symbol specifying master's pin number for SS. */ -#define SS_PIN_MASTER LOOPBACK_PIN_4A - -/** @brief Symbol specifying slave's pin number for CSN. */ -#define CSN_PIN_SLAVE LOOPBACK_PIN_4B - /** @brief Symbol specifying message to be sent via SPIM data transfer. */ #define MSG_TO_SEND_MASTER "Semiconductor" @@ -145,10 +115,10 @@ int main(void) (void)status; #if defined(__ZEPHYR__) - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM_INST_GET(SPIM_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_SPIM_INST_HANDLER_GET(SPIM_INST_IDX), 0, 0); - IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS_INST_GET(SPIS_INST_IDX)), IRQ_PRIO_LOWEST, - NRFX_SPIS_INST_HANDLER_GET(SPIS_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM_INST_GET(SPIM_SPIS_SPIM_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_SPIM_INST_HANDLER_GET(SPIM_SPIS_SPIM_INST_IDX), 0, 0); + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS_INST_GET(SPIM_SPIS_SPIS_INST_IDX)), IRQ_PRIO_LOWEST, + NRFX_SPIS_INST_HANDLER_GET(SPIM_SPIS_SPIS_INST_IDX), 0, 0); #endif NRFX_EXAMPLE_LOG_INIT(); @@ -156,22 +126,22 @@ int main(void) NRFX_LOG_INFO("Starting nrfx_spim_spis basic non-blocking example."); NRFX_EXAMPLE_LOG_PROCESS(); - nrfx_spim_t spim_inst = NRFX_SPIM_INSTANCE(SPIM_INST_IDX); + nrfx_spim_t spim_inst = NRFX_SPIM_INSTANCE(SPIM_SPIS_SPIM_INST_IDX); - nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG(SCK_PIN_MASTER, - MOSI_PIN_MASTER, - MISO_PIN_MASTER, - SS_PIN_MASTER); + nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG(SPIM_SPIS_SCK_PIN_MASTER, + SPIM_SPIS_MOSI_PIN_MASTER, + SPIM_SPIS_MISO_PIN_MASTER, + SPIM_SPIS_SS_PIN_MASTER); void * p_context = "Some context"; status = nrfx_spim_init(&spim_inst, &spim_config, spim_handler, p_context); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_spis_t spis_inst = NRFX_SPIS_INSTANCE(SPIS_INST_IDX); - nrfx_spis_config_t spis_config = NRFX_SPIS_DEFAULT_CONFIG(SCK_PIN_SLAVE, - MOSI_PIN_SLAVE, - MISO_PIN_SLAVE, - CSN_PIN_SLAVE); + nrfx_spis_t spis_inst = NRFX_SPIS_INSTANCE(SPIM_SPIS_SPIS_INST_IDX); + nrfx_spis_config_t spis_config = NRFX_SPIS_DEFAULT_CONFIG(SPIM_SPIS_SCK_PIN_SLAVE, + SPIM_SPIS_MOSI_PIN_SLAVE, + SPIM_SPIS_MISO_PIN_SLAVE, + SPIM_SPIS_CSN_PIN_SLAVE); status = nrfx_spis_init(&spis_inst, &spis_config, spis_handler, p_context); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_spim_spis/non_blocking/prj.conf b/nrfx/samples/src/nrfx_spim_spis/non_blocking/prj.conf index d4883c80..b4b3896e 100644 --- a/nrfx/samples/src/nrfx_spim_spis/non_blocking/prj.conf +++ b/nrfx/samples/src/nrfx_spim_spis/non_blocking/prj.conf @@ -1,5 +1,3 @@ CONFIG_LOG=y -CONFIG_NRFX_SPIM1=y -CONFIG_NRFX_SPIS2=y CONFIG_BOOT_BANNER=n CONFIG_ASSERT=y diff --git a/nrfx/samples/src/nrfx_spim_spis/non_blocking/sample.yaml b/nrfx/samples/src/nrfx_spim_spis/non_blocking/sample.yaml index de2e8137..6b05eb07 100644 --- a/nrfx/samples/src/nrfx_spim_spis/non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_spim_spis/non_blocking/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - spim - spis - filter: dt_compat_enabled("nordic,nrf-spim") and dt_compat_enabled("nordic,nrf-spis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_temp/blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_temp/blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_temp/blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_temp/blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_temp/blocking/README.md b/nrfx/samples/src/nrfx_temp/blocking/README.md index 31bbb75b..74a5f34d 100644 --- a/nrfx/samples/src/nrfx_temp/blocking/README.md +++ b/nrfx/samples/src/nrfx_temp/blocking/README.md @@ -11,7 +11,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | No | + ## Overview Application initializes the nrfx_temp driver and starts operating in the blocking mode. diff --git a/nrfx/samples/src/nrfx_temp/blocking/main.c b/nrfx/samples/src/nrfx_temp/blocking/main.c index 98c86e7d..502757de 100644 --- a/nrfx/samples/src/nrfx_temp/blocking/main.c +++ b/nrfx/samples/src/nrfx_temp/blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause diff --git a/nrfx/samples/src/nrfx_temp/blocking/sample.yaml b/nrfx/samples/src/nrfx_temp/blocking/sample.yaml index 353de164..8f1e9ca9 100644 --- a/nrfx/samples/src/nrfx_temp/blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_temp/blocking/sample.yaml @@ -4,17 +4,18 @@ sample: tests: examples.nrfx_temp.blocking: tags: temp - filter: dt_compat_enabled("nordic,nrf-temp") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpunet + - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpunet + - nrf54l15dk/nrf54l15/cpuapp harness: console harness_config: type: multi_line diff --git a/nrfx/samples/src/nrfx_temp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_temp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..deb286d5 --- /dev/null +++ b/nrfx/samples/src/nrfx_temp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,17 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&temp { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_temp/non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_temp/non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_temp/non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_temp/non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_temp/non_blocking/README.md b/nrfx/samples/src/nrfx_temp/non_blocking/README.md index 2cab2d9f..2264424a 100644 --- a/nrfx/samples/src/nrfx_temp/non_blocking/README.md +++ b/nrfx/samples/src/nrfx_temp/non_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | No | ## Overview diff --git a/nrfx/samples/src/nrfx_temp/non_blocking/main.c b/nrfx/samples/src/nrfx_temp/non_blocking/main.c index 36af7c74..9211fced 100644 --- a/nrfx/samples/src/nrfx_temp/non_blocking/main.c +++ b/nrfx/samples/src/nrfx_temp/non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause diff --git a/nrfx/samples/src/nrfx_temp/non_blocking/sample.yaml b/nrfx/samples/src/nrfx_temp/non_blocking/sample.yaml index 781c8fda..0941fc78 100644 --- a/nrfx/samples/src/nrfx_temp/non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_temp/non_blocking/sample.yaml @@ -4,17 +4,18 @@ sample: tests: examples.nrfx_temp.non_blocking: tags: temp - filter: dt_compat_enabled("nordic,nrf-temp") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpunet + - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpunet + - nrf54l15dk/nrf54l15/cpuapp harness: console harness_config: type: multi_line diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf52833dk_nrf52833.conf b/nrfx/samples/src/nrfx_timer/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 00000000..ce2274bd --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf52840dk_nrf52840.conf b/nrfx/samples/src/nrfx_timer/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000..ce2274bd --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf52dk_nrf52832.conf b/nrfx/samples/src/nrfx_timer/boards/nrf52dk_nrf52832.conf new file mode 100644 index 00000000..ce2274bd --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf52dk_nrf52832.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf5340dk_nrf5340_cpuapp.conf b/nrfx/samples/src/nrfx_timer/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000..ce2274bd --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..4aa65b99 --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER00=y +CONFIG_NRFX_TIMER20=y diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..9a3d8fa0 --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,21 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&timer00 { + status = "okay"; +}; + +&timer20 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_timer/boards/nrf9160dk_nrf9160.conf b/nrfx/samples/src/nrfx_timer/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 00000000..ce2274bd --- /dev/null +++ b/nrfx/samples/src/nrfx_timer/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y diff --git a/nrfx/samples/src/nrfx_timer/counter/CMakeLists.txt b/nrfx/samples/src/nrfx_timer/counter/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_timer/counter/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_timer/counter/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_timer/counter/README.md b/nrfx/samples/src/nrfx_timer/counter/README.md index ed2a8ad1..d3c1635b 100644 --- a/nrfx/samples/src/nrfx_timer/counter/README.md +++ b/nrfx/samples/src/nrfx_timer/counter/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_timer/counter/main.c b/nrfx/samples/src/nrfx_timer/counter/main.c index 77fcee38..04712c7b 100644 --- a/nrfx/samples/src/nrfx_timer/counter/main.c +++ b/nrfx/samples/src/nrfx_timer/counter/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -51,12 +51,6 @@ * is executed when the counter value is equal to @ref COUNTER_MAX_VAL. */ -/** @brief Symbol specifying timer instance to be used in timer mode (T). */ -#define TIMER_T_INST_IDX 0 - -/** @brief Symbol specifying timer instance to be used in counter mode (C). */ -#define TIMER_C_INST_IDX 1 - /** @brief Symbol specifying time in milliseconds to wait for handler execution. */ #define TIME_TO_WAIT_MS 1000UL diff --git a/nrfx/samples/src/nrfx_timer/counter/prj.conf b/nrfx/samples/src/nrfx_timer/counter/prj.conf index ce2274bd..72801566 100644 --- a/nrfx/samples/src/nrfx_timer/counter/prj.conf +++ b/nrfx/samples/src/nrfx_timer/counter/prj.conf @@ -1,2 +1 @@ -CONFIG_NRFX_TIMER0=y -CONFIG_NRFX_TIMER1=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_timer/counter/sample.yaml b/nrfx/samples/src/nrfx_timer/counter/sample.yaml index 8a39d306..2c22b09e 100644 --- a/nrfx/samples/src/nrfx_timer/counter/sample.yaml +++ b/nrfx/samples/src/nrfx_timer/counter/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_timer.counter: tags: timer - filter: dt_compat_enabled("nordic,nrf-timer") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_timer/timer/CMakeLists.txt b/nrfx/samples/src/nrfx_timer/timer/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_timer/timer/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_timer/timer/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_timer/timer/README.md b/nrfx/samples/src/nrfx_timer/timer/README.md index ea3f5e0e..a72a9a50 100644 --- a/nrfx/samples/src/nrfx_timer/timer/README.md +++ b/nrfx/samples/src/nrfx_timer/timer/README.md @@ -6,13 +6,13 @@ The sample demonstrates a basic functionality of the nrfx_timer driver in the Ti The sample supports the following development kits: - | **Board** | **Support** | |---------------------|:-----------:| | nrf52dk_nrf52832 | Yes | | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_timer/timer/main.c b/nrfx/samples/src/nrfx_timer/timer/main.c index d668dd90..33746943 100644 --- a/nrfx/samples/src/nrfx_timer/timer/main.c +++ b/nrfx/samples/src/nrfx_timer/timer/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -50,9 +50,6 @@ * the specified time. */ -/** @brief Symbol specifying timer instance to be used. */ -#define TIMER_INST_IDX 0 - /** @brief Symbol specifying time in milliseconds to wait for handler execution. */ #define TIME_TO_WAIT_MS 5000UL diff --git a/nrfx/samples/src/nrfx_timer/timer/prj.conf b/nrfx/samples/src/nrfx_timer/timer/prj.conf index 81681942..72801566 100644 --- a/nrfx/samples/src/nrfx_timer/timer/prj.conf +++ b/nrfx/samples/src/nrfx_timer/timer/prj.conf @@ -1 +1 @@ -CONFIG_NRFX_TIMER0=y +# Empty project configuration file diff --git a/nrfx/samples/src/nrfx_timer/timer/sample.yaml b/nrfx/samples/src/nrfx_timer/timer/sample.yaml index c718e6e9..798cda1a 100644 --- a/nrfx/samples/src/nrfx_timer/timer/sample.yaml +++ b/nrfx/samples/src/nrfx_timer/timer/sample.yaml @@ -4,18 +4,19 @@ sample: tests: examples.nrfx_timer.timer: tags: timer - filter: dt_compat_enabled("nordic,nrf-timer") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..163c1a0f --- /dev/null +++ b/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_NRFX_TWIM21=y +CONFIG_NRFX_TWIS22=y diff --git a/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..f8fa656f --- /dev/null +++ b/nrfx/samples/src/nrfx_twim_twis/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,29 @@ +#include "../../../common/common-pinctrl.dtsi" + +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; + +&i2c21 { + status = "okay"; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c_master_dummy>; + pinctrl-names = "dummy"; +}; + +&i2c22 { + status = "okay"; + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c_slave_dummy>; + pinctrl-names = "dummy"; +}; diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/README.md b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/README.md index dba6c8e7..4f5ea38b 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/README.md +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/main.c b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/main.c index fc583bf9..2983440b 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/main.c +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -54,29 +54,6 @@ * @ref m_tx_buffer_master -> @ref m_rx_buffer_slave -> @ref m_rx_buffer_master */ -/** @brief Symbol specifying pin number of master SCL. */ -#define MASTER_SCL_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying pin number of master SDA. */ -#define MASTER_SDA_PIN LOOPBACK_PIN_2A - -/** @brief Symbol specifying pin number of slave SCL. */ -#define SLAVE_SCL_PIN LOOPBACK_PIN_1B - -/** @brief Symbol specifying pin number of slave SDA. */ -#define SLAVE_SDA_PIN LOOPBACK_PIN_2B - -#if defined(NRF52_SERIES) || defined(__NRFX_DOXYGEN__) -/** @brief Symbol specifying TWIM instance to be used. */ -#define TWIM_INST_IDX 0 - -/** @brief Symbol specifying TWIS instance to be used. */ -#define TWIS_INST_IDX 1 -#else -#define TWIM_INST_IDX 1 -#define TWIS_INST_IDX 2 -#endif - /** @brief Symbol specifying slave address on TWI bus. */ #define SLAVE_ADDR 0x0B @@ -113,13 +90,14 @@ int main(void) nrfx_twim_xfer_desc_t twim_xfer_desc = NRFX_TWIM_XFER_DESC_TX(SLAVE_ADDR, m_tx_buffer_master, sizeof(m_tx_buffer_master)); - nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(MASTER_SCL_PIN, MASTER_SDA_PIN); + nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(TWIM_TWIS_MASTER_SCL_PIN, TWIM_TWIS_MASTER_SDA_PIN); status = nrfx_twim_init(&twim_inst, &twim_config, NULL, &twim_xfer_desc); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(SLAVE_SCL_PIN, - SLAVE_SDA_PIN, + nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(TWIM_TWIS_SLAVE_SCL_PIN, + TWIM_TWIS_SLAVE_SDA_PIN, SLAVE_ADDR); + status = nrfx_twis_init(&twis_inst, &twis_config, NULL); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/sample.yaml b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/sample.yaml index 7424981f..61e51928 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_blocking/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - twim - twis - filter: dt_compat_enabled("nordic,nrf-twim") and dt_compat_enabled("nordic,nrf-twis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/README.md b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/README.md index 45576f89..0bca14ce 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/README.md +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/README.md @@ -12,7 +12,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | + ## Overview Application initializes nrfx_twim and nrfx_twis drivers. diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/main.c b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/main.c index b91c8912..4874443d 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/main.c +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -55,29 +55,6 @@ * The @ref twim_handler() and @ref twis_handler() are executed with relevant log messages. */ -/** @brief Symbol specifying pin number of master SCL. */ -#define MASTER_SCL_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying pin number of master SDA. */ -#define MASTER_SDA_PIN LOOPBACK_PIN_2A - -/** @brief Symbol specifying pin number of slave SCL. */ -#define SLAVE_SCL_PIN LOOPBACK_PIN_1B - -/** @brief Symbol specifying pin number of slave SDA. */ -#define SLAVE_SDA_PIN LOOPBACK_PIN_2B - -#if defined(NRF52_SERIES) || defined(__NRFX_DOXYGEN__) -/** @brief Symbol specifying TWIM instance to be used. */ -#define TWIM_INST_IDX 0 - -/** @brief Symbol specifying TWIS instance to be used. */ -#define TWIS_INST_IDX 1 -#else -#define TWIM_INST_IDX 1 -#define TWIS_INST_IDX 2 -#endif - /** @brief Symbol specifying slave address on TWI bus. */ #define SLAVE_ADDR 0x0B @@ -203,12 +180,12 @@ int main(void) nrfx_twim_xfer_desc_t twim_xfer_desc = NRFX_TWIM_XFER_DESC_TX(SLAVE_ADDR, m_tx_buffer_master, sizeof(m_tx_buffer_master)); - nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(MASTER_SCL_PIN, MASTER_SDA_PIN); + nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(TWIM_TWIS_MASTER_SCL_PIN, TWIM_TWIS_MASTER_SDA_PIN); status = nrfx_twim_init(&twim_inst, &twim_config, twim_handler, &twim_xfer_desc); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(SLAVE_SCL_PIN, - SLAVE_SDA_PIN, + nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(TWIM_TWIS_SLAVE_SCL_PIN, + TWIM_TWIS_SLAVE_SDA_PIN, SLAVE_ADDR); status = nrfx_twis_init(&twis_inst, &twis_config, twis_handler); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/sample.yaml b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/sample.yaml index 1419c2b0..e1264729 100644 --- a/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_twim_twis/tx_rx_non_blocking/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - twim - twis - filter: dt_compat_enabled("nordic,nrf-twim") and dt_compat_enabled("nordic,nrf-twis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_twim_twis/txrx/CMakeLists.txt b/nrfx/samples/src/nrfx_twim_twis/txrx/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txrx/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_twim_twis/txrx/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_twim_twis/txrx/README.md b/nrfx/samples/src/nrfx_twim_twis/txrx/README.md index 92fa483f..e1577fff 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txrx/README.md +++ b/nrfx/samples/src/nrfx_twim_twis/txrx/README.md @@ -6,13 +6,13 @@ The sample demonstrates a functionality of nrfx_twim and nrfx_twis drivers, when The sample supports the following development kits: - | **Board** | **Support** | |---------------------|:-----------:| | nrf52dk_nrf52832 | Yes | | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_twim_twis/txrx/main.c b/nrfx/samples/src/nrfx_twim_twis/txrx/main.c index 09d8275a..06722472 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txrx/main.c +++ b/nrfx/samples/src/nrfx_twim_twis/txrx/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -61,29 +61,6 @@ * in master device and print content of that buffer. */ -/** @brief Symbol specifying pin number of master SCL. */ -#define MASTER_SCL_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying pin number of master SDA. */ -#define MASTER_SDA_PIN LOOPBACK_PIN_2A - -/** @brief Symbol specifying pin number of slave SCL. */ -#define SLAVE_SCL_PIN LOOPBACK_PIN_1B - -/** @brief Symbol specifying pin number of slave SDA. */ -#define SLAVE_SDA_PIN LOOPBACK_PIN_2B - -#if defined(NRF52_SERIES) || defined(__NRFX_DOXYGEN__) -/** @brief Symbol specifying TWIM instance to be used. */ -#define TWIM_INST_IDX 0 - -/** @brief Symbol specifying TWIS instance to be used. */ -#define TWIS_INST_IDX 1 -#else -#define TWIM_INST_IDX 1 -#define TWIS_INST_IDX 2 -#endif - /** @brief Symbol specifying drone (slave) address on TWI bus. */ #define DRONE_IDX 0x01U @@ -301,12 +278,12 @@ int main(void) uint32_t drone_ctrl_buffer = 0; void * p_context = "--> Master event: done - transfer completed"; - nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(MASTER_SCL_PIN, MASTER_SDA_PIN); + nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(TWIM_TWIS_MASTER_SCL_PIN, TWIM_TWIS_MASTER_SDA_PIN); status = nrfx_twim_init(&m_twim_inst, &twim_config, twim_handler, p_context); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(SLAVE_SCL_PIN, - SLAVE_SDA_PIN, + nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(TWIM_TWIS_SLAVE_SCL_PIN, + TWIM_TWIS_SLAVE_SDA_PIN, DRONE_IDX); status = nrfx_twis_init(&m_twis_inst, &twis_config, twis_handler); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_twim_twis/txrx/sample.yaml b/nrfx/samples/src/nrfx_twim_twis/txrx/sample.yaml index 88bc156f..7af7ac4f 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txrx/sample.yaml +++ b/nrfx/samples/src/nrfx_twim_twis/txrx/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - twim - twis - filter: dt_compat_enabled("nordic,nrf-twim") and dt_compat_enabled("nordic,nrf-twis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_twim_twis/txtx/CMakeLists.txt b/nrfx/samples/src/nrfx_twim_twis/txtx/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txtx/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_twim_twis/txtx/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_twim_twis/txtx/README.md b/nrfx/samples/src/nrfx_twim_twis/txtx/README.md index bd35afb9..80a84e3d 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txtx/README.md +++ b/nrfx/samples/src/nrfx_twim_twis/txtx/README.md @@ -12,7 +12,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | + ## Overview Application initializes nrfx_twim and nrfx_twis drivers. diff --git a/nrfx/samples/src/nrfx_twim_twis/txtx/main.c b/nrfx/samples/src/nrfx_twim_twis/txtx/main.c index f02b06e0..2b3140e9 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txtx/main.c +++ b/nrfx/samples/src/nrfx_twim_twis/txtx/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -59,29 +59,6 @@ * to prepare data for sending and update particular registers of @ref m_drone_reg. */ -/** @brief Symbol specifying pin number of master SCL. */ -#define MASTER_SCL_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying pin number of master SDA. */ -#define MASTER_SDA_PIN LOOPBACK_PIN_2A - -/** @brief Symbol specifying pin number of slave SCL. */ -#define SLAVE_SCL_PIN LOOPBACK_PIN_1B - -/** @brief Symbol specifying pin number of slave SDA. */ -#define SLAVE_SDA_PIN LOOPBACK_PIN_2B - -#if defined(NRF52_SERIES) || defined(__NRFX_DOXYGEN__) -/** @brief Symbol specifying TWIM instance to be used. */ -#define TWIM_INST_IDX 0 - -/** @brief Symbol specifying TWIS instance to be used. */ -#define TWIS_INST_IDX 1 -#else -#define TWIM_INST_IDX 1 -#define TWIS_INST_IDX 2 -#endif - /** @brief Symbol specifying drone (slave) address on TWI bus. */ #define DRONE_IDX 0x01U @@ -287,12 +264,12 @@ int main(void) sizeof(register_num), (uint8_t *)&drone_ctrl_buffer, sizeof(drone_ctrl_buffer)); - nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(MASTER_SCL_PIN, MASTER_SDA_PIN); + nrfx_twim_config_t twim_config = NRFX_TWIM_DEFAULT_CONFIG(TWIM_TWIS_MASTER_SCL_PIN, TWIM_TWIS_MASTER_SDA_PIN); status = nrfx_twim_init(&m_twim_inst, &twim_config, twim_handler, p_context); NRFX_ASSERT(status == NRFX_SUCCESS); - nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(SLAVE_SCL_PIN, - SLAVE_SDA_PIN, + nrfx_twis_config_t twis_config = NRFX_TWIS_DEFAULT_CONFIG(TWIM_TWIS_SLAVE_SCL_PIN, + TWIM_TWIS_SLAVE_SDA_PIN, DRONE_IDX); status = nrfx_twis_init(&m_twis_inst, &twis_config, twis_handler); NRFX_ASSERT(status == NRFX_SUCCESS); diff --git a/nrfx/samples/src/nrfx_twim_twis/txtx/sample.yaml b/nrfx/samples/src/nrfx_twim_twis/txtx/sample.yaml index b21a3d17..714d6162 100644 --- a/nrfx/samples/src/nrfx_twim_twis/txtx/sample.yaml +++ b/nrfx/samples/src/nrfx_twim_twis/txtx/sample.yaml @@ -6,18 +6,19 @@ tests: tags: - twim - twis - filter: dt_compat_enabled("nordic,nrf-twim") and dt_compat_enabled("nordic,nrf-twis") platform_allow: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52dk/nrf52832 - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf52833dk_nrf52833.overlay b/nrfx/samples/src/nrfx_uarte/boards/nrf52833dk_nrf52833.overlay index e385c6b8..8850a189 100644 --- a/nrfx/samples/src/nrfx_uarte/boards/nrf52833dk_nrf52833.overlay +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf52833dk_nrf52833.overlay @@ -1,3 +1,4 @@ +/* UARTE used in the sample needs to be disabled due to a conflict in connecting irq handlers. */ &uart1 { status = "disabled"; compatible = "nordic,nrf-uarte"; diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf52840dk_nrf52840.overlay b/nrfx/samples/src/nrfx_uarte/boards/nrf52840dk_nrf52840.overlay index e385c6b8..8850a189 100644 --- a/nrfx/samples/src/nrfx_uarte/boards/nrf52840dk_nrf52840.overlay +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf52840dk_nrf52840.overlay @@ -1,3 +1,4 @@ +/* UARTE used in the sample needs to be disabled due to a conflict in connecting irq handlers. */ &uart1 { status = "disabled"; compatible = "nordic,nrf-uarte"; diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf5340dk_nrf5340_cpuapp.overlay b/nrfx/samples/src/nrfx_uarte/boards/nrf5340dk_nrf5340_cpuapp.overlay index e385c6b8..8850a189 100644 --- a/nrfx/samples/src/nrfx_uarte/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,3 +1,4 @@ +/* UARTE used in the sample needs to be disabled due to a conflict in connecting irq handlers. */ &uart1 { status = "disabled"; compatible = "nordic,nrf-uarte"; diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000..38e022a0 --- /dev/null +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_UARTE20=y diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000..9c0c7227 --- /dev/null +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,15 @@ +/ { + chosen { + zephyr,console = &uart30; + }; +}; + +/* UARTE used in the sample needs to be disabled due to a conflict in connecting irq handlers. */ +&uart20 { + status = "disabled"; + compatible = "nordic,nrf-uarte"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/nrfx/samples/src/nrfx_uarte/boards/nrf9160dk_nrf9160.overlay b/nrfx/samples/src/nrfx_uarte/boards/nrf9160dk_nrf9160.overlay index e385c6b8..8850a189 100644 --- a/nrfx/samples/src/nrfx_uarte/boards/nrf9160dk_nrf9160.overlay +++ b/nrfx/samples/src/nrfx_uarte/boards/nrf9160dk_nrf9160.overlay @@ -1,3 +1,4 @@ +/* UARTE used in the sample needs to be disabled due to a conflict in connecting irq handlers. */ &uart1 { status = "disabled"; compatible = "nordic,nrf-uarte"; diff --git a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/CMakeLists.txt b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/README.md b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/README.md index c65d749f..b0842e07 100644 --- a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/README.md +++ b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/README.md @@ -12,6 +12,7 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | ## Overview diff --git a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/main.c b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/main.c index c9cf8896..905ee5de 100644 --- a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/main.c +++ b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -56,15 +56,6 @@ * The @ref uarte_handler() is executed with relevant log messages. */ -/** @brief Symbol specifying UARTE instance to be used. */ -#define UARTE_INST_IDX 1 - -/** @brief Symbol specifying TX pin number of UARTE. */ -#define UARTE_TX_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying RX pin number of UARTE. */ -#define UARTE_RX_PIN LOOPBACK_PIN_1B - /** @brief Symbol specifying the first message to be sent via UARTE data transfer as part of @ref m_tx_buffer. */ #define MSG1 "Nordic" @@ -104,9 +95,9 @@ static rx_buffers_t m_rx_buffers; static void rx_buffers_print(rx_buffers_t * p_rx_buff) { NRFX_LOG_INFO("................................"); - NRFX_LOG_INFO("RX buffer1 - addr: %p | content: %s", p_rx_buff->buff_1, p_rx_buff->buff_1); - NRFX_LOG_INFO("RX buffer2 - addr: %p | content: %s", p_rx_buff->buff_2, p_rx_buff->buff_2); - NRFX_LOG_INFO("RX buffer3 - addr: %p | content: %s", p_rx_buff->buff_3, p_rx_buff->buff_3); + NRFX_LOG_INFO("RX buffer1 - addr: %p | content: %s", (void *)p_rx_buff->buff_1, p_rx_buff->buff_1); + NRFX_LOG_INFO("RX buffer2 - addr: %p | content: %s", (void *)p_rx_buff->buff_2, p_rx_buff->buff_2); + NRFX_LOG_INFO("RX buffer3 - addr: %p | content: %s", (void *)p_rx_buff->buff_3, p_rx_buff->buff_3); NRFX_LOG_INFO("................................"); NRFX_EXAMPLE_LOG_PROCESS(); } @@ -148,7 +139,6 @@ static void uarte_handler(nrfx_uarte_event_t const * p_event, void * p_context) { NRFX_LOG_INFO("--> TX done"); NRFX_LOG_INFO("--> Bytes transfered: %u", p_event->data.tx.length); - nrfx_uarte_uninit(p_inst); } } @@ -197,6 +187,8 @@ int main(void) while (nrfx_uarte_tx_in_progress(&uarte_inst)) {} + nrfx_uarte_uninit(&uarte_inst); + rx_buffers_print(&m_rx_buffers); while (1) diff --git a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/sample.yaml b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/sample.yaml index b079106e..0f4c8570 100644 --- a/nrfx/samples/src/nrfx_uarte/rx_double_buffered/sample.yaml +++ b/nrfx/samples/src/nrfx_uarte/rx_double_buffered/sample.yaml @@ -4,16 +4,17 @@ sample: tests: examples.nrfx_uarte.rx_double_buffered: tags: uarte - filter: dt_compat_enabled("nordic,nrf-uarte") platform_allow: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: diff --git a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/CMakeLists.txt b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/CMakeLists.txt index 410fabc1..91d258a8 100644 --- a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/CMakeLists.txt +++ b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(COMMON_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../common) include(${COMMON_PATH}/common.cmake) +# manually add .conf and .overlay files GET_DEVICE_CONFIG_FILES(${BOARD} ../boards) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/README.md b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/README.md index 4d17c5bb..0edf819a 100644 --- a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/README.md +++ b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/README.md @@ -12,7 +12,9 @@ The sample supports the following development kits: | nrf52833dk_nrf52833 | Yes | | nrf52840dk_nrf52840 | Yes | | nrf5340dk_nrf5340 | Yes | +| nrf54l15dk_nrf54l15 | Yes | | nrf9160dk_nrf9160 | Yes | + ## Overview Application initializes the nrfx_uarte driver and sends a specified message ( @p MSG_TO_SEND ) using UARTE instance. diff --git a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/main.c b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/main.c index 6f4b19fd..ff66a786 100644 --- a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/main.c +++ b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 - 2024, Nordic Semiconductor ASA + * Copyright (c) 2022 - 2025, Nordic Semiconductor ASA * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -55,15 +55,6 @@ * The @ref uarte_handler() is executed with relevant log messages. */ -/** @brief Symbol specifying UARTE instance to be used. */ -#define UARTE_INST_IDX 1 - -/** @brief Symbol specifying TX pin number of UARTE. */ -#define UARTE_TX_PIN LOOPBACK_PIN_1A - -/** @brief Symbol specifying RX pin number of UARTE. */ -#define UARTE_RX_PIN LOOPBACK_PIN_1B - /** @brief Symbol specifying message to be sent via UARTE data transfer.*/ #define MSG_TO_SEND "Nordic Semiconductor" @@ -83,7 +74,6 @@ static uint8_t m_rx_buffer[sizeof(MSG_TO_SEND)]; */ static void uarte_handler(nrfx_uarte_event_t const * p_event, void * p_context) { - nrfx_uarte_t * p_inst = p_context; if (p_event->type == NRFX_UARTE_EVT_TX_DONE) { NRFX_LOG_INFO("--> UARTE event: TX done"); @@ -94,7 +84,6 @@ static void uarte_handler(nrfx_uarte_event_t const * p_event, void * p_context) { NRFX_LOG_INFO("UARTE event: %d", p_event->type); } - nrfx_uarte_uninit(p_inst); } /** @@ -119,7 +108,6 @@ int main(void) nrfx_uarte_t uarte_inst = NRFX_UARTE_INSTANCE(UARTE_INST_IDX); nrfx_uarte_config_t uarte_config = NRFX_UARTE_DEFAULT_CONFIG(UARTE_TX_PIN, UARTE_RX_PIN); - uarte_config.p_context = &uarte_inst; status = nrfx_uarte_init(&uarte_inst, &uarte_config, uarte_handler); NRFX_ASSERT(status == NRFX_SUCCESS); @@ -133,6 +121,11 @@ int main(void) status = nrfx_uarte_tx(&uarte_inst, m_tx_buffer, sizeof(m_tx_buffer), 0); NRFX_ASSERT(status == NRFX_SUCCESS); + while (nrfx_uarte_tx_in_progress(&uarte_inst)) + {} + + nrfx_uarte_uninit(&uarte_inst); + while (1) { NRFX_EXAMPLE_LOG_PROCESS(); diff --git a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/sample.yaml b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/sample.yaml index b3ad77af..7b2e744e 100644 --- a/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/sample.yaml +++ b/nrfx/samples/src/nrfx_uarte/tx_rx_non_blocking/sample.yaml @@ -4,16 +4,17 @@ sample: tests: examples.nrfx_uarte.tx_rx_non_blocking: tags: uarte - filter: dt_compat_enabled("nordic,nrf-uarte") platform_allow: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 integration_platforms: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf9160dk/nrf9160 harness: console harness_config: