On Sun, Jun 11, 2017 at 3:04 PM, mzimmers <[email protected]> wrote:

> Hi William -
>
> Yeah, sorry about that...I was being lazy. The output of perror says
> "Connection timed out" though the first time the write is called, errno is
> 22. In the next write attempts, errno is 110 (agreeing with perror).  I'm
> trying to write an 8 to register 45 (POWER_CTL).
>
> But, before we worry too much about this error, let me ask this: if bit
> banging isn't a good idea, can you point me to a reference that describes
> the workings of the file I/O to the I2C? I'm new to embedded Linux (used to
> an RTOS) so bit-banging is more natural to me. I need to learn a little
> about what's "under the hood" of the Linux technique for this kind of I/O.
>

I think looking at the source code for the various tools included in the
i2c-tool debian package would be a good place to start. Also seeing if
there is a driver for your hardware in the Linux kernel might be a good
place to just gloss over ( at least ) to see how they're doing things.

I've done some lower level Linux dev I2C as well, and have probably run
into similar issues you're facing here. I'm not an expert. But what I did
realize in my own case that communicating with the hardware I am using( a
real time clock ) that using a different approach was much better. In my
case. I have some I2C code I've written in C, but at  this very moment I'm
busy with my own things, and not quite sure where that code is. At some
point however, I could look into my code and refresh my memory, and give
you an idea of what I did for a different situation.

So bit banging I2C would be a terrible idea in my opinion, because you
would using a lot of processor time. After that, there is very little
chance you'd be better at doing this than is what already is done in
drivers already. It could be worth a look, but I think you'd be spinning
your wheels. However, if performance, and a lower processor load was a
definite must. You could probably use an external MCU that used hardware
assisted I2C, and design something like an I2C to UART bridge . . .which
could be useful, I guess.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORr3nq7S%3DgP%3DKXiVorR4J%2B3v2p1CnV4CvmsmOOAYka3wfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to