2015-12-22 17:16:19 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "NotifyDevice.h"
|
|
|
|
|
2016-09-30 04:21:28 -03:00
|
|
|
#define ROW(Y) ((Y * 10) + 6)
|
|
|
|
#define COLUMN(X) ((X * 7) + 0)
|
|
|
|
|
2017-03-15 11:08:05 -03:00
|
|
|
#define DISPLAY_MESSAGE_SIZE 19
|
2015-12-22 17:16:19 -04:00
|
|
|
|
2017-01-19 03:15:24 -04:00
|
|
|
class Display_Backend;
|
|
|
|
|
2015-12-22 17:16:19 -04:00
|
|
|
class Display: public NotifyDevice {
|
|
|
|
public:
|
2017-01-19 03:15:24 -04:00
|
|
|
friend class Display_Backend;
|
|
|
|
|
2018-11-07 07:01:17 -04:00
|
|
|
bool init(void) override;
|
|
|
|
void update() override;
|
2015-12-22 17:16:19 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
void draw_char(uint16_t x, uint16_t y, const char c);
|
|
|
|
void draw_text(uint16_t x, uint16_t y, const char *c);
|
|
|
|
void update_all();
|
2016-09-30 04:21:28 -03:00
|
|
|
void update_arm(uint8_t r);
|
|
|
|
void update_prearm(uint8_t r);
|
|
|
|
void update_gps(uint8_t r);
|
|
|
|
void update_gps_sats(uint8_t r);
|
|
|
|
void update_ekf(uint8_t r);
|
|
|
|
void update_battery(uint8_t r);
|
|
|
|
void update_mode(uint8_t r);
|
|
|
|
void update_text(uint8_t r);
|
2017-02-17 03:19:16 -04:00
|
|
|
void update_text_empty(uint8_t r);
|
2015-12-22 17:16:19 -04:00
|
|
|
|
2017-01-19 03:15:24 -04:00
|
|
|
Display_Backend *_driver;
|
|
|
|
|
2017-05-02 18:49:30 -03:00
|
|
|
uint8_t _mstartpos; // ticker shift position
|
|
|
|
uint8_t _movedelay; // ticker delay before shifting after new message displayed
|
2017-01-20 01:39:19 -04:00
|
|
|
uint8_t _screenpage;
|
2017-02-17 03:19:16 -04:00
|
|
|
|
|
|
|
// stop showing text in display after this many millis:
|
|
|
|
const uint16_t _send_text_valid_millis = 20000;
|
2015-12-22 17:16:19 -04:00
|
|
|
};
|
|
|
|
|