Tiny asynchronous I2C driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tiny asynchronous I2C driver

467 Views
jrychter
Contributor V

I wrote a tiny driver that allows you to access I2C (IIC, I²C, or I squared C) on Freescale Kinetis microcontrollers. It works asynchronously (interrupt-driven), supports repeated start (restart) and does not depend on any large software framework.

It isn't anything particularly great, but I couldn't find anything like it (Kinetis SDK is nowhere near done, unfortunately), so I wrote my own and I thought I'd share the code. It is MIT-licensed, which means you can do pretty much anything you want with it.

It is not a fully-featured driver. Only master mode is implemented. Only 7-bit addressing is supported. Addressing is fully manual: it is your responsibility to shift the 7-bit I2C address to the left and add the R/W bit (actually, I see this as an advantage). There is almost no error handling.

Find it on the Kinetis I2C Driver page, or go directly to the GitHub repo with the code.

Enjoy!

--Jan (@jrychter on Twitter)

Tags (1)
0 Kudos
0 Replies