fmt0371.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef FMT0371_H_INCLUDED
  2. #define FMT0371_H_INCLUDED
  3. //---------- LCD_RESET -------------
  4. #define LCD_RST_PORT GPIOF
  5. #define LCD_RST_PIN GPIO_Pin_10
  6. #define LCD_RST_RCC RCC_APB2Periph_GPIOF
  7. /**************************************/
  8. #define LCD_RST_0 GPIO_ResetBits(LCD_RST_PORT,LCD_RST_PIN)
  9. #define LCD_RST_1 GPIO_SetBits(LCD_RST_PORT,LCD_RST_PIN)
  10. //---------- LCD_RESET -------------
  11. #define LCD_ADDR (*((volatile unsigned char *) 0x64000000)) // RS = 0
  12. #define LCD_DATA (*((volatile unsigned char *) 0x64000004)) // RS = 1
  13. #define LCD_DATA16(a) LCD_DATA = (unsigned char)(a>>8);LCD_DATA = (unsigned char)a // RS = 1 & WIDHT = 16
  14. #define LCD_DATA16_READ(a) do { a = (LCD_DATA << 8) | (LCD_DATA); } while (0)
  15. #define LCD_WR_CMD(a,b,c) LCD_ADDR = b;LCD_DATA16(c)
  16. #define LCD_WR_REG(a) LCD_ADDR = a
  17. #define LCD_WR_DATA8(a) LCD_DATA = a
  18. extern void ftm0371_port_init(void);
  19. extern void ftm0371_init(void);
  20. /*
  21. 16弇(R5G6B5)
  22. 囀湔毓峓
  23. 0x02 D7:D0 Xお宎華硊
  24. 0x03 D8:D0 Yお宎華硊
  25. 0x04 D7:D0 X賦旰華硊
  26. 0x05 D8:D0 Y賦旰華硊
  27. */
  28. #endif // FMT0371_H_INCLUDED