Here it is:
https://github.com/mcdonamp/RH_ROBO_Quadcopter/blob/master/i2c_bitbang/pru_sw/example_apps/control_alg/imu.p

I wrote it so we could communicate with an MPU6050 IMU via PRU for part of 
my senior design project.  It's a little rough, and was programmed with the 
MPU6050 in mind, and has been only tested with that IMU and a TMP101, so 
YMMV.
It supports single byte reads and single byte writes to addresses at a 
time.  It doesn't support reading multiple bytes, clock stretching, doesn't 
really wait for an ACK, and I'm sure I ignored a few other features of i2c.

Take a look at conventions.hp as well.  I made up my own conventions for 
calling the functions since I couldn't find any established calling 
conventions for the PRU.  The calling conventions are also documented 
(though slightly out of date, there are now more arg and ret val registers).

On Tuesday, December 31, 2013 1:58:02 AM UTC, liyaoshi wrote:
>
> Ti i2c master up 2 3.4Mbps 
>
> And with Bitbang ,what ever with ARM or PRU, I dont think you can get so 
> high speed .
>
>
> 2013/12/31 Andrew Dai <[email protected] <javascript:>>
>
>> I am eagerly awaiting your link :)
>>
>>
>> On Tuesday, October 22, 2013 1:10:17 AM UTC-4, Christopher Hopwood wrote:
>>>
>>> I stopped trying to utilize the i2c modules and just bitbanged it 
>>> myself. If you need i2c bitbanging on the PRU, I can drop the link to the 
>>> git for it tomorrow. 
>>
>>  -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.

Reply via email to