diff --git a/boards/capes/cape-interface-spec.rst b/boards/capes/cape-interface-spec.rst index 12f7b40eae1650db7582b084b9bff1916513e298..8fabf7e7c80ea93f1c9cbeda0f3fcc419c52efd8 100644 --- a/boards/capes/cape-interface-spec.rst +++ b/boards/capes/cape-interface-spec.rst @@ -33,6 +33,9 @@ The udev rules used to create the userspace symlinks for the BeagleBone Cape Com More details can be found in :ref:`bone-methodology`. +Summary of cape interfaces +========================== + .. |A| replace:: :ref:`A <bone-analog>` .. |B| replace:: :ref:`B <bone-i2s>` .. |C| replace:: :ref:`C <bone-can>` @@ -47,9 +50,7 @@ More details can be found in :ref:`bone-methodology`. .. |U| replace:: :ref:`U <bone-uart>` .. |Y| replace:: :ref:`Y <bone-ecap>` -.. note:: - - Legend +.. note:: Legend * |D| : Digital general purpose input and output (GPIO) * |I| : Inter-integrated circuit bus (|I2C|) ports @@ -123,12 +124,73 @@ More details can be found in :ref:`bone-methodology`. | GND | 45 | 46 | GND | | |D| |E| |L| |P| | 45 | 46 | |D| |E| |L| |P| | +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + +.. + + This is an alternate starting point template that should be fully encompasing with indexes. It is a bit overwhelming, so I'm not making it visible. + + +------------------------------------------------------+---+-------------------------------------------------+ + | .. centered:: P9 | | .. centered:: P8 | + +===================+=====+======+=====================+===+==================+=====+======+=================+ + | Functions | odd | even | Functions | | Functions | odd | even | Functions | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | USB D+ | E1 | E2 | USB D- | | | | | | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | 5V OUT | E3 | E4 | GND | | | | | | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | GND | 1 | 2 | GND | | GND | 1 | 2 | GND | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | 3V3 OUT | 3 | 4 | 3V3 OUT | | D M | 3 | 4 | D M | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | 5V IN | 5 | 6 | 5V IN | | D M C4t | 5 | 6 | D M C4r | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | 5V OUT | 7 | 8 | 5V OUT | | D C2r | 7 | 8 | D C2t | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | PWR BUT | 9 | 10 | RESET | | D C3r | 9 | 10 | D C3t | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D U4r | 11 | 12 | D | | D P0o Q2b | 11 | 12 | D Q2a P0o | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D U4t | 13 | 14 | D E1a | | D E2b | 13 | 14 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 15 | 16 | D E1b | | D P0i | 15 | 16 | D P0i | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D I1c S00 | 17 | 18 | D I1d S0o | | D | 17 | 18 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | C0r D I2c | 19 | 20 | C0t D I2d | | D E2a | 19 | 20 | D M P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E0b S0i U2t | 21 | 22 | D E0a S0c U2r | | D M P1 | 21 | 22 | D M Q2b | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D S01 | 23 | 24 | C1r D I3c U1t | | D M | 23 | 24 | D M | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 | 25 | 26 | C1t D I3d U1r | | D M | 25 | 26 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 Q0b | 27 | 28 | D P0 S10 | | D L P1 | 27 | 28 | D L P1 U6r | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E S1i P0 | 29 | 30 | D P0 S1o | | D L P1 U6t | 29 | 30 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E S1c P0 | 31 | 32 | ADC VDD | | D L | 31 | 32 | D L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 4 | 33 | 34 | ADC GND | | D L Q1b | 33 | 34 | D E L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 6 | 35 | 36 | |A| 5 | | D L Q1a | 35 | 36 | D E L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 2 | 37 | 38 | |A| 3 | | D L U5t | 37 | 38 | D L U5r | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 0 | 39 | 40 | |A| 1 | | D L P1 | 39 | 40 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 | 41 | 42 | D Q0a S11 U3t P0 | | D L P1 Q4a | 41 | 42 | D L P1 Q4b | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | GND | 43 | 44 | GND | | D L P1 | 43 | 44 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | GND | 45 | 46 | GND | | D E L P1 | 45 | 46 | D E L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + .. _bone-gpio: Digital GPIO ************ -The compatibility layer comes with simple reference nodes for attaching the Linuuux gpio-leds or gpio-keys to any cape header GPIO pin. This provides simple userspace general purpose input or output with various trigger modes. +The compatibility layer comes with simple reference nodes for attaching the Linux gpio-leds or gpio-keys to any cape header GPIO pin. This provides simple userspace general purpose input or output with various trigger modes. The format followed for the gpio-leds nodes is **bone_led_P8_## / bone_led_P9_##**. The **gpio-leds** driver is used by these reference nodes internally and allows users to easily create compatible led nodes in overlays for Black, AI and AI-64. @@ -151,57 +213,55 @@ and other properties defined in the .. table:: GPIO pins - +---------------------------------------------------+-----+--------------------------------------+ - | .. centered:: P9 | | .. centered:: P8 | - +===================+=====+======+==================+=====+============+=====+======+============+ - | Functions | odd | even | Functions | | Functions | odd | even | Functions | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | GND | 1 | 2 | GND | | GND | 1 | 2 | GND | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | 3V3 OUT | 3 | 4 | 3V3 OUT | | D M | 3 | 4 | D M | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | 5V IN | 5 | 6 | 5V IN | | D M C4t | 5 | 6 | D M C4r | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | 5V OUT | 7 | 8 | 5V OUT | | D C2r | 7 | 8 | D C2t | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | PWR BUT | 9 | 10 | RESET | | D C3r | 9 | 10 | D C3t | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D U4r | 11 | 12 | D | | D P0o Q2b | 11 | 12 | D Q2a P0o | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D U4t | 13 | 14 | D E1a | | D E2b | 13 | 14 | D | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D | 15 | 16 | D E1b | | D P0i | 15 | 16 | D P0i | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D I1c S00 | 17 | 18 | D I1d S0o | | D | 17 | 18 | D | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | C0r D I2c | 19 | 20 | C0t D I2d | | D E2a | 19 | 20 | D M P1 | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D E0b S0i U2t | 21 | 22 | D E0a S0c U2r | | D M P1 | 21 | 22 | D M Q2b | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D S01 | 23 | 24 | C1r D I3c U1t | | D M | 23 | 24 | D M | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D P0 | 25 | 26 | C1t D I3d U1r | | D M | 25 | 26 | D | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D P0 Q0b | 27 | 28 | D P0 S10 | | D L P1 | 27 | 28 | D L P1 U6r | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D E S1i P0 | 29 | 30 | D P0 S1o | | D L P1 U6t | 29 | 30 | D L P1 | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D E S1c P0 | 31 | 32 | ADC VDD | | D L | 31 | 32 | D L | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | |A| 4 | 33 | 34 | ADC GND | | D L Q1b | 33 | 34 | D E L | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | |A| 6 | 35 | 36 | |A| 5 | | D L Q1a | 35 | 36 | D E L | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | |A| 2 | 37 | 38 | |A| 3 | | D L U5t | 37 | 38 | D L U5r | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | |A| 0 | 39 | 40 | |A| 1 | | D L P1 | 39 | 40 | D L P1 | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | D P0 | 41 | 42 | D Q0a S11 U3t P0 | | D L P1 Q4a | 41 | 42 | D L P1 Q4b | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | GND | 43 | 44 | GND | | D L P1 | 43 | 44 | D L P1 | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ - | GND | 45 | 46 | GND | | D E L P1 | 45 | 46 | D E L P1 | - +-------------------+-----+------+------------------+-----+------------+-----+------+------------+ + +------------------------------------------------------+---+-------------------------------------------------+ + | .. centered:: P9 | | .. centered:: P8 | + +===================+=====+======+=====================+===+==================+=====+======+=================+ + | Functions | odd | even | Functions | | Functions | odd | even | Functions | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | | 3 | 4 | | | P8_03 | 3 | 4 | P8_04 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | | 5 | 6 | | | P8_05 | 5 | 6 | P8_06 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | | 7 | 8 | | | P8_07 | 7 | 8 | P8_08 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | | 9 | 10 | | | P8_09 | 9 | 10 | P8_10 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 11 | 12 | D | | D P0o Q2b | 11 | 12 | D Q2a P0o | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 13 | 14 | D | | D E2b | 13 | 14 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 15 | 16 | D | | D P0i | 15 | 16 | D P0i | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 17 | 18 | D | | D | 17 | 18 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D | 19 | 20 | C0t D I2d | | D E2a | 19 | 20 | D M P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E0b S0i U2t | 21 | 22 | D E0a S0c U2r | | D M P1 | 21 | 22 | D M Q2b | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D S01 | 23 | 24 | C1r D I3c U1t | | D M | 23 | 24 | D M | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 | 25 | 26 | C1t D I3d U1r | | D M | 25 | 26 | D | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 Q0b | 27 | 28 | D P0 S10 | | D L P1 | 27 | 28 | D L P1 U6r | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E S1i P0 | 29 | 30 | D P0 S1o | | D L P1 U6t | 29 | 30 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D E S1c P0 | 31 | 32 | ADC VDD | | D L | 31 | 32 | D L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 4 | 33 | 34 | ADC GND | | D L Q1b | 33 | 34 | D E L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 6 | 35 | 36 | |A| 5 | | D L Q1a | 35 | 36 | D E L | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 2 | 37 | 38 | |A| 3 | | D L U5t | 37 | 38 | D L U5r | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | |A| 0 | 39 | 40 | |A| 1 | | D L P1 | 39 | 40 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | D P0 | 41 | 42 | D Q0a S11 U3t P0 | | D L P1 Q4a | 41 | 42 | D L P1 Q4b | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | GND | 43 | 44 | GND | | D L P1 | 43 | 44 | D L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ + | GND | 45 | 46 | GND | | D E L P1 | 45 | 46 | D E L P1 | + +-------------------+-----+------+---------------------+---+------------------+-----+------+-----------------+ .. table:: Bone GPIO LEDs interface @@ -356,15 +416,20 @@ and other properties defined in the +------------------------+-------------+----------+-----------+-----------+ | /sys/class/leds/P9_42 | P9_42 | gpio0_7 | gpio4_18 | gpio0_123 | +------------------------+-------------+----------+-----------+-----------+ - | /sys/class/leds/A15 | A15 | gpio0_19 | NA | NA | + | /sys/class/leds/A15 | A15 [7]_ | gpio0_19 | NA | NA | +------------------------+-------------+----------+-----------+-----------+ +.. [7] On BeagleBone Black, A15 is used to enable or disable the external CEC clock generation for the HDMI framer. + .. _bone-i2c: |I2C| ***** -Compatibility layer provides simple I2C bone bus nodes for creating compatible overlays for Black, AI and AI-64. The format followed for these nodes is **bone_i2c_#**. +Cape interface specification provides |I2C| controller device links for userspace interaction and defined device tree entries for creating compatible overlays for any compliant board and OS image. The device tree node are named as **bone_i2c_#**. + +|I2C| pins +========== .. table:: I2C pins @@ -390,10 +455,13 @@ Compatibility layer provides simple I2C bone bus nodes for creating compatible o .. [5] On Black and AI-64 only, not AI +|I2C| port mapping +================== + .. table:: I2C port mapping +-----------------+--------------+-------+-------+-----------+-------+--------+-----------+ - | SYSFS link | DT symbol | Black | AI | AI-64 | SCL | SDA | Overlay | + | Links | DT symbol | Black | AI | AI-64 | SCL | SDA | Overlay | +=================+==============+=======+=======+===========+=======+========+===========+ | /dev/bone/i2c/0 | bone_i2c_0 | I2C0 | I2C1 | TBD | On-board | +-----------------+--------------+-------+-------+-----------+-------+--------+-----------+ @@ -416,6 +484,9 @@ Compatibility layer provides simple I2C bone bus nodes for creating compatible o overlay is required to load the device driver or usermode device driver loading can be performed, depending on the driver. See :ref:`beagle101_i2c` for information on loading |I2C| drivers from userspace. +|I2C| overlay example +===================== + .. code-block:: :linenos: :caption: Example device tree overlay to enable I2C driver @@ -438,6 +509,11 @@ In :ref:`bone_cape_spec_i2c_example`, you can specify what driver you want to lo * https://www.kernel.org/doc/html/v5.10/i2c/instantiating-devices.html#method-1-declare-the-i2c-devices-statically * https://www.kernel.org/doc/Documentation/devicetree/bindings/i2c/ +|I2C| userspace example +======================= + +See :ref:`beagle101_i2c` for examples on using the userspace links to load appropriate Linux kernel drivers. + .. _bone-spi: SPI diff --git a/intro/beagle101/qwiic-stemma-grove-addons.rst b/intro/beagle101/qwiic-stemma-grove-addons.rst index f90e7e2106730ac4d745e8f436e7a3cc8996650c..0b6e2d2faf34c51ce19b2bca26c21a70114a0ffe 100644 --- a/intro/beagle101/qwiic-stemma-grove-addons.rst +++ b/intro/beagle101/qwiic-stemma-grove-addons.rst @@ -9,6 +9,10 @@ QWIIC, STEMMA and Grove Add-ons in Linux I'm creating a place for me to start taking notes on how to load drivers for I2C devices (mostly), but also other Grove add-ons. +.. todo:: + + Create a simple drawing of BeaglePlay connecting to an external add-on with an interesting device on it. + For simplicity sake, I'll use these definitions * **add-on**: the QWIIC, STEMMA (QT) or Grove add-on separate from your Linux computer @@ -125,7 +129,7 @@ Searching through the kernel sources, we can find the driver code at .. important:: - Don't miss that the driver, `tsl2561` , is actually part of a a superset driver, `tsl2563` . This can make things a bit trickier to find, so you have to look + Don't miss that the driver, `tsl2561` , is actually part of a superset driver, `tsl2563` . This can make things a bit trickier to find, so you have to look within the text of the driver source, not just the filenames.