📄 avr12864.i
字号:
0x00,0x08,0x08,0xF8,0xF8,0x08,0x08,0x08,0x00,0x00,0x00,0x1F,0x1F,0x10,0x00,0x00,
0x00,0xF8,0xF8,0x08,0x00,0xF0,0xF8,0x08,0x00,0x07,0x1F,0x38,0x20,0x3F,0x1F,0x00,
0x00,0x08,0xF8,0xF8,0x80,0xF0,0x78,0x08,0x00,0x00,0x00,0x1F,0x1F,0x07,0x00,0x00,
0x00,0xF8,0xF8,0xD8,0xF8,0xE0,0xF8,0x78,0x00,0x00,0x1F,0x1F,0x13,0x1F,0x0F,0x00,
0x00,0x00,0x38,0xF8,0xE0,0xF8,0x18,0x00,0x00,0x10,0x1C,0x0F,0x07,0x1F,0x1C,0x10,
0x00,0x08,0x78,0xF8,0xC0,0xF8,0x38,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,
0x00,0x30,0x38,0x08,0xC8,0xF8,0x38,0x08,0x00,0x10,0x1C,0x1F,0x13,0x10,0x18,0x18,
0x00,0x80,0xC0,0x40,0xC0,0xC0,0x00,0x00,0x00,0x1D,0x3D,0x26,0x3F,0x3F,0x30,0x10,
0x00,0x08,0xF8,0xF8,0x40,0xC0,0xC0,0x80,0x00,0x00,0x1F,0x3F,0x20,0x30,0x1F,0x0F,
0x00,0x80,0x80,0xC0,0x40,0xC0,0xC0,0x80,0x00,0x0F,0x1F,0x38,0x30,0x30,0x18,0x08,
0x00,0x80,0xC0,0x40,0x48,0xF8,0xF8,0x00,0x00,0x1F,0x1F,0x30,0x20,0x3F,0x1F,0x10,
0x00,0x80,0xC0,0x40,0x40,0xC0,0xC0,0x00,0x00,0x0F,0x1F,0x11,0x31,0x31,0x19,0x09,
0x00,0x40,0xF0,0xF8,0x48,0x48,0x08,0x08,0x00,0x00,0x1F,0x1F,0x10,0x00,0x00,0x00,
0x00,0x80,0xC0,0x40,0x40,0xC0,0xC0,0x40,0x00,0x69,0xFF,0x96,0x94,0x97,0xF3,0x70,
0x00,0xF8,0xF8,0x80,0xC0,0xC0,0xC0,0x00,0x00,0x1F,0x1F,0x00,0x00,0x1F,0x1F,0x10,
0x00,0x00,0x00,0x88,0x88,0x08,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x10,0x00,0x00,
0x00,0x00,0x00,0x00,0x88,0xC8,0xC8,0x00,0x00,0x00,0xC0,0xC0,0x80,0xFF,0x7F,0x00,
0x00,0x08,0xF8,0xF8,0xC0,0xC0,0x40,0x40,0x00,0x00,0x1F,0x1F,0x1F,0x1C,0x18,0x00,
0x00,0x00,0x00,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x10,0x00,0x00,
0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x1F,0x1F,0x1F,0x1F,0x00,0x1F,0x1F,
0x00,0x80,0xC0,0xC0,0x40,0xC0,0xC0,0x00,0x00,0x1F,0x1F,0x00,0x00,0x1F,0x1F,0x00,
0x00,0x80,0xC0,0x40,0x40,0xC0,0xC0,0x00,0x00,0x0F,0x1F,0x30,0x20,0x30,0x1F,0x0F,
0x00,0x00,0xC0,0xC0,0x40,0x40,0xC0,0x80,0x00,0x80,0xFF,0xFF,0xA0,0x30,0x1F,0x0F,
0x00,0x80,0xC0,0x40,0x40,0xC0,0x80,0x00,0x00,0x1F,0x3F,0x20,0xA0,0xFF,0xFF,0x80,
0x00,0x00,0x80,0xC0,0xC0,0x40,0x40,0x40,0x00,0x00,0x10,0x1F,0x1F,0x00,0x00,0x00,
0x00,0x00,0xC0,0xC0,0x40,0xC0,0xC0,0x00,0x00,0x00,0x11,0x33,0x26,0x3F,0x1D,0x00,
0x00,0x00,0x40,0xE0,0xE0,0x40,0x40,0x00,0x00,0x00,0x00,0x1F,0x3F,0x30,0x10,0x00,
0x00,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0x00,0x00,0x07,0x1F,0x38,0x20,0x3F,0x1F,0x10,
0x00,0x40,0xC0,0xC0,0x40,0xC0,0xC0,0x40,0x00,0x00,0x03,0x1F,0x1C,0x1F,0x03,0x00,
0x40,0xC0,0xC0,0xC0,0xC0,0x40,0xC0,0xC0,0x00,0x07,0x3F,0x3E,0x0F,0x1F,0x1F,0x03,
0x00,0x40,0xC0,0xC0,0x40,0xC0,0xC0,0x40,0x00,0x00,0x18,0x1F,0x0F,0x1D,0x18,0x00,
0x00,0x40,0xC0,0xC0,0x40,0xC0,0xC0,0x40,0x00,0xC0,0xC3,0xFF,0x7C,0x0F,0x03,0x00,
0x00,0x00,0x40,0x40,0x40,0xC0,0xC0,0x40,0x00,0x10,0x18,0x1C,0x17,0x13,0x18,0x18,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xF8,0xF8,0x38,0x00,0x00,0x00,0x00,0x00,0x31,0x31,0x30,0x00,0x00,
0x10,0x98,0xD8,0x68,0xE8,0xC8,0xF8,0xF0,0x00,0x0F,0x1F,0x30,0x3F,0x3F,0x3F,0x1F,
0x00,0x40,0xE0,0xF8,0xD8,0xF8,0x78,0x40,0x00,0x02,0x0F,0x0F,0x1F,0x1F,0x02,0x02,
0x00,0x78,0x7C,0xFC,0xFC,0xD4,0x9C,0x98,0x00,0x0E,0x1E,0x1F,0x1F,0x10,0x1F,0x0F,
0x00,0xF8,0xF8,0xF8,0xE0,0x78,0x18,0x00,0x00,0x20,0x3C,0x1F,0x1F,0x3F,0x3F,0x1F,
0x00,0x20,0x38,0x1E,0x06,0x1E,0x38,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xF8,0xF8,0xF8,0xF8,0x80,0x80,0x00,0x1F,0x1F,0x37,0x3F,0x1F,0x13,0x10,
0x00,0x00,0x80,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x02,0x07,0x07,0x07,0x02,0x00,
0x00,0x00,0x00,0x00,0xE0,0xF8,0x1C,0x04,0x00,0x00,0x00,0x00,0x07,0x1F,0x38,0x60,
0x00,0x04,0x1C,0xF8,0xE0,0x00,0x00,0x00,0x40,0x60,0x38,0x1F,0x07,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x00,
0x00,0x00,0x00,0xE0,0xE0,0x00,0x00,0x00,0x01,0x01,0x01,0x0F,0x0F,0x01,0x01,0x01,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x00,0x00,0x00,0x00,0xE0,0xFC,0x1E,0x02,0x00,0x60,0x7C,0x1F,0x03,0x00,0x00,0x00,
0x00,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xF0,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x40,0x40,0x40,0xFC,0xFC,0x00,0xFE,0xFE,0xC0,0x60,0x60,0x20,0x00,0x00,
0x00,0x08,0x08,0x0C,0x06,0x1F,0x1F,0x00,0x0F,0x1F,0x10,0x10,0x10,0x1E,0x0E,0x00,
0x08,0x08,0x08,0x08,0xC8,0xC8,0x49,0x6B,0x2E,0xA4,0xE4,0x64,0x04,0x04,0x04,0x00,
0x00,0x00,0x10,0x1C,0x0C,0x01,0x21,0x7F,0x7F,0x01,0x04,0x0C,0x18,0x18,0x00,0x00,
0x00,0xF8,0xF8,0x4C,0xFC,0xFC,0xA0,0xA0,0x20,0x20,0xFE,0xFE,0x10,0x10,0x10,0x00,
0x00,0x0F,0x0F,0x04,0x0F,0x0F,0x00,0x01,0x11,0x30,0x3F,0x3F,0x00,0x00,0x00,0x00,
0x00,0x00,0xF8,0xFA,0x06,0xE4,0xE4,0xB4,0xF4,0xF6,0x02,0x02,0xFE,0xFE,0x00,0x00,
0x00,0x00,0x1F,0x1F,0x00,0x07,0x07,0x02,0x07,0x07,0x10,0x30,0x3F,0x1F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x40,0x60,0x20,0x20,0x00,0x00,0x00,
0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x3F,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x00,0x08,0x08,0x08,0x08,0x08,0x08,0xF8,0xFC,0x84,0x84,0x84,0x04,0x04,0x04,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x01,0x01,0x00,0x00,0x00,
0x00,0x00,0x90,0xD8,0xEC,0x36,0x52,0x40,0x48,0x48,0xC8,0xEC,0x24,0x24,0x20,0x20,
0x02,0x03,0x01,0x1F,0x1F,0x00,0x00,0x00,0x00,0x20,0x7F,0x7F,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFC,0xFC,0x44,0x44,0xF4,0xF4,0x46,0x62,0xE2,0xE2,0x00,0x00,
0x20,0x30,0x18,0x0E,0x27,0x31,0x18,0x0E,0x07,0x09,0x18,0x18,0x1F,0x07,0x00,0x00,
0x40,0x60,0xE2,0xE6,0x04,0x40,0x60,0xBC,0x9E,0x82,0xBE,0xBE,0x20,0x20,0x00,0x00,
0x00,0x00,0x1F,0x1F,0x2C,0x24,0x31,0x1B,0x0E,0x0E,0x1B,0x31,0x30,0x20,0x20,0x20,
0x00,0x20,0x38,0x38,0x50,0x50,0xDA,0xEE,0x2C,0x28,0x28,0x18,0x18,0x00,0x00,0x00,
0x00,0x10,0x18,0x0F,0x07,0x0C,0x0F,0x1F,0x11,0x31,0x21,0x60,0x60,0x60,0x20,0x20,
0x00,0x00,0x80,0xE0,0x78,0x18,0x82,0x82,0x0E,0x1C,0x30,0x60,0xC0,0xC0,0x80,0x80,
0x02,0x03,0x01,0x18,0x1C,0x16,0x13,0x19,0x0A,0x0E,0x1C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xFC,0xA4,0xFC,0xFC,0x56,0x52,0x72,0x7E,0x0E,0x00,0x00,0x00,
0x00,0x20,0x20,0x20,0x24,0x24,0x3F,0x1F,0x12,0x12,0x12,0x10,0x10,0x10,0x10,0x00,
0x00,0x20,0x20,0xA0,0xFE,0xFE,0x50,0x50,0x48,0x48,0xCC,0xE4,0x24,0x24,0x20,0x20,
0x04,0x06,0x03,0x01,0x3F,0x3F,0x09,0x0E,0x16,0x30,0x3F,0x1F,0x02,0x06,0x0C,0x0C,
0x20,0x60,0x44,0x8C,0x98,0x5C,0x6C,0x34,0xD4,0xCE,0x9A,0xBA,0xAE,0x06,0x00,0x00,
0x00,0x18,0x1E,0x0F,0x11,0x19,0x0D,0x07,0x7F,0x7F,0x06,0x0C,0x18,0x18,0x10,0x10,
0x40,0x40,0x48,0x58,0xFD,0xF7,0xBE,0xAC,0xFC,0xF8,0x4C,0xE6,0xE6,0x20,0x20,0x00,
0x00,0x09,0x0D,0x0D,0x1F,0x1F,0x16,0x1C,0x0F,0x07,0x00,0x7F,0x7F,0x00,0x00,0x00,
0x80,0xC0,0x44,0xCC,0xC8,0xE0,0xE4,0x74,0xFE,0xFA,0x5E,0xF6,0xF2,0x00,0x00,0x00,
0x08,0x08,0x0B,0x0F,0x0C,0x1F,0x17,0x11,0x37,0x37,0x25,0x2F,0x2F,0x20,0x20,0x20,
0x80,0xC0,0x60,0xF8,0xFE,0x16,0x10,0x50,0x50,0x5A,0xEE,0xAC,0xA8,0x08,0x08,0x08,
0x00,0x00,0x00,0x3F,0x3F,0x00,0x00,0x1D,0x1D,0x15,0x17,0x1E,0x1E,0x00,0x00,0x00,
0x00,0x00,0xF0,0xF0,0x90,0x90,0xFF,0xFF,0x48,0x08,0xF8,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x03,0x02,0x1F,0x3F,0x21,0x21,0x21,0x20,0x20,0x3C,0x1C,0x00,
0x80,0x80,0xC0,0xC4,0xCC,0x88,0x80,0x90,0x90,0xF8,0xF8,0x4C,0x44,0x40,0x40,0x40,
0x00,0x00,0x00,0x1F,0x1F,0x0C,0x04,0x3C,0x3E,0x13,0x13,0x1A,0x1E,0x06,0x00,0x00,
0x00,0x00,0x08,0x98,0x90,0x40,0x70,0xBE,0xAE,0x30,0x50,0x70,0x30,0x00,0x00,0x00,
0x00,0x0C,0x0E,0x17,0x11,0x18,0x0E,0x07,0x03,0x06,0x0C,0x18,0x10,0x10,0x10,0x00,
0x00,0x00,0x80,0xC0,0x60,0x38,0x1A,0x82,0x86,0x8C,0x98,0x30,0x60,0x60,0x40,0x40,
0x01,0x21,0x21,0x31,0x19,0x0D,0x17,0x33,0x30,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,
0x00,0x20,0x24,0xA4,0xFC,0xFE,0x92,0x52,0x70,0x30,0xFF,0xFF,0xC8,0xC8,0x18,0x10,
0x04,0x06,0x03,0x01,0x1F,0x1F,0x21,0x21,0x30,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,
0x00,0x40,0xC4,0x8C,0x88,0xF0,0xF0,0xFE,0xFE,0x20,0x30,0xF0,0xF0,0x00,0x00,0x00,
0x00,0x10,0x18,0x0E,0x06,0x07,0x0F,0x1B,0x13,0x11,0x11,0x11,0x10,0x10,0x1F,0x0F,
0x00,0x40,0x40,0x40,0x4E,0x5E,0x56,0xF7,0xBD,0xAD,0xAF,0xA3,0x20,0x20,0x20,0x20,
0x00,0x00,0x40,0x40,0x53,0x57,0x55,0x7F,0x3F,0x2A,0x2B,0x21,0x20,0x20,0x00,0x00,
0x00,0x00,0x20,0x30,0x9C,0xDF,0x77,0x34,0x7E,0x4E,0xC6,0x80,0x80,0x00,0x00,0x00,
0x02,0x02,0x03,0x1F,0x3F,0x2A,0x3F,0x1F,0x15,0x35,0x3F,0x0F,0x01,0x01,0x01,0x01,
0x00,0x00,0x00,0x10,0xF8,0xEC,0x27,0x27,0xFC,0xFE,0x12,0x12,0x10,0x00,0x00,0x00,
0x02,0x02,0x02,0x02,0x03,0x01,0x01,0x01,0x7F,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,
0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0xB6,0x92,0x92,0xFE,0xFE,0x00,0x00,0x00,0x00,
0x00,0x40,0x60,0x30,0x1C,0x0F,0x03,0x01,0x10,0x30,0x3F,0x1F,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xF8,0xF8,0x88,0xCC,0x44,0x44,0xFC,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0F,0x0F,0x0C,0x04,0x04,0x0C,0x0F,0x0F,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x04,0x24,0x34,0xBC,0xEC,0x66,0x33,0x93,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x20,0x3A,0x1A,0x03,0x23,0x7E,0x7F,0x01,0x05,0x0D,0x19,0x10,0x00,0x00,
0x00,0x60,0x70,0xDC,0xEC,0x30,0x90,0xD0,0xF2,0xB6,0xDC,0xC8,0x88,0x00,0x00,0x00,
0x10,0x12,0x1B,0x0B,0x2F,0x35,0x19,0x0F,0x07,0x1F,0x3F,0x21,0x21,0x20,0x38,0x18,
0x00,0x80,0x88,0x8C,0xA7,0xAF,0xAA,0xFA,0xFC,0xD7,0x57,0x47,0x41,0x41,0x40,0x00,
0x00,0x00,0x00,0x02,0x02,0x06,0x0E,0x2A,0x7F,0x7F,0x01,0x01,0x01,0x00,0x00,0x00,
0x00,0x20,0x30,0xD8,0xFE,0x76,0x40,0x50,0x50,0x7F,0xBF,0xA8,0x28,0x20,0x20,0x20,
0x04,0x06,0x03,0x3F,0x3F,0x00,0x02,0x06,0x0E,0x2A,0x7F,0x7F,0x01,0x01,0x01,0x00,
0x00,0x18,0x38,0xEC,0xE4,0xBC,0x9C,0x00,0xFC,0xFC,0x24,0x26,0xE2,0xE2,0x00,0x00,
0x10,0x1F,0x1F,0x1F,0x0F,0x04,0x04,0x04,0x1F,0x1F,0x11,0x11,0x19,0x08,0x08,0x08,
0x00,0x00,0x04,0x04,0xE4,0xE4,0xAD,0xBF,0xFE,0x6E,0x72,0x72,0x02,0x00,0x00,0x00,
0x00,0x00,0x3E,0x3E,0x02,0x0E,0x0F,0x0B,0x0F,0x1D,0x31,0x3F,0x1F,0x00,0x00,0x00
};
#line 10 "G:\test\lcd\2\avr12864.c"
typedef const struct
{
unsigned char X;
unsigned char Y;
}LCDPos;
LCDPos const LCDInfo[]={{0x28,0x00},{0x30,0x00},{0x38,0x00},{0x40,0x00},{0x48,0x00},
{0x50,0x00},{0x58,0x00},
{0x30,0x02},{0x38,0x02},{0x40,0x02},
{0x48,0x02},{0x50,0x02},
{0x30,0x04},{0x40,0x04},
{0x30,0x06},{0x40,0x06},{0x48,0x06}};
unsigned char LCDInfoBuf[17];
int Count = 1234;
void delay_us(int time)
{
do
{
time--;
}
while (time>1);
}
void Delay(int x)
{
int i,j;
for(j=0;j<x;j++)
{
for(i=0;i<250;i++);
}
}
unsigned char receive_byte(void)
{
unsigned char i,temp=0;
(*(volatile unsigned char *)0x31) &= ~(1<< 4);
delay_us(90);
for(i=0;i<8;i++)
{
temp=temp<<1;
(*(volatile unsigned char *)0x32) |= (1<< 1);
delay_us(10);
if(((*(volatile unsigned char *)0x30) & (1<< 4))!=0)
temp|=0x01;
(*(volatile unsigned char *)0x32) &= ~(1<< 1);
delay_us(10);
}
(*(volatile unsigned char *)0x31) |= (1<< 4);
return temp;
}
void send_byte(unsigned char para)
{
unsigned char i;
(*(volatile unsigned char *)0x32) &= ~(1<< 0);
delay_us(90);
for(i=0;i<8;i++)
{
if((para&0x80)==0x80)
(*(volatile unsigned char *)0x32) |= (1<< 4);
else
(*(volatile unsigned char *)0x32) &= ~(1<< 4);
(*(volatile unsigned char *)0x32) |= (1<< 1);
delay_us(10);
(*(volatile unsigned char *)0x32) &= ~(1<< 1);
delay_us(10);
para=para<<1;
}
}
void write7279(unsigned char cmd1, unsigned char cmd2)
{
send_byte (cmd1);
send_byte (cmd2);
(*(volatile unsigned char *)0x32) |= (1<< 0);
}
void Rst7279(void)
{
send_byte(0xa4);
(*(volatile unsigned char *)0x32) |= (1<< 0);
}
unsigned char Read7279(void)
{
unsigned char keyval;
if(((*(volatile unsigned char *)0x30) & (1<< 5))==0)
{
send_byte(0x15);
keyval=receive_byte();
(*(volatile unsigned char *)0x32) |= (1<< 0);
return keyval;
}
return 0xff;
}
void LCD_NOP(void)
{
unsigned char i;
for(i=0;i<50;i++);
}
void LCD_Write_ComL(unsigned char x)
{
(*(volatile unsigned char *)0x3B).6 =0;
(*(volatile unsigned char *)0x3B).5 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =0;
(*(volatile unsigned char *)0x3B).4 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).3 =0;
(*(volatile unsigned char *)0x38)=x;
(*(volatile unsigned char *)0x3B).4 =1;
(*(volatile unsigned char *)0x3B).4 =0;
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =1;
}
void LCD_Write_DatL(unsigned char x)
{
(*(volatile unsigned char *)0x3B).6 =0;
(*(volatile unsigned char *)0x3B).5 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =0;
(*(volatile unsigned char *)0x3B).4 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =1;
(*(volatile unsigned char *)0x3B).3 =0;
(*(volatile unsigned char *)0x38)=x;
(*(volatile unsigned char *)0x3B).4 =1;
(*(volatile unsigned char *)0x3B).4 =0;
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =1;
}
void LCD_Write_ComR(unsigned char x)
{
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =0;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =0;
(*(volatile unsigned char *)0x3B).4 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).3 =0;
(*(volatile unsigned char *)0x38)=x;
(*(volatile unsigned char *)0x3B).4 =1;
(*(volatile unsigned char *)0x3B).4 =0;
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =1;
}
void LCD_Write_DatR(unsigned char x)
{
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =0;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =0;
(*(volatile unsigned char *)0x3B).4 =1;
LCD_NOP();
(*(volatile unsigned char *)0x3B).2 =1;
(*(volatile unsigned char *)0x3B).3 =0;
(*(volatile unsigned char *)0x38)=x;
(*(volatile unsigned char *)0x3B).4 =1;
(*(volatile unsigned char *)0x3B).4 =0;
(*(volatile unsigned char *)0x3B).6 =1;
(*(volatile unsigned char *)0x3B).5 =1;
}
void LCD_Init(void)
{
(*(volatile unsigned char *)0x3B).7 = 1;
(*(volatile unsigned char *)0x3B).7 = 0;
Delay(200);
(*(volatile unsigned char *)0x3B).7 = 1;
LCD_Write_ComL(0x3e);
LCD_Write_ComR(0x3e);
LCD_Write_ComL(0x3f);
LCD_Write_ComR(0x3f);
LCD_Write_ComL(0xc0);
LCD_Write_ComR(0xc0);
}
void LCD_Clr(void)
{
unsigned char i,j;
for(j=0;j<8;j++)
{
LCD_Write_ComL(0xb8|j);
LCD_Write_ComL(0x40);
LCD_Write_ComR(0xb8|j);
LCD_Write_ComR(0x40);
for(i=0;i<64;i++)
{
LCD_Write_DatL(0x00);
LCD_Write_DatR(0x00);
}
}
}
void CCW_PR(unsigned int neima,unsigned char X,unsigned char Y,unsigned char fan)
{
unsigned char k,com,dat1,hz;
unsigned int i;
Y=Y|0xb8;
LCD_Write_ComL(Y);
LCD_Write_ComR(Y);
if(neima< 0x0000 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16)
hz=8;
else
hz=0;
if(X<0x40)
{
com=X+0x40;
LCD_Write_ComL(com);
k='L';
}
else
{
com=X;
LCD_Write_ComR(X);
}
com=com&0x3f;
for(i=neima;i<(16+neima-hz);i++)
{
dat1=hzdot[i];
if(fan)
dat1=~dat1;
if(k=='L')
{
LCD_Write_DatL(dat1);
}
else
{
LCD_Write_DatR(dat1);
}
com++;
if(com==0x40)
{
LCD_Write_ComR(com);
k='R';
}
}
Y++;
LCD_Write_ComL(Y);
LCD_Write_ComR(Y);
if(X<0x40)
{
com=X|0x40;
LCD_Write_ComL(com);
k='L';
}
else
{
com=X;
LCD_Write_ComR(X);
}
com=com&0x3f;
for(i=(16+neima-hz);i<(32+neima-hz-hz);i++)
{
dat1=hzdot[i];
if(fan)
dat1=~dat1;
if(k=='L')
{
LCD_Write_DatL(dat1);
}
else
{
LCD_Write_DatR(dat1);
}
com++;
if(com==0x40)
{
LCD_Write_ComR(com);
k='R';
}
}
}
void logo(void)
{
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32,0x4-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32 +32,0x14-2,0x06,0);
CCW_PR(0x0000,0x28-2,0x06,0);
CCW_PR(0x0000 +16,0x30-2,0x06,0);
CCW_PR(0x0000 +16 +16,0x38-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16,0x40-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16,0x48-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16,0x50-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16,0x58-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16 +16,0x60-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16 +16 +16,0x68-2,0x06,0);
CCW_PR(0x0000 +16 +16 +16 +16 +16 +16 +16 +16 +16,0x70-2,0x06,0);
}
interrupt [EXT_INT0] void ext_int0_isr(void)
{
if((*(volatile unsigned char *)0x30) & (1<< 3))
Count++;
else
Count--;
}
void main(void)
{
unsigned int i;
unsigned char Key;
(*(volatile unsigned char *)0x37)=0xff;
(*(volatile unsigned char *)0x38)=0x00;
(*(volatile unsigned char *)0x3A)=0xff;
(*(volatile unsigned char *)0x34) = 0xff;
(*(volatile unsigned char *)0x35) = 0x00;
(*(volatile unsigned char *)0x32)=0x2C;
(*(volatile unsigned char *)0x31)=0xD3;
(*(volatile unsigned char *)0x5B)|=0x40;
(*(volatile unsigned char *)0x55)=0x03;
(*(volatile unsigned char *)0x54)=0x00;
(*(volatile unsigned char *)0x5A)=0x40;
Rst7279();
#asm("wdr");
#asm("SEI");
LCD_Init();
LCD_Clr();
(*(volatile unsigned char *)0x32).6 = 0;
(*(volatile unsigned char *)0x32).7 = 1;
(*(volatile unsigned char *)0x35).0 = 0;
(*(volatile unsigned char *)0x35).1 = 1;
(*(volatile unsigned char *)0x3B).0 = 1;
(*(volatile unsigned char *)0x3B).1 = 1;
logo();
Delay(200);
Delay(200);
while(1)
{
Key = Read7279();
if(Key != 0xff)
Count = Key;
LCDInfoBuf[0]=(Count/10000)%10;
LCDInfoBuf[1]=(Count/1000)%10;
LCDInfoBuf[2]=(Count/100)%10;
LCDInfoBuf[3]=(Count/10)%10;
LCDInfoBuf[4]=(Count)%10;
for (i=0;i<7;i++)
{
CCW_PR(LCDInfoBuf[i]*16,LCDInfo[i].X,LCDInfo[i].Y,0);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -