On a sunny day (Sat, 23 Nov 2019 12:30:34 +0100) it happened "R.Wieser"
wrote in :
>Jan,
>
>> Different tasks to the same i2c interface from user space
>> is not possible in a multitasker.
>
>Ofcourse it is. The only question is: how.
Maybe you think you can use flags to signal 'in use' for one process,
and have the other task wait 'Semaphore' i the keyword.
But that just may easily lock, reduces speed, not my sort of solution.
>Though chances are the serializer for it is already present in the OS, and
>we do not need to do anything special.
i2c has many modes, muti-master is one of those.
Why make it difficult if you have a zillion (tm) pins available on GPIO (or
anywhere else).
>> But you can make your own i2c interfaces on _any_ pins with some diodes
>
>Did you know that, as long as you can switch a pin from in to output, you do
>not even need diodes for that ?
Yes, me using diodes it is just a fail safe protection, you can switch I/O
direction
but that is not safe in case of a software fault if your I/O pin is high and
the i2c chip does a sda pulldown
as acknowledgment.
In experimental setups like I use (well sort of permanent, it is working
perfectly for years now) it is just a protection measure.
I leave it in in case of raspi, as new raspis are more expensive than diodes.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|