查看: 6888|回复: 9

STM32F0 #21项目进程帖(三)---TFT液晶屏驱动显示的程序代码

[复制链接]
  • TA的每日心情
    开心
    2013-1-30 16:51
  • 签到天数: 15 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    发表于 2012-11-18 19:57:23 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 小鸟愤怒 于 2012-11-18 20:13 编辑

    TFT液晶屏驱动代码:
    main.c的代码如下:
    1. #include "stm32f0xx.h"
    2. #include "delay.h"
    3. #include "device_init.h"
    4. #include "LCD12864.h"
    5. unsigned char image[3200]={
    6. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    7. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X7D,0XEF,
    8. 0XBA,0XD6,0XB6,0XB5,0XF3,0X9C,0XB2,0X94,0XB3,0X9C,0XB2,0X94,0X34,0XA5,0XF7,0XBD,
    9. 0XFB,0XDE,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    10. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    11. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    12. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFB,0XDE,0XF3,0X9C,0XCB,0X5A,
    13. 0XC7,0X39,0X04,0X21,0X82,0X10,0X42,0X10,0X42,0X10,0X41,0X08,0X83,0X18,0X45,0X29,
    14. 0XC7,0X39,0X0C,0X63,0X75,0XAD,0X3C,0XE7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    15. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    16. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    17. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X3C,0XE7,0XB2,0X94,0X08,0X42,0XC3,0X18,0X82,0X10,
    18. 0X04,0X21,0X45,0X29,0X86,0X31,0X86,0X31,0X86,0X31,0X86,0X31,0X45,0X29,0X04,0X21,
    19. 0X82,0X10,0X41,0X08,0XC3,0X18,0X08,0X42,0XF3,0X9C,0X3C,0XE7,0XFF,0XFF,0XFF,0XFF,
    20. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    21. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    22. 0XFF,0XFF,0XFF,0XFF,0XFB,0XDE,0X0C,0X63,0XC3,0X18,0XC3,0X18,0X45,0X29,0XC7,0X39,
    23. 0X08,0X42,0X08,0X42,0X08,0X42,0X08,0X42,0X08,0X42,0X08,0X42,0XC7,0X39,0XC7,0X39,
    24. 0X86,0X31,0X86,0X31,0X04,0X21,0X41,0X08,0X82,0X10,0XCB,0X5A,0XBA,0XD6,0XFF,0XFF,
    25. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    26. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    27. 0XFF,0XFF,0XFB,0XDE,0XCB,0X5A,0X82,0X10,0X45,0X29,0XC7,0X39,0X08,0X42,0X08,0X42,
    28. 0X09,0X4A,0X49,0X4A,0X49,0X4A,0X49,0X4A,0X49,0X4A,0X49,0X4A,0X08,0X42,0XC7,0X39,
    29. 0XC7,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0X83,0X18,0X00,0X00,0XC8,0X41,0X38,0XC6,
    30. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    31. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    32. 0X7D,0XEF,0X8E,0X73,0X82,0X10,0X45,0X29,0XC7,0X39,0X08,0X42,0X09,0X4A,0X8A,0X52,
    33. 0X30,0X84,0XCF,0X7B,0X8A,0X52,0X49,0X4A,0X4A,0X52,0X49,0X4A,0XCB,0X5A,0XCF,0X7B,
    34. 0X0C,0X63,0X08,0X42,0XC7,0X39,0X86,0X31,0X45,0X29,0XC3,0X18,0X00,0X00,0X49,0X4A,
    35. 0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    36. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    37. 0XF3,0X9C,0XC3,0X18,0X04,0X21,0XC7,0X39,0X08,0X42,0X49,0X4A,0X49,0X4A,0X72,0X94,
    38. 0X7D,0XEF,0X7D,0XEF,0XB2,0X94,0X4A,0X52,0X49,0X4A,0X8A,0X52,0X75,0XAD,0XBE,0XF7,
    39. 0XBA,0XD6,0X4D,0X6B,0XC7,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0XC3,0X18,0X41,0X08,
    40. 0XCF,0X7B,0X7C,0XE7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    41. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBA,0XD6,
    42. 0X08,0X42,0X82,0X10,0XC7,0X39,0X08,0X42,0X49,0X4A,0X49,0X4A,0X8E,0X73,0XFB,0XDE,
    43. 0XFF,0XFF,0XBE,0XF7,0XBA,0XD6,0X8E,0X73,0X08,0X42,0X30,0X84,0X3C,0XE7,0X7D,0XEF,
    44. 0XFF,0XFF,0XB6,0XB5,0X49,0X4A,0XC7,0X39,0X86,0X31,0X45,0X29,0X04,0X21,0X41,0X08,
    45. 0X45,0X29,0XB6,0XB5,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    46. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X71,0X8C,
    47. 0X41,0X08,0X45,0X29,0X08,0X42,0X49,0X4A,0X49,0X4A,0X4A,0X52,0XB2,0X94,0XBE,0XF7,
    48. 0XBE,0XF7,0XB2,0X94,0XCF,0X7B,0XCF,0X7B,0X49,0X4A,0XB6,0XB5,0XF3,0X9C,0X0C,0X63,
    49. 0X38,0XC6,0XBA,0XD6,0X0C,0X63,0X87,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0XC3,0X18,
    50. 0X41,0X08,0X30,0X84,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    51. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X3C,0XE7,0XCB,0X5A,
    52. 0X41,0X08,0XC7,0X39,0X08,0X42,0X49,0X4A,0X4A,0X52,0X8A,0X52,0XF3,0X9C,0XFF,0XFF,
    53. 0X7D,0XEF,0XC7,0X39,0XC3,0X18,0X0C,0X63,0XCB,0X5A,0XB6,0XB5,0XB2,0X94,0XCB,0X5A,
    54. 0X75,0XAD,0XFA,0XD6,0X4D,0X6B,0X87,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0X04,0X21,
    55. 0X41,0X08,0X8A,0X52,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    56. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X38,0XC6,0X86,0X31,
    57. 0X04,0X21,0XC8,0X41,0X49,0X4A,0X49,0X4A,0X4A,0X52,0X49,0X4A,0XB1,0X8C,0XBE,0XF7,
    58. 0XBE,0XF7,0XB2,0X94,0XCF,0X7B,0XCF,0X7B,0X49,0X4A,0X74,0XA5,0X7D,0XEF,0X7C,0XE7,
    59. 0XBE,0XF7,0X79,0XCE,0X0C,0X63,0XC7,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0X04,0X21,
    60. 0X82,0X10,0X45,0X29,0X75,0XAD,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    61. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X34,0XA5,0X82,0X10,
    62. 0X86,0X31,0X08,0X42,0X49,0X4A,0X49,0X4A,0X8A,0X52,0X49,0X4A,0X4D,0X6B,0XBA,0XD6,
    63. 0XFF,0XFF,0XFF,0XFF,0X79,0XCE,0X0D,0X63,0XC7,0X39,0XCF,0X7B,0X7D,0XEF,0XFF,0XFF,
    64. 0XFF,0XFF,0X75,0XAD,0X08,0X42,0X86,0X31,0XC7,0X39,0X86,0X31,0X45,0X29,0X45,0X29,
    65. 0XC3,0X18,0XC3,0X18,0XB2,0X94,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    66. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XB2,0X8C,0X41,0X08,
    67. 0XC7,0X39,0X08,0X42,0X49,0X4A,0X49,0X4A,0X8A,0X52,0X8A,0X52,0X4A,0X4A,0XD0,0X7B,
    68. 0X7A,0XC6,0X7B,0XBE,0X90,0X6B,0XC9,0X39,0X88,0X31,0XC9,0X39,0XB3,0X84,0XBB,0XC6,
    69. 0XF8,0XB5,0XCC,0X5A,0X86,0X31,0XC7,0X39,0XC7,0X39,0X86,0X31,0X45,0X29,0X45,0X29,
    70. 0XC4,0X20,0X41,0X08,0X30,0X84,0X3C,0XE7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    71. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X3C,0XE7,0X8A,0X4A,0XC3,0X10,
    72. 0XC7,0X39,0X08,0X42,0X49,0X4A,0X49,0X4A,0X4A,0X4A,0X4A,0X42,0X09,0X3A,0X08,0X4A,
    73. 0X09,0X6B,0X49,0X7B,0XC6,0X7A,0X05,0X83,0X46,0X83,0XC5,0X7A,0XC6,0X72,0X09,0X7B,
    74. 0X48,0X5A,0X87,0X31,0X88,0X21,0X88,0X29,0X86,0X31,0X86,0X31,0X45,0X29,0X45,0X29,
    75. 0X04,0X21,0X41,0X08,0X4A,0X4A,0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    76. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XC5,0X82,0X50,0X05,0X41,
    77. 0XC7,0X29,0X08,0X42,0X49,0X4A,0X4A,0X42,0X49,0X4A,0X09,0X7B,0X88,0X9B,0XC6,0XB3,
    78. 0X21,0XD4,0XA0,0XDC,0XE1,0XE4,0X61,0XED,0X61,0XED,0X21,0XED,0XA0,0XE4,0X20,0XDC,
    79. 0X80,0XCB,0X43,0XAB,0XC4,0X82,0X06,0X5A,0X47,0X21,0X46,0X29,0X45,0X29,0X04,0X29,
    80. 0X04,0X19,0X82,0X10,0X82,0X18,0XF3,0X9C,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    81. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0X4D,0X93,0X00,0XA0,0X82,0XB8,
    82. 0XC7,0X31,0X09,0X32,0X49,0X4A,0X86,0X7A,0X43,0XC3,0X6B,0XED,0XF4,0XF6,0XEB,0XFD,
    83. 0X20,0XFD,0X20,0XFD,0X60,0XFD,0XA0,0XFD,0XA0,0XFD,0X60,0XFD,0X60,0XFD,0X20,0XFD,
    84. 0XE0,0XFC,0XA0,0XFC,0X60,0XF4,0XC1,0XDB,0X83,0X9A,0XC5,0X49,0X45,0X29,0X04,0X19,
    85. 0XC4,0X20,0X82,0X38,0X00,0X50,0XCB,0X6A,0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    86. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFB,0XEE,0X04,0XA1,0X00,0XC0,0X00,0XF0,
    87. 0XC3,0XA0,0XC8,0X41,0X49,0X42,0X05,0X9B,0X20,0XFC,0XA4,0XFC,0X69,0XFD,0XE8,0XFD,
    88. 0X63,0XFD,0X20,0XFD,0X60,0XFD,0X60,0XFD,0X60,0XFD,0X20,0XFD,0X20,0XFD,0XE0,0XFC,
    89. 0XE0,0XFC,0XA0,0XFC,0X60,0XFC,0X20,0XFC,0X41,0XD3,0XC5,0X49,0X45,0X19,0XC4,0X38,
    90. 0X82,0X68,0X41,0X88,0X00,0X70,0X49,0X5A,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    91. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFB,0XF6,0X82,0XC0,0X00,0XD0,0X86,0XC1,
    92. 0X46,0XF1,0X41,0XC8,0X45,0X79,0X89,0X52,0X88,0X62,0X86,0X6A,0XC6,0X7A,0XC4,0XBB,
    93. 0XE1,0XFC,0X60,0XFD,0X60,0XFD,0XA0,0XFD,0XA0,0XFD,0X60,0XFD,0X60,0XFD,0XE0,0XFC,
    94. 0X60,0XE4,0X03,0X93,0X84,0X72,0X44,0X6A,0XC5,0X41,0X45,0X29,0XC3,0X58,0X41,0XA8,
    95. 0X40,0X98,0X00,0XB0,0X00,0X60,0X0C,0X6B,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    96. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0XCE,0X83,0X82,0X88,0X00,0XF8,0XC4,0XD8,
    97. 0X0C,0XF3,0X8A,0XFA,0X82,0XE8,0X82,0XB0,0X45,0X69,0XC7,0X51,0X08,0X42,0X08,0X3A,
    98. 0X86,0X5A,0X83,0X9B,0XA2,0XBC,0X22,0XCD,0X21,0XCD,0XA1,0XC4,0X22,0XB4,0XC4,0X7A,
    99. 0X06,0X3A,0X86,0X29,0X45,0X29,0X05,0X31,0XC4,0X50,0X41,0X90,0X00,0XC0,0X00,0XA8,
    100. 0X00,0XA0,0X00,0XA8,0X00,0X30,0X4A,0X4A,0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    101. 0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0X8E,0X73,0XC3,0X18,0X05,0X39,0X82,0XA8,0X00,0XF8,
    102. 0XC3,0XF8,0X4D,0XFB,0X4D,0XFB,0XC7,0XF9,0XC3,0XF0,0X82,0XD8,0XC3,0XB0,0X04,0X81,
    103. 0X45,0X61,0X46,0X51,0X86,0X49,0X86,0X49,0X46,0X41,0X45,0X41,0X45,0X41,0X45,0X41,
    104. 0X05,0X49,0X04,0X61,0X82,0X90,0X41,0XB0,0X00,0XD0,0X00,0XC8,0X00,0XA8,0X00,0XA8,
    105. 0X00,0XB8,0X41,0X58,0X82,0X10,0X82,0X10,0XB2,0X94,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,
    106. 0XFF,0XFF,0XBE,0XF7,0XCF,0X7B,0X82,0X10,0X04,0X21,0X86,0X29,0X86,0X41,0X04,0X99,
    107. 0X40,0XE8,0X41,0XF8,0X86,0XF9,0XCB,0XFA,0X49,0XFA,0X82,0XF8,0X00,0XF8,0X00,0XF0,
    108. 0X00,0XE8,0X41,0XD8,0X41,0XD0,0X41,0XC0,0X41,0XC0,0X41,0XC0,0X41,0XC0,0X41,0XC8,
    109. 0X00,0XD0,0X00,0XE0,0X00,0XE0,0X00,0XD8,0X00,0XD0,0X00,0XB8,0X00,0XA8,0X41,0X88,
    110. 0X82,0X48,0X82,0X10,0X82,0X10,0X00,0X00,0X45,0X29,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,
    111. 0XBE,0XF7,0XF3,0X9C,0X82,0X10,0XC3,0X18,0X45,0X29,0X86,0X31,0XC7,0X31,0X30,0X7C,
    112. 0XF3,0XDC,0X86,0XE1,0X00,0XF0,0X00,0XF8,0X41,0XF8,0X41,0XF8,0X00,0XF8,0X00,0XF8,
    113. 0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,
    114. 0X00,0XE8,0X00,0XE0,0X00,0XE0,0X00,0XD8,0X00,0XC8,0X41,0XA0,0X8A,0X9A,0X0C,0X63,
    115. 0X04,0X11,0X82,0X10,0X82,0X10,0X41,0X08,0X00,0X00,0X4D,0X6B,0X7D,0XEF,0XFF,0XFF,
    116. 0XFB,0XDE,0X08,0X42,0X42,0X10,0X45,0X29,0X86,0X31,0X86,0X31,0X49,0X4A,0X38,0XBE,
    117. 0XFF,0XFF,0X38,0XD6,0X86,0XA9,0X00,0XC8,0X00,0XE0,0X00,0XF0,0X00,0XF8,0X00,0XF8,
    118. 0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF0,0X00,0XF0,
    119. 0X00,0XE8,0X00,0XE0,0X00,0XD0,0XC3,0X98,0X8A,0X8A,0XB2,0XA4,0XBA,0XC6,0XF7,0XB5,
    120. 0X08,0X42,0X41,0X08,0X82,0X10,0X41,0X08,0X00,0X00,0X45,0X29,0XF7,0XBD,0XFF,0XFF,
    121. 0X71,0X8C,0X41,0X08,0X04,0X21,0X45,0X29,0X86,0X31,0X86,0X31,0X0C,0X63,0X3C,0XE7,
    122. 0XFF,0XFF,0X79,0XD6,0X46,0XB9,0X00,0XE0,0X42,0XC8,0X82,0XA8,0X82,0XB0,0X41,0XD8,
    123. 0X82,0XE8,0X82,0XF0,0X41,0XE8,0X41,0XE8,0X41,0XE8,0X41,0XF0,0X41,0XE8,0X41,0XD8,
    124. 0X04,0XC1,0X08,0X92,0X4D,0X8B,0X34,0XA5,0XFB,0XC6,0XFB,0XD6,0XBA,0XCE,0X3C,0XE7,
    125. 0X30,0X84,0XC3,0X18,0X41,0X08,0X41,0X08,0X00,0X00,0X41,0X08,0XCF,0X7B,0X7D,0XEF,
    126. 0X49,0X4A,0X00,0X00,0X04,0X21,0X45,0X29,0X46,0X31,0X86,0X31,0X30,0X84,0XFF,0XFF,
    127. 0XFF,0XF7,0XF7,0XDD,0X09,0XDA,0X83,0XF8,0X01,0XF0,0X42,0XC0,0X82,0X98,0X49,0X9A,
    128. 0XF3,0XB4,0XF3,0XCC,0X71,0XBC,0X8E,0XBB,0X8E,0XBB,0X30,0XBC,0X71,0XBC,0XF3,0XBC,
    129. 0XB6,0XBD,0XFB,0XCE,0XBE,0XE7,0X7D,0XE7,0X3B,0XDF,0XBA,0XD6,0X79,0XCE,0XFB,0XDE,
    130. 0X75,0XAD,0X86,0X31,0X41,0X08,0X41,0X08,0X00,0X00,0X00,0X00,0X49,0X4A,0XFB,0XDE,
    131. 0X04,0X21,0X41,0X08,0X04,0X21,0X45,0X29,0X45,0X29,0X87,0X39,0XB2,0X94,0XFF,0XFF,
    132. 0XBE,0XF7,0X34,0XDD,0X0C,0XEB,0X09,0XFA,0X00,0XF0,0X01,0XD8,0X00,0XD8,0X8B,0XD2,
    133. 0X7D,0XE7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    134. 0XFF,0XFF,0XBE,0XFF,0X7D,0XEF,0XFB,0XDE,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0XBA,0XD6,
    135. 0X78,0XC6,0XC7,0X39,0X00,0X00,0X41,0X08,0X00,0X00,0X00,0X00,0XC7,0X39,0X79,0XCE,
    136. 0X00,0X00,0X82,0X10,0XC3,0X18,0X04,0X21,0X05,0X29,0X86,0X31,0XB3,0X9C,0XFF,0XFF,
    137. 0XFF,0XF7,0X75,0XDD,0XC7,0XE9,0XC7,0XF9,0X01,0XF8,0X01,0XF0,0X00,0XE8,0X49,0XE2,
    138. 0XFB,0XEE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    139. 0XFF,0XFF,0XBE,0XF7,0X7D,0XEF,0XFB,0XDE,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0XBA,0XD6,
    140. 0XB9,0XCE,0X08,0X42,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC7,0X39,0X38,0XC6,
    141. 0X00,0X00,0X82,0X10,0X82,0X10,0X04,0X21,0X04,0X21,0X45,0X29,0X30,0X84,0XFF,0XFF,
    142. 0XFF,0XFF,0X38,0XDE,0XC4,0XD0,0X00,0XF0,0X01,0XF8,0X00,0XF8,0X00,0XF0,0X08,0XD2,
    143. 0XFB,0XE6,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    144. 0XFF,0XFF,0XBE,0XF7,0X7D,0XEF,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0X79,0XCE,0XBA,0XD6,
    145. 0X79,0XCE,0XC7,0X39,0X41,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X86,0X31,0X38,0XC6,
    146. 0X00,0X00,0X00,0X00,0XC3,0X18,0XCB,0X5A,0X86,0X31,0XC3,0X18,0XCB,0X5A,0X7D,0XEF,
    147. 0XFF,0XFF,0X7D,0XEF,0XCF,0XBB,0XC3,0XB0,0X41,0XD0,0X41,0XD0,0X82,0XB8,0X4D,0XB3,
    148. 0X7D,0XE7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    149. 0XBE,0XF7,0XBE,0XF7,0X3D,0XEF,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0X79,0XCE,0XFA,0XD6,
    150. 0XF7,0XBD,0X04,0X21,0X86,0X31,0X04,0X21,0X00,0X00,0X00,0X00,0X86,0X31,0X38,0XC6,
    151. 0X86,0X31,0XC3,0X18,0XCB,0X5A,0X75,0XAD,0XCF,0X7B,0X41,0X08,0X86,0X31,0XF7,0XBD,
    152. 0XFF,0XFF,0XFF,0XFF,0XBE,0XEF,0X74,0XB5,0X30,0X9C,0X30,0X9C,0X72,0XA4,0XBB,0XD6,
    153. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    154. 0XBE,0XF7,0X7D,0XEF,0X3C,0XE7,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0X79,0XCE,0X3C,0XE7,
    155. 0X71,0X8C,0X81,0X08,0X0C,0X63,0XCF,0X7B,0X82,0X10,0X00,0X00,0X8A,0X52,0X38,0XC6,
    156. 0X75,0XAD,0X71,0X8C,0XB6,0XB5,0X3C,0XE7,0XFB,0XDE,0XC7,0X39,0X00,0X00,0XCF,0X73,
    157. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    158. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,
    159. 0X7D,0XEF,0X7D,0XEF,0X3B,0XDF,0XFA,0XD6,0X79,0XCE,0X79,0XCE,0XFB,0XDE,0XB9,0XCE,
    160. 0XC7,0X39,0XC4,0X20,0X71,0X8C,0XBA,0XD6,0X71,0X8C,0XCB,0X5A,0XB2,0X94,0XBA,0XD6,
    161. 0XFF,0XFF,0X7D,0XEF,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XB6,0XB5,0X46,0X29,0X05,0X19,
    162. 0X75,0XA5,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    163. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,
    164. 0X7D,0XEF,0X3C,0XE7,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0XBA,0XD6,0XFC,0XDE,0X4E,0X63,
    165. 0X42,0X08,0X0C,0X63,0XF7,0XBD,0XBE,0XF7,0XFF,0XFF,0XFB,0XDE,0XFB,0XDE,0XBE,0XF7,
    166. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF4,0X9C,0X04,0X21,
    167. 0X05,0X21,0XB6,0XA5,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    168. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XBE,0XF7,0X7D,0XEF,
    169. 0X3C,0XE7,0XFB,0XDE,0XBA,0XD6,0X79,0XCE,0XFB,0XDE,0XBB,0XD6,0XD1,0X73,0X83,0X18,
    170. 0X86,0X39,0X34,0X9D,0XBD,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    171. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XFF,0X35,0XD6,0XEB,0XCC,0X43,0XB3,
    172. 0X40,0X51,0X05,0X19,0XF5,0X8C,0XBE,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    173. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XBE,0XF7,0X7D,0XEF,0X7D,0XEF,0X3C,0XE7,
    174. 0XFB,0XDE,0XBA,0XDE,0XBA,0XD6,0X3C,0XDF,0X3A,0XBE,0X4F,0X63,0X82,0X49,0X40,0XA3,
    175. 0X23,0XB4,0XCC,0X83,0X3A,0XBE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    176. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XF7,0XB5,0XBD,0X82,0X92,0X20,0XF4,0XA0,0XFC,
    177. 0X60,0XE4,0X40,0X82,0X84,0X41,0X8F,0X6B,0X77,0XAD,0X3D,0XE7,0XFF,0XFF,0XFF,0XFF,
    178. 0XFE,0XFF,0XBE,0XF7,0XBE,0XF7,0XBE,0XF7,0X7D,0XEF,0X7D,0XEF,0X3C,0XE7,0XFB,0XDE,
    179. 0XFB,0XDE,0X3D,0XE7,0XBB,0XCE,0X36,0X9D,0X0B,0X6B,0X41,0X6A,0X60,0XC4,0X20,0XFE,
    180. 0X60,0XF5,0X00,0X8B,0XC7,0X6A,0X38,0XC6,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    181. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0X4B,0X7B,0X80,0XB2,0XA0,0XFC,0XA0,0XFC,
    182. 0XE0,0XFC,0XE0,0XFC,0XC0,0XCB,0XC1,0X8A,0X45,0X62,0X4D,0X6B,0XB3,0X94,0XF7,0XBD,
    183. 0X3D,0XDF,0XFF,0XF7,0XFF,0XFF,0XBE,0XF7,0X7D,0XEF,0X7D,0XEF,0X7D,0XE7,0X3D,0XDF,
    184. 0XBA,0XC6,0X75,0XA5,0X8D,0X7B,0X84,0X7A,0X40,0XB3,0XE0,0XEC,0XE0,0XFD,0XE0,0XFD,
    185. 0X60,0XF5,0X20,0XE5,0XA0,0XD4,0X0A,0X6B,0XFB,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    186. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0XCC,0X93,0X40,0XEB,0X60,0XFC,0XA0,0XFC,
    187. 0XE0,0XFC,0X20,0XFD,0X60,0XFD,0X20,0XF5,0XA0,0XD4,0XC0,0XBB,0X42,0X9B,0X45,0X8B,
    188. 0X6B,0X9C,0XAE,0X9C,0X71,0X8C,0XB3,0X94,0X33,0X9D,0X34,0XA5,0XF2,0XA4,0XF0,0XB4,
    189. 0XCA,0X9B,0X04,0X9B,0X40,0XBB,0X20,0XE4,0X20,0XFD,0XA0,0XFD,0XA0,0XFD,0XE0,0XFD,
    190. 0XE0,0XFD,0XE0,0XFD,0X20,0XC4,0X88,0X5A,0X38,0XBE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    191. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X78,0XD6,0X46,0XAB,0X40,0XDB,0X20,0XF4,
    192. 0X60,0XFC,0XA0,0XFC,0XE0,0XFC,0X60,0XFD,0XA0,0XFD,0X60,0XFD,0X20,0XF5,0XA0,0XDC,
    193. 0XC0,0XB3,0XC0,0X51,0X86,0X29,0X0D,0X63,0X8F,0X7B,0X0D,0X5B,0XC7,0X41,0X01,0X82,
    194. 0X00,0XC3,0XC0,0XE3,0X60,0XFC,0XA0,0XFC,0XE0,0XFC,0XE0,0XFC,0X60,0XF5,0X60,0XF5,
    195. 0X20,0XE5,0X80,0X9B,0X86,0X62,0X30,0X84,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    196. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X38,0XC6,0X2D,0X9C,0X05,0X93,
    197. 0X43,0XA3,0X82,0XB3,0XC2,0XBB,0XC2,0XBB,0X22,0XB4,0X82,0XA3,0X42,0X93,0XC3,0X7A,
    198. 0X85,0X62,0X0B,0X63,0X71,0X84,0XB6,0XB5,0X79,0XCE,0X79,0XC6,0XB5,0XAD,0X70,0X94,
    199. 0X4A,0X8B,0X06,0X83,0X04,0X93,0X04,0X9B,0X43,0X9B,0X43,0X9B,0X43,0X93,0X04,0X83,
    200. 0X08,0X73,0X8D,0X73,0XB3,0X94,0X79,0XCE,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
    201. 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X3C,0XDF,0X38,0XBE,
    202. 0X75,0XB5,0X33,0XA5,0X33,0XA5,0XF3,0X9C,0XF3,0X9C,0XF3,0X9C,0XF3,0X94,0XF3,0X9C,
    203. 0X35,0XA5,0XF8,0XBD,0XFB,0XDE,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7E,0XEF,
    204. 0XBB,0XD6,0XF8,0XBD,0XB6,0XAD,0X75,0XAD,0X34,0XA5,0X33,0X9D,0X34,0X9D,0X35,0XA5,
    205. 0XB7,0XAD,0X79,0XC6,0X3C,0XE7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};
    206. int main(void)
    207. {
    208. int i,j,k;
    209. Device_Init();
    210. main_init();

    211. //while(1)
    212. //{
    213.   //Pant(0xf800); //红色
    214. //Pant(0X07E0); //绿色
    215. //Pant(0x001f); //蓝色  
    216. Pant(0xffff); //清屏
    217.   for(k=0;k<8;k++)
    218. {
    219.      for(j=0;j<6;j++)
    220.   {
    221.    Address_set(40*j,40*k,40*j+39,40*k+39);  //坐标设置
    222.       for(i=0;i<1600;i++)
    223.     {
    224.        Lcd_Write_Color(image[i*2+1],image[i*2]);  //发送颜色数据为提高速度高8位低8位分别传递         
    225.     }
    226.    }
    227.   }
    228.   
    229. //}
    230. }
    231. ------------------------------------------------------------------------------------------------------------------------------
    232. device_init.c的代码如下:
    233. /* Includes ------------------------------------------------------------------*/
    234. #include "device_init.h"  
    235. /* Private variables ---------------------------------------------------------*/
    236. /* Private functions declared ------------------------------------------------*/
    237. void RCC_Initializations(void);    //RCC初始化
    238. void GPIO_Initializations(void);   //GPIO初始化

    239. /* Exported functions ------------------------------------------------------- */
    240. /**
    241.    * @brief  Include all initializations.
    242.    * @param  None
    243.    * @retval None
    244.    */  
    245. void Device_Init(void)
    246. {
    247.   RCC_Initializations();      //时钟设置初始化
    248.   GPIO_Initializations();     //GPIO初始化
    249.   
    250.   delay_init(48);       //延时函数初始化   
    251. }
    252. /* Private functions -------------------------------------------------------- */
    253. void RCC_Initializations(void)
    254. {
    255.   /* GPIOC Periph clock enable */
    256.   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);
    257.   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
    258. }

    259. void GPIO_Initializations(void)
    260. {
    261.   GPIO_InitTypeDef GPIO_InitStructure;
    262.   /* GPIOA Configuration */
    263.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
    264.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;   //output mode
    265.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;    //high speed
    266.   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;  //pushpull mode
    267.   GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;    //
    268.   GPIO_Init(GPIOC, &GPIO_InitStructure);
    269.   GPIO_Init(GPIOA, &GPIO_InitStructure);
    270. }
    271. ------------------------------------------------------------------------------------------------------------------------
    272. device_init.h的代码如下:
    273. /**
    274.   ******************************************************************************
    275.   * @file    device_init.h
    276.   * @author  Kite
    277.   * @version NULL
    278.   * @date    1-November-2012
    279.   * @brief   The devices initialization header file.
    280.   ******************************************************************************
    281.   */
    282. #ifndef __DEVICE_INIT_H
    283. #define __DEVICE_INIT_H
    284. /* Includes ------------------------------------------------------------------*/
    285. #include "stm32f0xx.h"
    286. #include "delay.h"
    287. #include "LCD12864.h"
    288. /* Definitions ---------------------------------------------------------------*/
    289. /* Exported functions declared ---------------------------------------------- */
    290. void Device_Init(void);    //总初始化函数
    291. #endif

    292. ------------------------------------------------------------------------------------------------------------------------------------------
    293. delay.c的代码如下:
    294. #include "delay.h"
    295. //////////////////////////////////////////////////////////////////////////////////  
    296. static uint8_t  fac_us=0;//us延时倍乘数
    297. static uint16_t fac_ms=0;//ms延时倍乘数
    298. //初始化延迟函数
    299. //SYSTICK的时钟固定为HCLK时钟的1/8
    300. //SYSCLK:系统时钟
    301. void delay_init(uint8_t SYSCLK)
    302. {
    303. SysTick->CTRL&=0xfffffffb;//bit2清空,选择外部时钟  HCLK/8
    304. fac_us=SYSCLK/8;      
    305. fac_ms=(uint16_t)fac_us*1000;
    306. }            
    307. //延时nms
    308. //注意nms的范围
    309. //SysTick->LOAD为24位寄存器,所以,最大延时为:
    310. //nms<=0xffffff*8*1000/SYSCLK
    311. //SYSCLK单位为Hz,nms单位为ms
    312. //对72M条件下,nms<=1864
    313. void delay_ms(uint16_t nms)
    314. {         
    315. uint32_t temp;     
    316. SysTick->LOAD=(uint32_t)nms*fac_ms;//时间加载(SysTick->LOAD为24bit)
    317. SysTick->VAL =0x00;           //清空计数器
    318. SysTick->CTRL=0x01 ;          //开始倒数  
    319. do
    320. {
    321.   temp=SysTick->CTRL;
    322. }
    323. while(temp&0x01&&!(temp&(1<<16)));//等待时间到达   
    324. SysTick->CTRL=0x00;       //关闭计数器
    325. SysTick->VAL =0X00;       //清空计数器        
    326. }   
    327. //延时nus
    328. //nus为要延时的us数.                 
    329. void delay_us(uint32_t nus)
    330. {  
    331. uint32_t temp;      
    332. SysTick->LOAD=nus*fac_us; //时间加载      
    333. SysTick->VAL=0x00;        //清空计数器
    334. SysTick->CTRL=0x01 ;      //开始倒数   
    335. do
    336. {
    337.   temp=SysTick->CTRL;
    338. }
    339. while(temp&0x01&&!(temp&(1<<16)));//等待时间到达   
    340. SysTick->CTRL=0x00;       //关闭计数器
    341. SysTick->VAL =0X00;       //清空计数器  
    342. }

    343. -------------------------------------------------------------------------------------------------------------
    344. delay.h的代码如下:
    345. #ifndef __DELAY_H
    346. #define __DELAY_H      
    347. #include "stm32f0xx.h"
    348. //////////////////////////////////////////////////////////////////////////////////
    349. void delay_init(uint8_t SYSCLK);
    350. void delay_ms(uint16_t nms);
    351. void delay_us(uint32_t nus);
    352. #endif

    353. ------------------------------------------------------------------------------------------------------------------------------------
    354. LCD12864.c的代码如下:(这里说明一下,LCD12864是参考版主们的代码,这里谢过了!在他们的基础上改的,不过名字没有改,嘿嘿!所以准确来说应该是TFT_LCD.c)
    355. /**
    356.   ******************************************************************************
    357.   * @file    LCD12864.c
    358.   * @author  Kite
    359.   * @version NULL
    360.   * @date    1-August-2012
    361.   * @brief   The LCD12864 C file.
    362.   ******************************************************************************
    363.   */
    364. /* Includes ------------------------------------------------------------------*/
    365. #include "LCD12864.h"
    366. #include "delay.h"  
    367. /* Private variables ---------------------------------------------------------*/
    368. void Lcd_Write_Com(unsigned int CH);
    369. void Lcd_Write_Color(char hh,char ll);
    370. void Lcd_Write_Data(unsigned int DH);
    371. void Lcd_Write_Com_Data(unsigned int com1,unsigned int dat1);
    372. void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2);
    373. void main_init(void);
    374. void Pant(unsigned int color);

    375. /* Private functions declared ------------------------------------------------*/
    376. /* Exported functions ------------------------------------------------------- */
    377. /**
    378.    * @brief  Initialize the LCD12864.
    379.    * @param  None
    380.    * @retval None
    381.    */

    382. void Lcd_Write_Com(unsigned int CH)  //命令
    383. {
    384.   LCD_RS(0);
    385.   LCD_CS(0);
    386.   GPIO_Write(GPIOA,CH);
    387.   LCD_WR(0);
    388.   LCD_WR(1);
    389.   LCD_CS(1);
    390. }
    391. void Lcd_Write_Color(char hh,char ll)  //发送颜色数据
    392. {
    393.   unsigned int HL,hh_temp,ll_temp;
    394.   hh_temp=hh;
    395.   ll_temp=ll;
    396.   HL=(hh_temp<<8)+ll_temp;
    397.   LCD_RS(1);
    398.   LCD_CS(0);
    399.   GPIO_Write(GPIOA,HL);
    400.   LCD_WR(0);
    401.   LCD_WR(1);
    402.   LCD_CS(1);
    403. }
    404. void Lcd_Write_Data(unsigned int DH)   //发送数据
    405. {
    406.   LCD_RS(1);
    407.   LCD_CS(0);
    408.   GPIO_Write(GPIOA,DH);
    409.   LCD_WR(0);
    410.   LCD_WR(1);
    411.   LCD_CS(1);
    412. }
    413. void Lcd_Write_Com_Data(unsigned int com1,unsigned int dat1)  //命令数据一起发
    414. {
    415.   Lcd_Write_Com(com1);
    416.   Lcd_Write_Data(dat1);
    417. }
    418. void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2)
    419. {
    420. Lcd_Write_Com_Data(0x0044,(x2<<8)+x1);
    421. Lcd_Write_Com_Data(0x0045,y1);
    422. Lcd_Write_Com_Data(0x0046,y2);
    423. Lcd_Write_Com_Data(0x004e,x1);
    424. Lcd_Write_Com_Data(0x004f,y1);
    425.   Lcd_Write_Com(0x0022);           
    426. }
    427. void main_init(void)
    428. {
    429.     LCD_REST(1);
    430.     delay_ms(5);
    431. LCD_REST(0);
    432. delay_ms(10);
    433. LCD_REST(1);
    434. LCD_CS(1);
    435. LCD_RD(1);
    436. LCD_WR(1);
    437. delay_ms(20);
    438.     Lcd_Write_Com_Data(0x0000,0x0001);    delay_ms(1);  //打开晶振
    439.     Lcd_Write_Com_Data(0x0003,0xA8A4);    delay_ms(1);   //0xA8A4
    440.     Lcd_Write_Com_Data(0x000C,0x0000);    delay_ms(1);   
    441.     Lcd_Write_Com_Data(0x000D,0x080C);    delay_ms(1);   
    442.     Lcd_Write_Com_Data(0x000E,0x2B00);    delay_ms(1);   
    443.     Lcd_Write_Com_Data(0x001E,0x00B0);    delay_ms(1);   
    444.     Lcd_Write_Com_Data(0x0001,0x2B3F);    delay_ms(1);   //驱动输出控制320*240  0x6B3F
    445.     Lcd_Write_Com_Data(0x0002,0x0600);    delay_ms(1);
    446.     Lcd_Write_Com_Data(0x0010,0x0000);    delay_ms(1);
    447.     Lcd_Write_Com_Data(0x0011,0x6070);    delay_ms(1);        //0x4030           //定义数据格式  16位色
    448.     Lcd_Write_Com_Data(0x0005,0x0000);    delay_ms(1);
    449.     Lcd_Write_Com_Data(0x0006,0x0000);    delay_ms(1);
    450.     Lcd_Write_Com_Data(0x0016,0xEF1C);    delay_ms(1);
    451.     Lcd_Write_Com_Data(0x0017,0x0003);    delay_ms(1);
    452.     Lcd_Write_Com_Data(0x0007,0x0233);    delay_ms(1);        //0x0233      
    453.     Lcd_Write_Com_Data(0x000B,0x0000);    delay_ms(1);
    454.     Lcd_Write_Com_Data(0x000F,0x0000);    delay_ms(1);        //扫描开始地址
    455.     Lcd_Write_Com_Data(0x0041,0x0000);    delay_ms(1);
    456.     Lcd_Write_Com_Data(0x0042,0x0000);    delay_ms(1);
    457.     Lcd_Write_Com_Data(0x0048,0x0000);    delay_ms(1);
    458.     Lcd_Write_Com_Data(0x0049,0x013F);    delay_ms(1);
    459.     Lcd_Write_Com_Data(0x004A,0x0000);    delay_ms(1);
    460.     Lcd_Write_Com_Data(0x004B,0x0000);    delay_ms(1);
    461.     Lcd_Write_Com_Data(0x0044,0xEF00);    delay_ms(1);
    462.     Lcd_Write_Com_Data(0x0045,0x0000);    delay_ms(1);
    463.     Lcd_Write_Com_Data(0x0046,0x013F);    delay_ms(1);
    464.     Lcd_Write_Com_Data(0x0030,0x0707);    delay_ms(1);
    465.     Lcd_Write_Com_Data(0x0031,0x0204);    delay_ms(1);
    466.     Lcd_Write_Com_Data(0x0032,0x0204);    delay_ms(1);
    467.     Lcd_Write_Com_Data(0x0033,0x0502);    delay_ms(1);
    468.     Lcd_Write_Com_Data(0x0034,0x0507);    delay_ms(1);
    469.     Lcd_Write_Com_Data(0x0035,0x0204);    delay_ms(1);
    470.     Lcd_Write_Com_Data(0x0036,0x0204);    delay_ms(1);
    471.     Lcd_Write_Com_Data(0x0037,0x0502);    delay_ms(1);
    472.     Lcd_Write_Com_Data(0x003A,0x0302);    delay_ms(1);
    473.     Lcd_Write_Com_Data(0x003B,0x0302);    delay_ms(1);
    474.     Lcd_Write_Com_Data(0x0023,0x0000);    delay_ms(1);
    475.     Lcd_Write_Com_Data(0x0024,0x0000);    delay_ms(1);
    476.     Lcd_Write_Com_Data(0x0025,0x8000);    delay_ms(1);
    477.     Lcd_Write_Com_Data(0x004f,0);        //行首址0
    478.     Lcd_Write_Com_Data(0x004e,0);        //列首址0
    479.   Lcd_Write_Com(0x0022);
    480. }
    481. void Pant(unsigned int color)
    482. {
    483. int i,j;
    484. Address_set(0,0,239,319);
    485.     for(i=0;i<320;i++)
    486.   {
    487.    for (j=0;j<240;j++)
    488.      {
    489.          Lcd_Write_Data(color);
    490.      }
    491.    }  
    492. }
    493. -------------------------------------------------------------------------------------------------------------
    494. LCD12864.h的代码如下:(名字同理应为:TFT_LCD.h)
    495. /**
    496.   ******************************************************************************
    497.   * @file    LCD12864.h
    498.   * @author  Kite
    499.   * @version NULL
    500.   * @date    1-August-2012
    501.   * @brief   The LCD12864 header file.
    502.   ******************************************************************************
    503.   */
    504. #ifndef __LCD12864_H
    505. #define __LCD12864_H
    506. /* Includes ------------------------------------------------------------------*/
    507. #include "stm32f0xx.h"
    508. #if !defined u8 && !defined u16 && !defined u32
    509. #define u8  uint8_t
    510. #define u16  uint16_t
    511. #define u32  uint32_t
    512. #endif
    513. /* Definitions ---------------------------------------------------------------*/
    514. //接口输出操作(RS: PC0  RW: PC1  E:PC2)
    515. #define LCD_RS(x)  (x) ? (GPIOC->BSRR |= 1<<0) : (GPIOC->BRR |= 1<<0)
    516. #define LCD_WR(x) (x) ? (GPIOC->BSRR |= 1<<1) : (GPIOC->BRR |= 1<<1)
    517. #define LCD_RD(x) (x) ? (GPIOC->BSRR |= 1<<2) : (GPIOC->BRR |= 1<<2)
    518. #define LCD_CS(x) (x) ? (GPIOC->BSRR |= 1<<3) : (GPIOC->BRR |= 1<<3)
    519. #define LCD_REST(x) (x) ? (GPIOC->BSRR |= 1<<4) : (GPIOC->BRR |= 1<<4)
    520. /* Write command or dat select */
    521. /* Exported functions declared ---------------------------------------------- */
    522. void Lcd_Write_Com(unsigned int CH);
    523. void Lcd_Write_Color(char hh,char ll);
    524. void Lcd_Write_Data(unsigned int DH);
    525. void Lcd_Write_Com_Data(unsigned int com1,unsigned int dat1);
    526. void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2);
    527. void main_init(void);
    528. void Pant(unsigned int color);
    529. #endif
    530. --------------------------------------------------------------------------------------------------------------
    复制代码
    大家如若不嫌麻烦,就下载工程原代码看看吧!
    由于时间有限,代码管理的有些粗糙,命名也不太规范,不过代码质量还是有保障的,嘿嘿!见笑了!!!
    STM32F0工程TFT液晶屏.rar (1.34 MB, 下载次数: 164)
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-11-4 19:13
  • 签到天数: 281 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2012-11-18 20:22:44 | 显示全部楼层
    编辑一下
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2018-8-29 20:40
  • 签到天数: 1341 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2012-11-18 23:37:55 | 显示全部楼层
    图像文件时怎么生成的啊?
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2016-6-12 21:59
  • 签到天数: 647 天

    连续签到: 1 天

    [LV.9]以坛为家II

    发表于 2012-11-19 00:09:59 | 显示全部楼层
    12864接口的彩屏,前天看到买这个彩屏的这个淘宝店了
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2013-1-30 16:51
  • 签到天数: 15 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    发表于 2012-11-19 13:10:30 | 显示全部楼层
    powerdruy 发表于 2012-11-19 10:12
    imagetolcd这个软件,玩液晶的都有

    省得大家麻烦,我这有一破解版的,我把它放在了进程帖的下面,链接地址:
    https://www.cirmall.com/bbs/foru ... amp;extra=#pid26161
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2018-8-29 20:40
  • 签到天数: 1341 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2012-11-19 15:16:38 | 显示全部楼层
    andery88 发表于 2012-11-19 13:10
    省得大家麻烦,我这有一破解版的,我把它放在了进程帖的下面,链接地址:
    https://www.cirmall.com/bbs/fo ...

    多谢多谢!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2016-8-26 01:52
  • 签到天数: 120 天

    连续签到: 1 天

    [LV.7]常住居民III

    发表于 2012-11-24 02:12:16 | 显示全部楼层
    楼主辛苦了,支持一个{:soso_e179:}
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2020-3-19 13:22
  • 签到天数: 805 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2012-11-30 16:10:15 | 显示全部楼层
    辛苦了  支持一下
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2014-8-19 06:31
  • 签到天数: 296 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2013-8-18 20:09:36 | 显示全部楼层
    powerdruy 发表于 2012-11-19 10:12
    imagetolcd这个软件,玩液晶的都有

    这个软件好像只能生成8位的 比如0x33  怎么能生成16位的 比如0x3333;
    这样写彩屏的时候图像数据不用处理
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2015-10-29 23:19
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    发表于 2015-10-29 23:55:41 | 显示全部楼层
    谢谢分享,学习了
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-11-25 08:32 , Processed in 0.214365 second(s), 33 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.