Hello dear fellow developers,
I am solving the problem of how to add another peripheral to the project.
I would like to know a universal procedure for adding any peripheral that is included in the development board (any development board from Nordic) to the project. I am mainly concerned with communication interfaces such as UART or I2C or SPI. I would like to be able to address the peripheral using the method const struct device *my_dev = DEVICE_DT_GET(DT_NODELABEL(mydev));
I believe that successfully enabling any peripheral requires adding that peripheral to the .dts file in the Config files/Devicetree folder.

I then release the peripheral by mentioning its name with & in the .dts file.
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf9161ns_laca.dtsi>
#include "nrf9161dk_nrf9161_common.dtsi"
/ {
chosen {
zephyr,flash = &flash0;
zephyr,sram = &sram0_ns;
zephyr,code-partition = &slot0_ns_partition;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
};
};
&uart0 {
status = "okay";
current-speed = <115200>;
};
&uart1 {
status = "okay";
current-speed = <115200>;
};
So, in general, adding a peripheral looks something like this:
&my_peripherial_name{
// parametres like status and typical parametrs for that peripherial
}
The next step should be to enable the peripheral in the .prj config file.
Is this my procedure correct?
Kind Regards
Jaroslav Havel