I have written an I²C driver for my PIC24FJ32GB002 which is running with FreeRTOS. It has an easy to use API and can be easily adapted to suit any other microcontroller. Also, thanks to the RTOS, many independent threads can be queued to access the I²C bus.
Another great feature is that when a thread is performing an I²C communication, which is really slow, it blocks letting another thread use the CPU. Yet this feature is currently disabled in my driver because at 400 kHz I²C speed it took the PIC24FJ32GB002 more time to dispatch a thread than to wait for the communications to end. Thus it is only useful for 100 kHz communications or for faster microcontrollers.
For simplicities sake, the driver does only detect and report comunication errors, but does no handle them. It is up to the user to do this.
I have been using this code for a while, and I am fairly pleased whith it. Yet there could still remain some hidden bugs or optimization possibilities. Any feedback is highly welcome.