Curt Carpenter <1cjcarpenter-fodfmywu...@public.gmane.org> writes:

> I keep searching for some sort of definitive guide to using the IO
> capabilities of the board, but have had no luck.  There is nothing on
> software in the SRM, and memory-mapping to the registers described in
> the data sheet seems to be frowned upon.

I know of no definitive guide. There are some well written blog posts
but as with anything on the Internet, it's important to consider the
date it was published.

The bonescript analogRead module can handle this, so you could do all
this from the Cloud9 browser IDE. If you want to use javascript that is,
I prefer python (see next question).

>
> Can anyone point me to an entry point into all these mysteries?
> Where do I go to find the definitive guide to reading the analog
> inputs under Debian, for example?

Anytime I've done ADC on the Bone I've used this python library:
https://github.com/alexanderhiam/PyBBIO. 

The python snippet is something like this:

import Adafruit_BBIO.ADC as ADC
ADC.setup()
ADC.read(self.pin)

> What commands are available?  Why
> would anyone want to use file IO to do simple GPIO operations when it
> is so much faster to just memory-map the GPIO registers?

This question seems to arise quite often and there are a few "right"
answers. To me, directly using memory-map regions breaks down a certain
level of software and Linux abstractions. An analogous question,
perhaps, is: Why not just run everything as root? By using Linux from
userspace, you are sacrificing some of the performance but you gain the
ability to use a myriad of third-party libraries and your choice of
programming language.

You probably would get better performance if you made your own kernel
module for whatever you were trying to do, but that may not be the
easiest route if you just want to read an analog value.

Hope some of this helps,

Josh

-- 
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 beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to