44 lines
880 B
C++
44 lines
880 B
C++
/*
|
|
* Stairs lighting
|
|
* Copyright 2017 (c) Mark van Renswoude
|
|
*
|
|
* https://git.x2software.net/pub/Stairs
|
|
*/
|
|
#ifndef __display
|
|
#define __display
|
|
|
|
#include <Arduino.h>
|
|
#include <Wire.h>
|
|
#include <Adafruit_GFX.h>
|
|
#include "lib/Adafruit_SSD1306.h"
|
|
#include "state.h"
|
|
|
|
|
|
class Display
|
|
{
|
|
private:
|
|
Adafruit_SSD1306* mDisplay;
|
|
State mLastDrawnState = State::DisplayOff;
|
|
uint32_t mLastStateChange;
|
|
uint8_t mLastModuleIndex;
|
|
uint32_t mLastWaiting;
|
|
uint8_t mWaitAnimationStep = 0;
|
|
|
|
void drawRotatedBitmap(int8_t x, int8_t y, const uint8_t bitmap[], int8_t w, int8_t h, uint8_t rotation);
|
|
|
|
void checkOn();
|
|
void drawTitle(const char* title);
|
|
void drawCommIcon();
|
|
|
|
void drawWaitingForComm();
|
|
void drawModuleIndex();
|
|
void drawLinking();
|
|
void off();
|
|
|
|
void setLastDrawnState();
|
|
public:
|
|
void init();
|
|
void update();
|
|
};
|
|
|
|
#endif |