Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2021 14:00:58 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Elwood Downey <elwood.downey@gmail.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: I2C/IIC working on RPI4
Message-ID:  <31C7EFC2-E266-49D6-919D-73D07B54FF53@yahoo.com>
In-Reply-To: <CAL98DL6UkRuGrLQPdJFxT77eK2RcHZyT52a389xkpfASH9mOXw@mail.gmail.com>
References:  <mailman.56.1619956801.75022.freebsd-arm@freebsd.org> <CAL98DL6UkRuGrLQPdJFxT77eK2RcHZyT52a389xkpfASH9mOXw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-May-2, at 11:05, Elwood Downey <elwood.downey at gmail.com> =
wrote:

> I've been trying everything to get I2C working since I started using
> freebsd on rpi a few years ago. With this change to config.txt, my =
hamclock
> <https://clearskyinstitute.com/ham/HamClock>; project can finally =
access all
> the I2C devices. Now that everything works I will also submit hamclock =
as a
> new package.

Turns out this is controllable from FreeBSD's shells and
programmatically: sysctl and its internal-call equivalents.
(This basically repeats a note to Mark Murray.)

For example of via sysctl usage from /bin/sh :

# sysctl dev.gpio.0.pin.3.function dev.gpio.0.pin.2.function
dev.gpio.0.pin.3.function: input
dev.gpio.0.pin.2.function: input

# sysctl dev.gpio.0.pin.3.function=3Dalt0 dev.gpio.0.pin.2.function=3Dalt0=

dev.gpio.0.pin.3.function: input -> alt0
dev.gpio.0.pin.2.function: input -> alt0

# sysctl dev.gpio.0.pin.3.function dev.gpio.0.pin.2.function
dev.gpio.0.pin.3.function: alt0
dev.gpio.0.pin.2.function: alt0

# gpioctl -f /dev/gpioc0 -l -v
pin 00: 1       pin 0<IN>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 01: 1       pin 1<IN>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 02: 1       pin 2<>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 03: 1       pin 3<>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 04: 1       pin 4<IN>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 05: 1       pin 5<IN>, =
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
. . .

Such can be used to avoid folks needing to adjust
the contents of the msdos file system that has the
RPi* firmware ( and its config.txt ).

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31C7EFC2-E266-49D6-919D-73D07B54FF53>