fmt0371.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define LCD_RST_0 GPIO_ResetBits(LCD_RST_PORT,LCD_RST_PIN)
  8. #define LCD_RST_1 GPIO_SetBits(LCD_RST_PORT,LCD_RST_PIN)
  9. /************** LCD_RESET ************/
  10. #define LCD_ADDR (*((volatile unsigned char *) 0x64000000)) /* RS = 0 */
  11. #define LCD_DATA (*((volatile unsigned char *) 0x64000004)) /* RS = 1 */
  12. #include "rtdef.h"
  13. rt_inline void LCD_DATA16(rt_uint16_t data)
  14. {
  15. LCD_DATA = data>>8;
  16. LCD_DATA = data;
  17. }
  18. rt_inline rt_uint16_t LCD_DATA16_READ(void)
  19. {
  20. rt_uint16_t temp;
  21. temp = (LCD_DATA << 8);
  22. temp |= LCD_DATA;
  23. return temp;
  24. }
  25. #define LCD_WR_CMD(a,b,c) LCD_ADDR = b;LCD_DATA16(c)
  26. #define LCD_WR_REG(a) LCD_ADDR = a
  27. #define LCD_WR_DATA8(a) LCD_DATA = a
  28. extern void ftm0371_port_init(void);
  29. extern void ftm0371_init(void);
  30. /*
  31. 16弇(R5G6B5)
  32. 囀湔毓峓
  33. 0x02 D7:D0 Xお宎華硊
  34. 0x03 D8:D0 Yお宎華硊
  35. 0x04 D7:D0 X賦旰華硊
  36. 0x05 D8:D0 Y賦旰華硊
  37. */
  38. #endif // FMT0371_H_INCLUDED