first version verified to handle slave tx and rx properly.

Handles unknown I2C events as errors
removed some unnecessary uint16 type casts