TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: ANDY BURNS
date: 2017-12-24 08:47:00
subject: Re: For the I2C-1 `file`,

R.Wieser wrote:

> Rob Morley wrote:
>
>> To do that it would have to write into a buffer, then send it ...
>
> The question is, why do you have to ?

For many i2C devices you write a register address, followed by the value
to be written to that register, and possibly data to be written to
successive registers, these need to be atomic.

> I mean, I can write a line to the console in multiple parts by simply
> not sending an EOL.  No kind of buffer involved ...
What happens if process A writes "hello" to the console one character at
a time, while process B writes "goodbye" to the console, also one
character at a time?

What if process A writes "1" followed by "2" to the I2C port and process
B writes "3" followed by "4" to the I2C port?

Do you get 2 written to register 1, and 4 written to register 3?
or 3 written to register 1 and 4 written to register 2?
or 1 written to register 3 and 2 written to register 4?
or ...

Your I2C controlled hardware is going to behave unexpectedly

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.