I'm using it but in order to be fast ( I know it's not very linux style ...
but )
Set up
#ifdef __arm__
#define MAP_SIZE 4096UL //< Constant used for the memory mapping of the eqep
#define MAP_MASK (MAP_SIZE - 1)
// mmaping device register in order to speed up things
if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1)
{
LOG(logFATAL) << " Unable to open /dev/mem";
exit(-1);
}
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd,
(eqepMap.at(channel).phAddress) & ~MAP_MASK );
if(map_base == (void *) -1) {
LOG(logFATAL) << " Unable to mmap eqep";
exit(-1);
}
virt_addr = map_base + ((eqepMap.at(channel).phAddress) & MAP_MASK);
#endif
Read Position
inline int32_t get_position_fast() { return *((int32_t *) virt_addr); } ///<
not really clean but performing
Il giorno giovedì 17 aprile 2014 20:46:32 UTC+2, William Hermans ha scritto:
>
> Strawson, best thing I personally can think of, would be to use two or
> more pointers to the same file, and rotate between them. Closing one down
> while the other continues operating.
>
>
> On Thu, Apr 17, 2014 at 11:09 AM, Robert Nelson
> <[email protected]<javascript:>
> > wrote:
>
>> On Thu, Apr 17, 2014 at 12:30 PM, Strawson <[email protected]<javascript:>>
>> wrote:
>> > Hello all,
>> >
>> > In an effort to make use of the eQEP modules on the beaglebone black we
>> > stumbled across the following encoder patch and were able to compile a
>> > loadable kernel module with the help of TI. Hopefully this will make
>> its way
>> > to the "thirdparty" script in the debian build farm so the community
>> can use
>> > this without recompiling
>> >
>> > https://github.com/Teknoman117/beaglebot/tree/master/encoders
>>
>> It looks pretty self-contained, i have no problem adding to the
>> current kernel patches..
>>
>> > I would like to make known a bug we ran into with reading the eQEP
>> module
>> > that resulted in position values not updating after exactly 1020 reads
>> > without closing the file pointer. If the file pointer is closed and
>> > re-opened for every read, the behavior is normal, but opening/closing
>> the
>> > file is painfully slow. I unfortunately don't really know where to begin
>> > with finding and fixing this problem, but any insight would be
>> appreciated.
>>
>>
>> yikes, it still needs a little work then..
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> http://www.rcn-ee.com/
>>
>> --
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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].
For more options, visit https://groups.google.com/d/optout.