lcd_fsa506.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_FSA506_H__
  13. #define __LCD_FSA506_H__
  14. #include <rtthread.h>
  15. #include <rtdevice.h>
  16. #define SET_RS rt_pin_write(BOARD_USING_FSA506_PIN_DC, 1)
  17. #define CLR_RS rt_pin_write(BOARD_USING_FSA506_PIN_DC, 0)
  18. #define SET_RST rt_pin_write(BOARD_USING_FSA506_PIN_RESET, 1)
  19. #define CLR_RST rt_pin_write(BOARD_USING_FSA506_PIN_RESET, 0)
  20. #define SET_BACKLIGHT_ON rt_pin_write(BOARD_USING_FSA506_PIN_BACKLIGHT, 1)
  21. #define SET_BACKLIGHT_OFF rt_pin_write(BOARD_USING_FSA506_PIN_BACKLIGHT, 0)
  22. //
  23. // Physical display size
  24. //
  25. //#if defined(NU_PKG_FSA506_HORIZONTAL)
  26. #define XSIZE_PHYS 480
  27. #define YSIZE_PHYS 272
  28. //#else
  29. // #define XSIZE_PHYS 272
  30. // #define YSIZE_PHYS 480
  31. //#endif
  32. int rt_hw_lcd_fsa506_init(void);
  33. void fsa506_send_cmd(rt_uint16_t cmd);
  34. void fsa506_send_cmd_parameter(rt_uint16_t data);
  35. void fsa506_send_cmd_done(void);
  36. void fsa506_write_reg(rt_uint16_t cmd, rt_uint16_t data);
  37. void fsa506_set_column(rt_uint16_t StartCol, rt_uint16_t EndCol);
  38. void fsa506_set_page(rt_uint16_t StartPage, rt_uint16_t EndPage);
  39. void fsa506_send_pixel_data(rt_uint16_t color);
  40. void fsa506_lcd_get_pixel(char *color, int x, int y);
  41. void fsa506_send_pixels(rt_uint16_t *pixels, int len);
  42. #if defined(NU_PKG_USING_FSA506_EBI)
  43. rt_err_t rt_hw_lcd_fsa506_ebi_init(rt_uint32_t ebi_base);
  44. #endif
  45. #endif /* __LCD_FSA506_H__ */