Hello,
I need someone to shed some light on how to use the 'reg' node property because I am confused.com .
On this page https://docs.zephyrproject.org/latest/guides/dts/intro.html 'reg' is described as follows,
reg
Information used to address the device. The value is specific to the device (i.e. is different depending on the compatible property).
The reg
property is a sequence of (address, length)
pairs. Each pair is called a “register block”. Here are some common patterns:
-
Devices accessed via memory-mapped I/O registers (like
i2c@40003000
):address
is usually the base address of the I/O register space, andlength
is the number of bytes occupied by the registers. -
I2C devices (like
apds9960@39
and its siblings):address
is a slave address on the I2C bus. There is nolength
value. -
SPI devices:
address
is a chip select line number; there is nolength
.
However, looking zephyr.dts in the build folder of the example 'light intensity controller' in this tutorial nRF Connect SDK Tutorial - Part 2 NCS v1.3.0 I can see the 'reg' property used in a different way,
spi0: spi@8000 {
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x8000 0x1000 >;
interrupts = < 0x8 0x1 >;
status = "disabled";
label = "SPI_0";
};
Can someone please explain what is going on here?
Thank you.
Kind regards
Mohamed