/*****************************************************/ /* NHD-C160100DiZ.c Program for writing to Newhaven Display Graphic COG - I2C interface (c)2009 Curt Lagerstam - Newhaven Display International, LLC. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*****************************************************/ #include #include "picture.h" /*****************************************************/ /*****************************************************/ sbit SDA = P1^0; //Serial data sbit SCL = P3^4; //Serial clock sbit RST = P3^7; //Reset /*****************************************************/ const char Slave = 0x7E; //slave address const char Comsend = 0x00; const char Datasend = 0x40; /*****************************************************/ void delay(unsigned int n) //Delay subroutine { unsigned int i,j; for (i=0;i