blob: 0263fe902effa20850f0226c683aec2a9a09a951 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/*
* Display.h
*
* Created on: 22 Jan 2018
* Author: David
*/
#ifndef SRC_DISPLAY_DISPLAY_H_
#define SRC_DISPLAY_DISPLAY_H_
#include "RepRapFirmware.h"
#if SUPPORT_12864_LCD
#include "RotaryEncoder.h"
#include "Lcd/Lcd.h"
#include "Menu.h"
#include <ObjectModel/ObjectModel.h>
class Display INHERIT_OBJECT_MODEL
{
public:
Display() noexcept;
void Init() noexcept { }
GCodeResult Configure(GCodeBuffer& gb, const StringRef& reply);
void Spin() noexcept;
void Exit() noexcept;
void Beep(unsigned int frequency, unsigned int milliseconds) noexcept;
void SuccessBeep() noexcept;
void ErrorBeep() noexcept;
bool IsPresent() const noexcept { return lcd != nullptr; }
void UpdatingFirmware() noexcept;
constexpr static uint8_t DefaultDisplayContrastRatio = 30; // this works well for the Fysetc display
constexpr static uint8_t DefaultDisplayResistorRatio = 6; // the recommended Fysetc display uses 6, some other displays use 3
protected:
DECLARE_OBJECT_MODEL
private:
void InitDisplay(GCodeBuffer& gb, Lcd *newLcd, Pin csPin, Pin a0Pin, bool defaultCsPolarity);
Lcd *lcd;
Menu *menu;
RotaryEncoder *encoder;
uint32_t whenBeepStarted;
uint32_t beepLength;
uint32_t lastRefreshMillis;
uint16_t mboxSeq;
bool mboxActive;
bool beepActive;
bool updatingFirmware;
};
#endif
#endif /* SRC_DISPLAY_DISPLAY_H_ */
|