微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > IIC OLED驱动

IIC OLED驱动

时间:11-11 来源:互联网 点击:
  1. /*
  2. 文 件 名 : oled.c
  3. 版 本 号 : v1.0
  4. 最近修改 :
  5. 功能描述 : LED128x64OLED显示屏底层驱动
  6. 修改历史 :
  7. ******************************************************************************/
  8. /*----------------------------------------------------------------------------*
  9. * 包含头文件 *
  10. *----------------------------------------------------------------------------*/
  11. #include
  12. #include"oled.h"
  13. /*----------------------------------------------------------------------------*
  14. * 宏定义 *
  15. *----------------------------------------------------------------------------*/
  16. /*----------------------------------------------------------------------------*
  17. * 全局变量 *
  18. *----------------------------------------------------------------------------*/
  19. sbit LED_SCL=P1^0;
  20. sbit LED_SDA=P1^1;
  21. sbit LED_RST=P1^2;
  22. sbit LED_DC=P1^3;
  23. constUCHAR8 code F6x8[][6]=
  24. {
  25. {0x00,0x00,0x00,0x00,0x00,0x00},//sp0
  26. {0x00,0x00,0x00,0x2f,0x00,0x00},// !1
  27. {0x00,0x00,0x07,0x00,0x07,0x00},// "2
  28. {0x00,0x14,0x7f,0x14,0x7f,0x14},// #3
  29. {0x00,0x24,0x2a,0x7f,0x2a,0x12},// $4
  30. {0x00,0x62,0x64,0x08,0x13,0x23},// %5
  31. {0x00,0x36,0x49,0x55,0x22,0x50},// &6
  32. {0x00,0x00,0x05,0x03,0x00,0x00},// 7
  33. {0x00,0x00,0x1c,0x22,0x41,0x00},// (8
  34. {0x00,0x00,0x41,0x22,0x1c,0x00},// )9
  35. {0x00,0x14,0x08,0x3E,0x08,0x14},// *10
  36. {0x00,0x08,0x08,0x3E,0x08,0x08},// +11
  37. {0x00,0x00,0x00,0xA0,0x60,0x00},// ,12
  38. {0x00,0x08,0x08,0x08,0x08,0x08},// -13
  39. {0x00,0x00,0x60,0x60,0x00,0x00},// .14
  40. {0x00,0x20,0x10,0x08,0x04,0x02},// /15
  41. {0x00,0x3E,0x51,0x49,0x45,0x3E},// 016
  42. {0x00,0x00,0x42,0x7F,0x40,0x00},// 117
  43. {0x00,0x42,0x61,0x51,0x49,0x46},// 218
  44. {0x00,0x21,0x41,0x45,0x4B,0x31},// 319
  45. {0x00,0x18,0x14,0x12,0x7F,0x10},// 420
  46. {0x00,0x27,0x45,0x45,0x45,0x39},// 521
  47. {0x00,0x3C,0x4A,0x49,0x49,0x30},// 622
  48. {0x00,0x01,0x71,0x09,0x05,0x03},// 723
  49. {0x00,0x36,0x49,0x49,0x49,0x36},// 824
  50. {0x00,0x06,0x49,0x49,0x29,0x1E},// 925
  51. {0x00,0x00,0x36,0x36,0x00,0x00},// :26
  52. {0x00,0x00,0x56,0x36,0x00,0x00},// ;27
  53. {0x00,0x08,0x14,0x22,0x41,0x00},// <28
  54. {0x00,0x14,0x14,0x14,0x14,0x14},// =29
  55. {0x00,0x00,0x41,0x22,0x14,0x08},// >30
  56. {0x00,0x02,0x01,0x51,0x09,0x06},// ?31
  57. {0x00,0x32,0x49,0x59,0x51,0x3E},// @32
  58. {0x00,0x7C,0x12,0x11,0x12,0x7C},// A33
  59. {0x00,0x7F,0x49,0x49,0x49,0x36},// B34
  60. {0x00,0x3E,0x41,0x41,0x41,0x22},// C35
  61. {0x00,0x7F,0x41,0x41,0x22,0x1C},// D36
  62. {0x00,0x7F,0x49,0x49,0x49,0x41},// E37
  63. {0x00,0x7F,0x09,0x09,0x09,0x01},// F38
  64. {0x00,0x3E,0x41,0x49,0x49,0x7A},// G39
  65. {0x00,0x7F,0x08,0x08,0x08,0x7F},// H40
  66. {0x00,0x00,0x41,0x7F,0x41,0x00},// I41
  67. {0x00,0x20,0x40,0x41,0x3F,0x01},// J42
  68. {0x00,0x7F,0x08,0x14,0x22,0x41},// K43
  69. {0x00,0x7F,0x40,0x40,0x40,0x40},// L44
  70. {0x00,0x7F,0x02,0x0C,0x02,0x7F},// M45
  71. {0x00,0x7F,0x04,0x08,0x10,0x7F},// N46
  72. {0x00,0x3E,0x41,0x41,0x41,0x3E},// O47
  73. {0x00,0x7F,0x09,0x09,0x09,0x06},// P48
  74. {0x00,0x3E,0x41,0x51,0x21,0x5E},// Q49
  75. {0x00,0x7F,0x09,0x19,0x29,0x46},// R50
  76. {0x00,0x46,0x49,0x49,0x49,0x31},// S51
  77. {0x00,0x01,0x01,0x7F,0x01,0x01},// T52
  78. {0x00,0x3F,0x40,0x40,0x40,0x3F},// U53
  79. {0x00,0x1F,0x20,0x40,0x20,0x1F},// V54
  80. {0x00,0x3F,0x40,0x38,0x40,0x3F},// W55
  81. {0x00,0x63,0x14,0x08,0x14,0x63},// X56
  82. {0x00,0x07,0x08,0x70,0x08,0x07},// Y57
  83. {0x00,0x61,0x51,0x49,0x45,0x43},// Z58
  84. {0x00,0x00,0x7F,0x41,0x41,0x00},// [59
  85. {0x00,0x02,0x04,0x08,0x10,0x20},// \60
  86. {0x00,0x00,0x41,0x41,0x7F,0x00},// ]61
  87. {0x00,0x04,0x02,0x01,0x02,0x04},// ^62
  88. {0x00,0x40,0x40,0x40,0x40,0x40},// _63
  89. {0x00,0x00,0x01,0x02,0x04,0x00},// 64
  90. {0x00,0x20,0x54,0x54,0x54,0x78},// a65
  91. {0x00,0x7F,0x48,0x44,0x44,0x38},// b66
  92. {0x00,0x38,0x44,0x44,0x44,0x20},// c67
  93. {0x00,0x38,0x44,0x44,0x48,0x7F},// d68
  94. {0x00,0x38,0x54,0x54,0x54,0x18},// e69
  95. {0x00,0x08,0x7E,0x09,0x01,0x02},// f70
  96. {0x00,0x18,0xA4,0xA4,0xA4,0x7C},// g71
  97. {0x00,0x7F,0x08,0x04,0x04,0x78},// h72
  98. {0x00,0x00,0x44,0x7D,0x40,0x

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top