lcd_fsa506.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #define SET_DISP_ON rt_pin_write(BOARD_USING_FSA506_PIN_DISPLAY, 1)
  23. #define SET_DISP_OFF rt_pin_write(BOARD_USING_FSA506_PIN_DISPLAY, 0)
  24. //
  25. // Physical display size
  26. //
  27. //#if defined(NU_PKG_FSA506_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_fsa506_init(void);
  35. void fsa506_send_cmd(rt_uint8_t cmd);
  36. void fsa506_send_cmd_parameter(rt_uint8_t data);
  37. void fsa506_send_cmd_done(void);
  38. void fsa506_write_reg(rt_uint8_t cmd, rt_uint8_t data);
  39. void fsa506_set_column(rt_uint16_t StartCol, rt_uint16_t EndCol);
  40. void fsa506_set_page(rt_uint16_t StartPage, rt_uint16_t EndPage);
  41. void fsa506_send_pixel_data(rt_uint16_t color);
  42. void fsa506_lcd_get_pixel(char *color, int x, int y);
  43. void fsa506_send_pixels(rt_uint16_t *pixels, int len);
  44. #if defined(NU_PKG_USING_FSA506_EBI)
  45. rt_err_t rt_hw_lcd_fsa506_ebi_init(rt_uint32_t ebi_base);
  46. #endif
  47. #endif /* __LCD_FSA506_H__ */