2018-07-17 15:15:58 +02:00
|
|
|
#ifndef _DISPLAY_H
|
|
|
|
#define _DISPLAY_H
|
2018-07-15 14:28:05 +02:00
|
|
|
|
2018-12-22 14:37:47 +01:00
|
|
|
#include "cyclic.h"
|
2019-09-29 16:46:48 +02:00
|
|
|
#include "qrcode.h"
|
2020-03-11 23:47:16 +01:00
|
|
|
#define DISPLAY_PAGES (7) // number of paxcounter display pages
|
|
|
|
|
|
|
|
// settings for oled display library
|
|
|
|
#define USE_BACKBUFFER 1
|
|
|
|
#define MY_OLED OLED_128x64
|
2020-03-17 22:31:34 +01:00
|
|
|
#ifdef MY_OLED_ADDR
|
|
|
|
#define OLED_ADDR MY_OLED_ADDR
|
|
|
|
#else
|
|
|
|
#define OLED_ADDR -1
|
|
|
|
#endif
|
2020-03-11 23:47:16 +01:00
|
|
|
#define OLED_INVERT 0
|
|
|
|
#define USE_HW_I2C 1
|
|
|
|
|
|
|
|
#ifndef DISPLAY_FLIP
|
|
|
|
#define DISPLAY_FLIP 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// settings for qr code generator
|
|
|
|
#define QR_VERSION 3 // 29 x 29px
|
|
|
|
#define QR_SCALEFACTOR 2 // 29 -> 58x < 64px
|
|
|
|
|
|
|
|
// settings for curve plotter
|
|
|
|
#define DISPLAY_WIDTH 128 // Width in pixels of OLED-display, must be 32X
|
|
|
|
#define DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X
|
2018-07-15 14:28:05 +02:00
|
|
|
|
2019-12-21 15:18:42 +01:00
|
|
|
extern uint8_t DisplayIsOn, displaybuf[];
|
2019-02-23 21:51:24 +01:00
|
|
|
|
2020-03-11 23:47:16 +01:00
|
|
|
void setup_display(int contrast = 0);
|
2020-01-20 11:41:31 +01:00
|
|
|
void refreshTheDisplay(bool nextPage = false);
|
2019-10-16 21:14:34 +02:00
|
|
|
void init_display(bool verbose = false);
|
|
|
|
void shutdown_display(void);
|
2020-01-20 11:41:31 +01:00
|
|
|
void draw_page(time_t t, bool nextpage);
|
2019-10-01 13:02:30 +02:00
|
|
|
void dp_printf(uint16_t x, uint16_t y, uint8_t font, uint8_t inv,
|
|
|
|
const char *format, ...);
|
2020-03-11 23:47:16 +01:00
|
|
|
void dp_dump(uint8_t *pBuffer);
|
2019-10-01 13:02:30 +02:00
|
|
|
void dp_printqr(uint16_t offset_x, uint16_t offset_y, const char *Message);
|
|
|
|
void oledfillRect(uint16_t x, uint16_t y, uint16_t width, uint16_t height,
|
|
|
|
uint8_t bRender);
|
2019-10-05 13:12:58 +02:00
|
|
|
void oledScrollBufferHorizontal(uint8_t *buf, const uint16_t width,
|
|
|
|
const uint16_t height, bool left = true);
|
|
|
|
void oledScrollBufferVertical(uint8_t *buf, const uint16_t width,
|
|
|
|
const uint16_t height, int offset = 0);
|
2019-10-01 13:02:30 +02:00
|
|
|
int oledDrawPixel(uint8_t *buf, const uint16_t x, const uint16_t y,
|
|
|
|
const uint8_t dot);
|
2019-10-01 18:06:49 +02:00
|
|
|
void oledPlotCurve(uint16_t count, bool reset);
|
2019-10-04 15:47:33 +02:00
|
|
|
void oledRescaleBuffer(uint8_t *buf, const int factor);
|
2018-07-15 14:28:05 +02:00
|
|
|
|
|
|
|
#endif
|