/* ---------------------------------------------------------------------------- * Very simple Teensy 2.0 TWI library : code * * - This is mostly straight from the datasheet, section 20.6.6, figure 20-11 * (the code example in C), and section 20.8.1, figure 20-12 * - Also see the documentation for `` at * * * Some other (more complete) TWI libraries for the Teensy 2.0 (and other Atmel * processors): * - [i2cmaster] (http://homepage.hispeed.ch/peterfleury/i2cmaster.zip) * - written by [peter-fleury] (http://homepage.hispeed.ch/peterfleury/) * - [the arduino twi library] * (https://github.com/arduino/Arduino/tree/master/libraries/Wire/utility) * - look for an older version if you need one that doesn't depend on all the * other Arduino stuff * ---------------------------------------------------------------------------- * Copyright (c) 2012 Ben Blazak * Released under The MIT License (MIT) (see "license.md") * Project located at * ------------------------------------------------------------------------- */ #include "./teensy-2-0.h" // ---------------------------------------------------------------------------- void twi_init(void) { // set the prescaler value to 0 TWSR &= ~( (1<