gd32f450z_lcd_eval.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*!
  2. \file gd32f450z_lcd_eval.h
  3. \brief definitions for GD32F450Z_EVAL's LCD
  4. */
  5. /*
  6. Copyright (C) 2016 GigaDevice
  7. 2016-10-19, V1.0.0, firmware for GD32F450Z
  8. */
  9. #ifndef GD32F450Z_LCD_EVAL_H
  10. #define GD32F450Z_LCD_EVAL_H
  11. #include "gd32f450z_eval.h"
  12. #define LCD_CS_PIN GPIO_PIN_11
  13. #define LCD_CS_GPIO_PORT GPIOD
  14. #define LCD_CS_GPIO_CLK RCU_GPIOD
  15. #define LCD_RS_PIN GPIO_PIN_3
  16. #define LCD_RS_GPIO_PORT GPIOE
  17. #define LCD_RS_GPIO_CLK RCU_GPIOE
  18. #define LCD_SPI_SCK_PIN GPIO_PIN_13
  19. #define LCD_SPI_SCK_GPIO_PORT GPIOG
  20. #define LCD_SPI_SCK_GPIO_CLK RCU_GPIOG
  21. #define LCD_SPI_MOSI_PIN GPIO_PIN_14
  22. #define LCD_SPI_MOSI_GPIO_PORT GPIOG
  23. #define LCD_SPI_MOSI_GPIO_CLK RCU_GPIOG
  24. #define LCD_SPI SPI5
  25. #define LCD_SPI_CLK RCU_SPI5
  26. /* enable the LCD */
  27. void lcd_enable(void);
  28. /* disable the LCD */
  29. void lcd_disable(void);
  30. /* configure the LCD control line */
  31. void lcd_ctrl_line_config(void);
  32. /* set the LCD control line */
  33. void lcd_ctrl_line_set(uint32_t gpiox, uint16_t gpiopin);
  34. /* reset the LCD control line */
  35. void lcd_ctrl_line_reset(uint32_t gpiox, uint16_t gpiopin);
  36. /* configure the LCD SPI and it's GPIOs */
  37. void lcd_spi_config(void);
  38. /* write command to select LCD register */
  39. void lcd_command_write(uint8_t lcd_register);
  40. /* write data to select LCD register */
  41. void lcd_data_write(uint8_t value);
  42. /* configure the LCD based on the power on sequence */
  43. void lcd_power_on(void);
  44. void lcd_power_on3(void);
  45. #endif /* GD32F450Z_LCD_EVAL_H */