Quantcast
Viewing all articles
Browse latest Browse all 4814

Advanced users • Re: Using I2C 5 and DPI 666 simultaneously

o.k. in the end that should also not cause any conflicts, but it still looks like an unpredictable thing because the I2C bus is - more or less random

My test overlay looks like (simplified) when I've added a i2c_gpio node:

Code:

/* * i2c-led-tlc59116-overlay.dts *//dts-v1/;/plugin/;#include <dt-bindings/gpio/gpio.h>#include <dt-bindings/leds/common.h>#include <dt-bindings/pinctrl/bcm2835.h>/ {compatible = "brcm,bcm2835";fragment@0 {target-path = "/";__overlay__ {i2c_gpio: i2c@5 {compatible = "i2c-gpio";gpios = <&gpio 10 0 /* sda */ &gpio 11 0>; /* scl */i2c-gpio,delay-us = <4>;        /* ~100 kHz */#address-cells = <1>;#size-cells = <0>;};};};fragment@1 {target = <&i2c_gpio>;__overlay__ {#address-cells = <1>;#size-cells = <0>;tlc: tlc@60{compatible = "ti,tlc59116";#pwm-cells = <2>;gpio-controller;#gpio-cells = <2>;reg = <0x60>;status = "okay";red@0 {label = "red1";reg = <0>;function = LED_FUNCTION_INDICATOR;color = <LED_COLOR_ID_RED>;linux,default-trigger = "heartbeat";max-brightness = <64>;};blue@2 {label = "blue1";reg = <2>;function = LED_FUNCTION_INDICATOR;color = <LED_COLOR_ID_BLUE>;linux,default-trigger = "timer";led-pattern = "0 2000 255 4000";max-brightness = <64>;};green@13 {label = "green4";reg = <13>;function = LED_FUNCTION_INDICATOR;color = <LED_COLOR_ID_GREEN>;linux,default-trigger = "default-on";max-brightness = <64>;};};};};};
this results in

Code:

pi@cm4:~ $ sudo i2cdetect -li2c-20i2c       fef04500.i2c                    I2C adapteri2c-21i2c       fef09500.i2c                    I2C adapteri2c-22i2c       i2c@5                           I2C adapterpi@cm4:~ $ ls /sys/bus/i2c/driversdummy  stmpe-i2c  tlc591xxpi@cm4:~ $ sudo i2cdetect -y 22     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: UU -- -- -- -- -- -- -- -- -- -- 6b -- -- -- -- 70: -- -- -- -- -- -- -- --  
So how would one have to change that to have I2C-5 created/label exported and said bus available to use with other overlays?
As bugs mentioned about merging to simplify, How can i do that?
Fragment@0 is what you're interested in. The target for your I2C device(es) needs to be changed to 'target = <&i2c_gpio>;' as shown in the DT overlay snippet.

Statistics: Posted by aBUGSworstnightmare — Fri Jan 19, 2024 10:31 am



Viewing all articles
Browse latest Browse all 4814

Trending Articles