Deluge Firmware
Loading...
Searching...
No Matches
oled.h
Go to the documentation of this file.
1/*
2 * Copyright © 2020-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef DRIVERS_RZA2_OLED_OLED_H_
19#define DRIVERS_RZA2_OLED_OLED_H_
20
21#include "definitions.h"
22
23#if HAVE_OLED
24
25namespace OLED {
26
27void mainPutText(char const* text);
28void drawOnePixel(int x, int y);
29void clearMainImage();
30void clearAreaExact(int minX, int minY, int maxX, int maxY, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
31
32void drawRectangle(int minX, int minY, int maxX, int maxY, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
33void drawVerticalLine(int pixelX, int startY, int endY, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
34void drawHorizontalLine(int pixelY, int startX, int endX, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
35void drawString(char const* string, int pixelX, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight, int scrollPos = 0, int endX = OLED_MAIN_WIDTH_PIXELS);
36void drawStringFixedLength(char const* string, int length, int pixelX, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight);
37void drawStringCentred(char const* string, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight, int centrePos = (OLED_MAIN_WIDTH_PIXELS >> 1));
38void drawStringCentredShrinkIfNecessary(char const* string, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight);
39void drawStringAlignRight(char const* string, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight, int rightPos = OLED_MAIN_WIDTH_PIXELS);
40void drawChar(uint8_t theChar, int pixelX, int pixelY, uint8_t* image, int imageWidth, int textWidth, int textHeight, int scrollPos = 0, int endX = OLED_MAIN_WIDTH_PIXELS);
41void drawGraphicMultiLine(uint8_t const* graphic, int startX, int startY, int width, uint8_t* image, int height = 8, int numBytesTall = 1);
42void drawScreenTitle(char const* title);
43
44void setupBlink(int minX, int width, int minY, int maxY, bool shouldBlinkImmediately);
45void stopBlink();
46
47void invertArea(int xMin, int width, int startY, int endY, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
48
49void sendMainImage();
50
51void setupPopup(int width, int height, uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
52void removePopup();
53void popupText(char const* text, bool persistent = false);
54bool isPopupPresent();
55
56void displayWorkingAnimation(char const* word);
57void removeWorkingAnimation();
58
59void timerRoutine();
60
61void setupConsole(int width, int height);
62void consoleText(char const* text);
63
64void stopScrollingAnimation();
65void setupSideScroller(int index, char const* text, int startX, int endX, int startY, int endY, int textSpacingX, int textSizeY, bool doHilight);
66void drawPermanentPopupLookingText(char const* text);
67
68void freezeWithError(char const* text);
69void consoleTimerEvent();
70void scrollingAndBlinkingTimerEvent();
71
72extern uint8_t oledMainImage[OLED_MAIN_HEIGHT_PIXELS >> 3][OLED_MAIN_WIDTH_PIXELS];
73extern uint8_t oledMainPopupImage[OLED_MAIN_HEIGHT_PIXELS >> 3][OLED_MAIN_WIDTH_PIXELS];
74extern uint8_t oledMainConsoleImage[CONSOLE_IMAGE_NUM_ROWS][OLED_MAIN_WIDTH_PIXELS];
75
76extern const uint8_t folderIcon[];
77extern const uint8_t waveIcon[];
78extern const uint8_t songIcon[];
79extern const uint8_t synthIcon[];
80extern const uint8_t kitIcon[];
81extern const uint8_t downArrowIcon[];
82extern const uint8_t rightArrowIcon[];
83
84}
85
86extern "C" {
87void consoleTextIfAllBootedUp(char const* text);
88}
89
90#endif
91
92#endif /* DRIVERS_RZA2_OLED_OLED_H_ */
#define CONSOLE_IMAGE_NUM_ROWS
Definition: definitions.h:944
#define OLED_MAIN_WIDTH_PIXELS
Definition: definitions.h:937
void timerRoutine()
Definition: PadLEDs.cpp:689
void freezeWithError(char const *error)
Definition: numericdriver.cpp:621