找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4452|回复: 0
打印 上一主题 下一主题
收起左侧

3.2寸(SSD1298) 芯片手册和LPC1700参考程序

[复制链接]
跳转到指定楼层
楼主
附件里面有完整的3.2寸(SSD1298) 芯片手册下载

Bmp2RGB.exe:






LPC1700源程序如下:
  1. /******************************************************************************/
  2. /* GLCD_SPI_LPC1700.c: LPC1700 low level Graphic LCD (320x240 pixels) driven  */
  3. /*                     with SPI functions                                     */
  4. /******************************************************************************/
  5. /* This file is part of the uVision/ARM development tools.                    */
  6. /* Copyright (c) 2005-2009 Keil Software. All rights reserved.                */
  7. /* This software may only be used under the terms of a valid, current,        */
  8. /* end user licence from KEIL for a compatible version of KEIL software       */
  9. /* development tools. Nothing else gives you the right to use this software.  */
  10. /******************************************************************************/


  11. #include <lpc17xx.h>
  12. #include "stdint.h"
  13. #include "LCD.h"
  14. #include "bmboard.h"
  15. #include "ssd1298.h"
  16. #include "fonts_5x7.h"

  17. static unsigned short DeviceCode;

  18. /* LCD module is fixed */
  19. #define LCD_WIDTH        240
  20. #define LCD_HEIGHT        320

  21. #define CHAR_H      8
  22. #define CHAR_W      6


  23. /*******************************************************************************
  24. *                                                DEFINES
  25. *
  26. * Note(s) (1): LCD orientation and GRAM configuration:
  27. *
  28. *                        | ------ 240 ------ |
  29. *                   (0,0)+===================+  --->x
  30. *                        |                   |   |
  31. *           GRAM         | ----------------> |   |
  32. *        ADDRES UPDATE   | ----------------> |   |
  33. *                        |                   |   |
  34. *                        |                   |   |  
  35. *                        |                   |  320
  36. *                        |                   |   |  
  37. *                        |                   |   |
  38. *                        |                   |   |
  39. *                        |                   |   |
  40. *                        |                   |   |
  41. *                        +===================+  ---
  42. *                       \ /                    (239, 319)
  43. *******************************************************************************/

  44. /*------------------------- Speed dependant settings -------------------------*/

  45. /* If processor works on high frequency delay has to be increased, it can be
  46.    increased by factor 2^N by this constant                                   */
  47. #define DELAY_2N    18

  48. /*--------------- Graphic LCD interface hardware definitions -----------------*/

  49. /* Pin EN setting to 0 or 1                                                   */
  50. #define SET_LCD_EN(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_EN) : (LPC_GPIO0->FIOCLR = LCD_PIN_EN));
  51. /* Pin LE setting to 0 or 1                                                   */
  52. #define SET_LCD_LE(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_LE) : (LPC_GPIO0->FIOCLR = LCD_PIN_LE));
  53. /* Pin DIR setting to 0 or 1                                                   */
  54. #define SET_LCD_DIR(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_DIR) : (LPC_GPIO0->FIOCLR = LCD_PIN_DIR));
  55. /* Pin CS setting to 0 or 1                                                   */
  56. #define SET_LCD_CS(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_CS) : (LPC_GPIO0->FIOCLR = LCD_PIN_CS));
  57. /* Pin RS setting to 0 or 1                                                   */
  58. #define SET_LCD_RS(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_RS) : (LPC_GPIO0->FIOCLR = LCD_PIN_RS));
  59. /* Pin WR setting to 0 or 1                                                   */
  60. #define SET_LCD_WR(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_WR) : (LPC_GPIO0->FIOCLR = LCD_PIN_WR));
  61. /* Pin RD setting to 0 or 1                                                   */
  62. #define SET_LCD_RD(x)   ((x) ? (LPC_GPIO0->FIOSET = LCD_PIN_RD) : (LPC_GPIO0->FIOCLR = LCD_PIN_RD));

  63. /*---------------------------- Global variables ------------------------------*/

  64. /******************************************************************************/
  65. static volatile unsigned short TextColor = LCD_COLOR_RED, BackColor = LCD_COLOR_BLACK;

  66. /************************ Local auxiliary functions ***************************/
  67. void wait_delay(int count)
  68. {
  69.   while(count--);
  70. }

  71. void wait()
  72. {
  73. }

  74. static __inline void lcd_write (uint16_t word) {

  75.         LPC_GPIO2->FIODIR |= 0x000000FF;          //P2.0...P2.7 Output
  76.         SET_LCD_DIR(1);                                   //Interface A->B(CPU->LCD)
  77.         wait();
  78.         SET_LCD_EN(0);                                //Enable 2A->2B
  79.         LPC_GPIO2->FIOPIN =  (word);                   //Write D0..D7
  80.         SET_LCD_LE(1);
  81.         wait();                           
  82.         SET_LCD_LE(0);                                //latch D0..D7
  83.         LPC_GPIO2->FIOPIN =  (word >> 8);           //Write D8..D15
  84.         wait();
  85. }


  86. /*******************************************************************************
  87. * read 1 byte over serial communication                                        *
  88. *   Parameter:    byte:   byte to be sent                                      *
  89. *   Return:                                                                    *
  90. *******************************************************************************/

  91. ……………………

  92. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
LCD3.2.rar (1.89 MB, 下载次数: 23)


评分

参与人数 1黑币 +1 收起 理由
3535435345 + 1 赞一个!

查看全部评分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶1 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表