LCD.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /****************************************Copyright (c)**************************************************
  2. * File Name: Lcd.h
  3. * Function Describe: Header file for Lcd.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2016-1-8
  7. ********************************************************************************************************/
  8. #ifndef __LCD_H
  9. #define __LCD_H
  10. //-------------------------------------------------------------------------------------------------------
  11. #include "stm32f10x.h"
  12. #define LCD_WIDTH 160
  13. #define LCD_HEIGHT 128
  14. #define LCD_CS_PIN GPIO_Pin_12
  15. #define LCD_CS_PORT GPIOB
  16. #define LCD_CS_HIGH LCD_CS_PORT->BSRR = LCD_CS_PIN
  17. #define LCD_CS_LOW LCD_CS_PORT->BRR = LCD_CS_PIN
  18. #define LCD_SCK_PIN GPIO_Pin_13
  19. #define LCD_SCK_PORT GPIOB
  20. #define LCD_SCK_HIGH LCD_SCK_PORT->BSRR = LCD_SCK_PIN
  21. #define LCD_SCK_LOW LCD_SCK_PORT->BRR = LCD_SCK_PIN
  22. #define LCD_DCX_PIN GPIO_Pin_14
  23. #define LCD_DCX_PORT GPIOB
  24. #define LCD_DCX_HIGH LCD_DCX_PORT->BSRR = LCD_DCX_PIN
  25. #define LCD_DCX_LOW LCD_DCX_PORT->BRR = LCD_DCX_PIN
  26. #define LCD_SDA_PIN GPIO_Pin_15
  27. #define LCD_SDA_PORT GPIOB
  28. #define LCD_SDA_HIGH LCD_SDA_PORT->BSRR = LCD_SDA_PIN
  29. #define LCD_SDA_LOW LCD_SDA_PORT->BRR = LCD_SDA_PIN
  30. #define LCD_RESET_PIN GPIO_Pin_6
  31. #define LCD_RESET_PORT GPIOC
  32. #define LCD_RESET_HIGH LCD_RESET_PORT->BSRR = LCD_RESET_PIN
  33. #define LCD_RESET_LOW LCD_RESET_PORT->BRR = LCD_RESET_PIN
  34. #define LCD_BL_PIN GPIO_Pin_7
  35. #define LCD_BL_PORT GPIOC
  36. #define LCD_BL_HIGH LCD_BL_PORT->BSRR = LCD_BL_PIN
  37. #define LCD_BL_LOW LCD_BL_PORT->BRR = LCD_BL_PIN
  38. void LcdInit(void);
  39. void LcdBlockWrite(u16 x1,u16 y1,u16 x2,u16 y2);
  40. void LcdSendData(unsigned char Data);
  41. void LcdSendCommand(unsigned char Cmd);
  42. void LcdSendData(unsigned char Data);
  43. void LCDTimeOut(int Ct);
  44. extern unsigned char showApn;
  45. //-------------------------------------------------------------------------------------------------------
  46. #endif
  47. /*********************************************************************************************************
  48. END FILE
  49. *********************************************************************************************************/