+#include <jtag.h>
+
+//! Handles an i2c command.
+void i2c_handle_fn( uint8_t const app,
+ uint8_t const verb,
+ uint32_t const len);
+
+// define the i2c app's app_t
+app_t const i2c_app = {
+
+ /* app number */
+ I2C_APP,
+
+ /* handle fn */
+ i2c_handle_fn,
+
+ /* name */
+ "I2C",
+
+ /* desc */
+ "\tThe I2C app implements the i2c bus protocol thus\n"
+ "\tturning your GoodFET into a USB-to-i2c adapter.\n"
+};
+
+#define I2CDELAY(x) delay(x<<4)
+
+
+//2xx only, need 1xx compat code
+#if (board == tilaunchpad)
+// P3.1 SDA
+// P3.3 SCL
+#define SDA (1<<1)
+#define SCL (1<<3)
+
+#define CLRSDA P3OUT&=~SDA
+#define SETSDA P3OUT|=SDA
+#define CLRSCL P3OUT&=~SCL
+#define SETSCL P3OUT|=SCL
+
+#define READSDA (P3IN&SDA?1:0)
+#define SDAINPUT P3DIR&=~SDA
+#define SDAOUTPUT P3DIR|=SDA
+#define SCLINPUT P3DIR&=~SCL
+#define SCLOUTPUT P3DIR|=SCL
+#define SETBOTH P3OUT|=(SDA|SCL)
+
+#else