zephyr/tests
Martí Bolívar c3ec5db6d2 devicetree.h: add accessor API for nodes and properties
This is joint work with Kumar Gala (see signed-off-by).

Add helper macros which abstract the "true names" of each of the four
types of node identifier we intend to support (e.g. DT_ALIAS(),
DT_INST()).

These can be passed to a new DT_PROP() macro which can be used to read
the value of a devicetree property given a node identifier from one of
these four other macros, and the as-a-c-token name of the property.
Add other accessor macros and tests as well.

Add some convenience APIs for writing device drivers based on instance
numbers as well. Drivers can "#define DT_DRV_COMPAT driver_compatible"
at the top of the file, then utilize these DT_INST_* macros to access
various property defines.

For example, the uart_sifive driver can do:

  #define DT_DRV_COMPAT sifive_uart0

Then use DT_INST macros like:

  .port         = DT_INST_REG_ADDR(0),
  .sys_clk_freq = DT_INST_PROP(0, clock_frequency),

For convenience working with specific hardware, also add:

  <devicetree/gpio.h>
  <devicetree/adc.h>
  <devicetree/spi.h>

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
..
application_development Revert "global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()" 2020-03-19 18:45:13 +01:00
arch Revert "global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()" 2020-03-19 18:45:13 +01:00
benchmarks tests: benchmarks: Add ARM64 case 2020-02-01 08:08:43 -05:00
bluetooth boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422 2020-03-24 11:45:27 +01:00
boards driver: gpio: dw: convert to DT_INST defines 2020-03-11 07:59:38 -06:00
crypto
drivers boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422 2020-03-24 11:45:27 +01:00
kernel tests: kernel: context: in README, fix text for k_cpu_idle testing 2020-03-23 12:10:46 -07:00
lib devicetree.h: add accessor API for nodes and properties 2020-03-24 10:11:20 -05:00
misc/test_build boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422 2020-03-24 11:45:27 +01:00
net tests: net: Improve ICMPv4 tests 2020-03-16 14:34:24 +02:00
portability
posix tests: posix: pthread: Clean up test for pthread_getname/setname_np 2020-03-23 12:48:20 -04:00
shell
subsys boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422 2020-03-24 11:45:27 +01:00
unit sys/util.h: allow UTIL_LISTIFY to pass args to repeat macro 2020-03-13 07:33:57 -06:00
ztest