lcd_ssd1963.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**************************************************************************//**
  2. *
  3. * @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2022-2-23 Wayne First version
  10. *
  11. ******************************************************************************/
  12. #ifndef __LCD_SSD1963_H__
  13. #define __LCD_SSD1963_H__
  14. #include <rtconfig.h>
  15. #include <rtdevice.h>
  16. #define SET_RS rt_pin_write(BOARD_USING_SSD1963_PIN_DC, 1)
  17. #define CLR_RS rt_pin_write(BOARD_USING_SSD1963_PIN_DC, 0)
  18. #define SET_RST rt_pin_write(BOARD_USING_SSD1963_PIN_RESET, 1)
  19. #define CLR_RST rt_pin_write(BOARD_USING_SSD1963_PIN_RESET, 0)
  20. #define SET_BACKLIGHT_ON rt_pin_write(BOARD_USING_SSD1963_PIN_BACKLIGHT, 1)
  21. #define SET_BACKLIGHT_OFF rt_pin_write(BOARD_USING_SSD1963_PIN_BACKLIGHT, 0)
  22. #define SET_DISP_ON rt_pin_write(BOARD_USING_SSD1963_PIN_DISPLAY, 1)
  23. #define SET_DISP_OFF rt_pin_write(BOARD_USING_SSD1963_PIN_DISPLAY, 0)
  24. //
  25. // Physical display size
  26. //
  27. //#if defined(NU_PKG_SSD1963_HORIZONTAL)
  28. #define XSIZE_PHYS 480
  29. #define YSIZE_PHYS 272
  30. //#else
  31. // #define XSIZE_PHYS 272
  32. // #define YSIZE_PHYS 480
  33. //#endif
  34. int rt_hw_lcd_ssd1963_init(void);
  35. void ssd1963_send_cmd(rt_uint8_t cmd);
  36. void ssd1963_send_cmd_parameter(rt_uint8_t data);
  37. void ssd1963_set_column(rt_uint16_t StartCol, rt_uint16_t EndCol);
  38. void ssd1963_set_page(rt_uint16_t StartPage, rt_uint16_t EndPage);
  39. void ssd1963_send_pixel_data(rt_uint16_t color);
  40. void ssd1963_lcd_get_pixel(char *color, int x, int y);
  41. void ssd1963_send_pixels(rt_uint16_t *pixels, int len);
  42. #if defined(NU_PKG_USING_SSD1963_EBI)
  43. rt_err_t rt_hw_lcd_ssd1963_ebi_init(rt_uint32_t ebi_base);
  44. #endif
  45. #endif /* __LCD_SSD1963_H__ */