Difference between revisions of "Device tree"

From Wiki at Neela Nurseries
Jump to: navigation, search
m (Correcting reference to Device Tree org's latest device tree specification document, v3p0 as of 2021-08-23 Monday.)
m (Adding notes on device tree device bindings files.)
Line 7: Line 7:
  
 
Today Monday studying section 4.0, "Device Bindings" and binding guidelines.  May have questions for [https://community.jaredwolff.com/ Jared Wolff] of CircuitDojo, relating to his [https://github.com/circuitdojo/air-quality-wing-zephyr-drivers/|Air Quality Wing] Zephyr driver project and specifically the [https://github.com/circuitdojo/air-quality-wing-zephyr-drivers/tree/main/dts/bindings|dts files in Jared's AQW project].
 
Today Monday studying section 4.0, "Device Bindings" and binding guidelines.  May have questions for [https://community.jaredwolff.com/ Jared Wolff] of CircuitDojo, relating to his [https://github.com/circuitdojo/air-quality-wing-zephyr-drivers/|Air Quality Wing] Zephyr driver project and specifically the [https://github.com/circuitdojo/air-quality-wing-zephyr-drivers/tree/main/dts/bindings|dts files in Jared's AQW project].
 +
 +
== Device Tree bindings files are yml format files ==
 +
 +
Noting that in AQW bindings file for SHCT3 sensor there is an <code>include</code> line:
 +
 +
<i>Code excerpt, full file from Jared Wolff AQW driver:</i>
 +
<pre>
 +
#
 +
# Copyright (c) 2021 Circuit Dojo LLC
 +
#
 +
 +
description: Sensirion SHTC3 Temp/Humidity Sensor
 +
 +
compatible: "sensirion,shtc3"
 +
 +
include: i2c-device.yaml
 +
</pre>
 +
 +
The file <code>i2c-device.yaml</code> is found locally in <code>/usr/local/share/ncs/v1.6.1/zephyr/dts/bindings/i2c/i2c-device.yaml</code>, and this file contains:
 +
 +
<i>Code excerpt, full file from Zephyr project:</i>
 +
<pre>
 +
# Copyright (c) 2017, Linaro Limited
 +
# SPDX-License-Identifier: Apache-2.0
 +
 +
# Common fields for I2C devices
 +
 +
include: [base.yaml, power.yaml]
 +
 +
on-bus: i2c
 +
 +
properties:
 +
    reg:
 +
      required: true
 +
      description: device address on i2c bus
 +
    label:
 +
      required: true
 +
</pre>
 +
  
  
 
<!-- end of page -->
 
<!-- end of page -->

Revision as of 16:18, 23 August 2021

2021-08-23 Monday Starting notes for Device Tree, an OS independent framework with its own governance and steering committee, community, web site and on-line documentation. First Device Tree documentation noted here is:

Today Monday studying section 4.0, "Device Bindings" and binding guidelines. May have questions for Jared Wolff of CircuitDojo, relating to his Quality Wing Zephyr driver project and specifically the files in Jared's AQW project.

Device Tree bindings files are yml format files

Noting that in AQW bindings file for SHCT3 sensor there is an include line:

Code excerpt, full file from Jared Wolff AQW driver:

#
# Copyright (c) 2021 Circuit Dojo LLC
#

description: Sensirion SHTC3 Temp/Humidity Sensor

compatible: "sensirion,shtc3"

include: i2c-device.yaml

The file i2c-device.yaml is found locally in /usr/local/share/ncs/v1.6.1/zephyr/dts/bindings/i2c/i2c-device.yaml, and this file contains:

Code excerpt, full file from Zephyr project:

# Copyright (c) 2017, Linaro Limited
# SPDX-License-Identifier: Apache-2.0

# Common fields for I2C devices

include: [base.yaml, power.yaml]

on-bus: i2c

properties:
    reg:
      required: true
      description: device address on i2c bus
    label:
      required: true