Re: DTS own node DT_N_S_ undeclared
On Mar 5, 2021, at 11:26 AM, Piotr Barszczewski <email@example.com> wrote:So you are seeing correct behavior. The are several ways to get a NODE reference (DT_PATH and DT_NODELABEL) are 2 of them. They should expand to DT_N_S_vbatt_S_vbatt0. (This is meant to be concatenated with other identifies to resolve to an actual define in the generated header - via the macros on devicetree.h). It will not resolve to a meaningful value that can be compiled by itself.
It has to be used in connection with another macro in devicetree.h to get some data from the dts node.
For example if you wanted the "output-ohms” for vbatt0 you’d do something like:
int out_ohms = DT_PROP(VBATT_LIPO, output_ohms);
That would resolve to:
int out_ohms = 3300000;