107_32_Driver_IO16.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __107_32_Driver_IO16_H_
  2. #define __107_32_Driver_IO16_H_
  3. //#include "hw_config.h"
  4. #define LCD_CS_PIN GPIO_Pin_6
  5. #define LCD_RS_PIN GPIO_Pin_13
  6. #define LCD_WR_PIN GPIO_Pin_14
  7. #define LCD_RD_PIN GPIO_Pin_15
  8. #define RCC_LCD_DATA_GPIO RCC_APB2Periph_GPIOE
  9. #define RCC_LCD_CONTROL_GPIO RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD
  10. #define LCD_DATA_GPIO GPIOE
  11. #define MAX_HZ_POSX 224
  12. #define MAX_HZ_POSY 304
  13. /*Private define-------------------------*/
  14. #define POINT_COLOR RED
  15. #define BACK_COLOR 0xFFFF
  16. /*--------16位颜色值---------------*/
  17. #define WHITE 0xFFFF
  18. #define BLACK 0x0000
  19. #define BLUE 0x001F
  20. #define RED 0xF800
  21. #define MAGENTA 0xF81F
  22. #define GREEN 0x07E0
  23. #define CYAN 0x7FFF
  24. #define YELLOW 0xFFE0
  25. #define BROWN 0XBC40 //棕色
  26. #define BRRED 0XFC07 //棕红色
  27. #define GRAY 0X8430 //灰色
  28. #define LGRAY 0XC618 //浅灰色
  29. /*----------函数声明------------*/
  30. /* 刷屏 */
  31. void LCD_Clear(uint16_t Color);
  32. void LCD_Fill(uint8_t xsta, uint16_t ysta, uint8_t xend, uint16_t yend, uint16_t colour);
  33. void LCD_DrawLine(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend);
  34. void Draw_Circle(uint16_t x0, uint16_t y0, uint8_t r);
  35. void LCD_DrawRectangle(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend);
  36. void LCD_WindowMax (unsigned int x,unsigned int y,unsigned int x_end,unsigned int y_end);
  37. /*显示字符 包括中英文*/
  38. void LCD_ShowString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
  39. void GUI_Put(u16 x, u16 y, u8 *str,u32 PenColor, u32 BackColor);
  40. /*显示图片 gImage取模 bmp格式*/
  41. void LCD_DrawPicture(u16 StartX,u16 StartY,u16 Xend,u16 Yend,u8 *pic);
  42. void LCD_Configuration(void);
  43. void LCD_Init(void);
  44. #endif