diff --git a/docs/learning/converter_connectivity_tutorial/device_tree.png b/docs/learning/converter_connectivity_tutorial/device_tree.png deleted file mode 100644 index 10b37ccb..00000000 --- a/docs/learning/converter_connectivity_tutorial/device_tree.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35672063504fde6e534c8d5a95fe1c62becdb329339d9dbb6168875b642c8129 -size 50903 diff --git a/docs/learning/converter_connectivity_tutorial/index.rst b/docs/learning/converter_connectivity_tutorial/index.rst index 1e1c65ac..50889ec9 100644 --- a/docs/learning/converter_connectivity_tutorial/index.rst +++ b/docs/learning/converter_connectivity_tutorial/index.rst @@ -26,10 +26,9 @@ tools to this end - :ref:`kuiper` has matured considerably, with broad support for ADI devices and popular processor and FPGA development platforms - - The very popular :adi:`ADXL355 Pmod ` would have been - used initially, but the Linux driver had not been upstreamed yet. It has since - been released, and is being added as an option for this tutorial. (The original - ADXL345 / Digilent Pmod-ACL is still included.) + - The :adi:`ADXL355 Pmod ` has since been released, and + is being added as an option for this tutorial. (The original ADXL345 / + Digilent Pmod-ACL is still included.) - LibIIO now supports HWMON devices (if these terms aren't familiar, you'll learn about them soon), enabling the use of the absolute **best** device to @@ -194,7 +193,7 @@ correct image shortly. This is a fairly common step in bringing up embedded computers - Raspberry Pi, BeagleBone, Zedboard, Arrow SoCkit, or any machine that boots from an SD card. There are lots of ways to burn images, but the most straightforward way is to use the standard Raspberry Pi Imager, available here: -`Raspberry Pi OS (including Raspbery Pi Imager `__ +`Raspberry Pi OS (including Raspbery Pi Imager) `__ There are instructions for Windows, Mac, and Linux. The imager also works on machines that encrypt data being written to external drives since it's writing @@ -310,27 +309,50 @@ find anything. While we do have our ADXL3x5/LM75 physically connected to the board, Linux doesn't know about it yet because UNlike USB, PCI, SCSI, Firewire, HDMI, etc, SPI and I2C devices do not support enumeration. How do we tell the Linux kernel what we've connected to the expansion header? The answer is the -"Device Tree Overlay"g +"Device Tree Overlay". While you won't have to do anything more than editing a couple of files in this tutorial, it helps to understand a bit about what is going on under the surface. A "Device Tree" contains information about a system's hardware - what peripherals exist (like displays, memory, USB, Ethernet controllers, GPIO pins, etc.) A "Device Tree Overlay" contains information about additional connected -hardware, like our ADXL3x5/LM75. :numref:`fig-device_tree` shows a screenshot -of the ADXL345's overlay source. +hardware, like our ADXL3x5/LM75. :numref:`code-device-tree` shows the devicetree +of the ADXL345's overlay targetting the Raspberry Pi. It shows that the ADXL345 is connected to the SPI port, using the first CS signal (CS0), the maximum SPI clock frequency is 1MHz, and the interrupt signal is connected to Pin 19 (as shown in the connection diagram above.) -.. _fig-device_tree: +.. _code-device-tree: -.. figure:: device_tree.png - :align: center - :width: 600 +.. code-block:: dts + :caption: Partial ADXL345 overlay source (dts) + + // SPDX-License-Identifier: GPL-2.0 + /dts-v1/; + /plugin/; + + #include + + &{/} { + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; + }; + + &spi0 { + adxl345: adxl345@0 { + compatible = "adi,adxl345"; + reg = <0>; + spi-max-frequency = <1000000>; + spi-cpha; + spi-cpol; + interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gpio>; + }; + }; - Partial ADXL345 overlay source (dts) + &spidev0 { + status = "disabled"; + }; The device tree source is then compiled into a "flattened" device tree that the Linux kernel reads directly. While this process is fairly straightforward, it's @@ -342,12 +364,11 @@ Any changes to the connections - SPI CS line, interrrupt line, etc. will require a corresponding modification to the overlay.) For reference, here are the overlay source files for the three devices in this -tutorial. These are in the Linux rpi-5.15.y branch, used for Kuiper Linux -2022_r2 release: +tutorial. These are in the Linux rpi-6.12.y branch: -- `LM75 Device Tree Overlay `__ -- `ADXL345 Device Tree Overlay `__ -- `ADXL355 Device Tree Overlay `__ +- `LM75 Device Tree Overlay `__ +- `ADXL345 Device Tree Overlay `__ +- `ADXL355 Device Tree Overlay `__ .. NOTE:: @@ -431,6 +452,21 @@ To shut down at the end of the day, type: Hello, ADXL345, ADXL355, or LM75! --------------------------------- +.. caution:: + + The ADXL345 has two drivers: + + - :git-linux:`drivers/iio/accel/adxl345.h` (``ADXL345_I2C/SPI``) + - :git-linux:`drivers/input/misc/adxl34x.h` (``INPUT_ADXL34X``) + + And the IIO driver ``ADXL345_I2C/SPI`` cannot be selected if the inputs + ``INPUT_ADXL34X`` driver is selected! Make sure to do ``make menufconfig`` to + disable ``INPUT_ADXL34X``, then enable ``ADXL345_I2C/SPI``. + + Kuiper and RPI ships with ``INPUT_ADXL34X`` compiled as a module. + Make sure to `blacklist `__ + the one that won't be used before attaching the devicetree. + If all went well, Linux should have booted, found the ADXL3x5 or LM75, and loaded its driver. Run IIO Oscilloscope again. locate the DMM screen, check the ADXL345, select all channels, and click the triangular "play" button. You diff --git a/docs/solutions/reference-designs/ad4052-ardz/index.rst b/docs/solutions/reference-designs/ad4052-ardz/index.rst index 2928cab0..ac95c77f 100644 --- a/docs/solutions/reference-designs/ad4052-ardz/index.rst +++ b/docs/solutions/reference-designs/ad4052-ardz/index.rst @@ -166,12 +166,12 @@ The source code for baremetal projects can be found at: - Documentation * - NUCLEO-H503RB - no-OS - - :git-no-OS:`ad405x:projects/ad405x` - - TODO ``:external+no-OS:doc:`docs ``` + - :git-no-OS:`projects/ad405x` + - :external+no-OS:doc:`docs ` * - NUCLEO-H563ZI - no-OS - - :git-no-OS:`ad405x:projects/ad405x` - - TODO ``:external+no-OS:doc:`docs ``` + - :git-no-OS:`projects/ad405x` + - :external+no-OS:doc:`docs ` * - SDP-K1 - precision-converters-firmware - :git-precision-converters-firmware:`projects/ad405x_iio`