Diff: view.h
- Revision:
- 0:eccd33c01946
- Child:
- 1:3ce68d55dfb8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view.h Sun Jun 14 19:14:04 2020 +0000 @@ -0,0 +1,44 @@ +#ifndef VIEW_H +#define VIEW_H +#include "mbed.h" +#include "button.h" +#include "stm32746g_discovery_lcd.h" +#include "stm32746g_discovery_ts.h" +#include <list> +#define SCREENWIDTH 480 +#define SCREENHEIGHT 272 +#define LED_BUTTON_SIZE 15 +#define RGB_TEXT_VIEW_WIDTH 30 +#define RGB_TEXT_VIEW_HEIGHT 15 +#define PLUS_MINUS_BUTTON_SIZE 30 +#define ANIMATION_BUTTON_WIDTH 80 +#define ANIMATION_BUTTON_HEIGHT 15 +#define LIGHT_GRAY (uint32_t)0xFFe0e0d1 +#include <ESP8266.h> + +extern RawSerial pc; +extern RawSerial wifi; + + +class View +{ +public: + View(int width = SCREENWIDTH, int height = SCREENHEIGHT); + void contain(int x, int y); + void draw(); + ~View(); + void updateLoop(); + +private : + void initLCD(); + void drawText(); + int16_t m_width = SCREENWIDTH; + int16_t m_height = SCREENHEIGHT; + uint32_t m_bgColor = LCD_COLOR_WHITE; + list<Button *> m_buttonList; + + ESP8266 * m_esp; + +}; + +#endif