Learning zephyr by deep diving into the nRF Connect SDK project BH1749 (sensor).
Where is DT_INST_0_ROHM_BH1749_BASE_ADDRESS defined?
Learning zephyr by deep diving into the nRF Connect SDK project BH1749 (sensor).
Where is DT_INST_0_ROHM_BH1749_BASE_ADDRESS defined?
Hi!
DT_INST_0_ROHM_BH1749_BASE_ADDRESS, along with a lot of other defines, is generated at compile-time when the board's DTS file enables the given sensor, in this case BH1749.
For reference, check out the Thingy:91 (pca20035) DTS file here. The declaration of the BH1749 sensor here will, at build time, generate the define you're asking about. You can find the specific define in the given file, after the project is built: build_folder/spm/zephyr/include/generated/generated_dts_board_unfixed.h
You can read more about how the device tree works in the NCS tutorial part two or in "Devicetree" in the NCS documentation.
Unfortunately, the defines generated at build time are not documented anywhere, so it's just something you will have to learn over time.
I hope this helps!
Best regards,
Heidi
Hi!
DT_INST_0_ROHM_BH1749_BASE_ADDRESS, along with a lot of other defines, is generated at compile-time when the board's DTS file enables the given sensor, in this case BH1749.
For reference, check out the Thingy:91 (pca20035) DTS file here. The declaration of the BH1749 sensor here will, at build time, generate the define you're asking about. You can find the specific define in the given file, after the project is built: build_folder/spm/zephyr/include/generated/generated_dts_board_unfixed.h
You can read more about how the device tree works in the NCS tutorial part two or in "Devicetree" in the NCS documentation.
Unfortunately, the defines generated at build time are not documented anywhere, so it's just something you will have to learn over time.
I hope this helps!
Best regards,
Heidi