2014-04-29 12:26:51 +00:00
|
|
|
/*
|
2017-11-05 16:46:34 +00:00
|
|
|
* This file is part of the TREZOR project, https://trezor.io/
|
2014-04-29 12:26:51 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Pavol Rusnak <stick@satoshilabs.com>
|
|
|
|
*
|
|
|
|
* This library is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __OLED_H__
|
|
|
|
#define __OLED_H__
|
|
|
|
|
2015-11-18 22:35:28 +00:00
|
|
|
#include <stdbool.h>
|
2019-03-29 16:10:31 +00:00
|
|
|
#include <stdint.h>
|
2014-04-29 12:26:51 +00:00
|
|
|
|
|
|
|
#include "bitmaps.h"
|
|
|
|
#include "fonts.h"
|
|
|
|
|
2019-03-29 16:10:31 +00:00
|
|
|
#define OLED_WIDTH 128
|
|
|
|
#define OLED_HEIGHT 64
|
2014-04-29 12:26:51 +00:00
|
|
|
#define OLED_BUFSIZE (OLED_WIDTH * OLED_HEIGHT / 8)
|
|
|
|
|
|
|
|
void oledInit(void);
|
|
|
|
void oledClear(void);
|
|
|
|
void oledRefresh(void);
|
|
|
|
|
2017-01-19 15:16:57 +00:00
|
|
|
void oledSetDebugLink(bool set);
|
2017-12-16 20:39:43 +00:00
|
|
|
void oledInvertDebugLink(void);
|
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
void oledSetBuffer(uint8_t *buf);
|
|
|
|
const uint8_t *oledGetBuffer(void);
|
|
|
|
void oledDrawPixel(int x, int y);
|
|
|
|
void oledClearPixel(int x, int y);
|
2017-07-25 12:24:45 +00:00
|
|
|
void oledInvertPixel(int x, int y);
|
2015-11-18 22:35:28 +00:00
|
|
|
void oledDrawChar(int x, int y, char c, int zoom);
|
2018-02-06 21:29:33 +00:00
|
|
|
int oledStringWidth(const char *text, int font);
|
2017-09-04 06:12:33 +00:00
|
|
|
|
2019-03-29 16:10:31 +00:00
|
|
|
void oledDrawString(int x, int y, const char *text, int font);
|
|
|
|
void oledDrawStringCenter(int x, int y, const char *text, int font);
|
|
|
|
void oledDrawStringRight(int x, int y, const char *text, int font);
|
2014-04-29 12:26:51 +00:00
|
|
|
void oledDrawBitmap(int x, int y, const BITMAP *bmp);
|
|
|
|
void oledInvert(int x1, int y1, int x2, int y2);
|
2015-11-18 22:35:28 +00:00
|
|
|
void oledBox(int x1, int y1, int x2, int y2, bool set);
|
2014-04-29 12:26:51 +00:00
|
|
|
void oledHLine(int y);
|
|
|
|
void oledFrame(int x1, int y1, int x2, int y2);
|
|
|
|
void oledSwipeLeft(void);
|
|
|
|
void oledSwipeRight(void);
|
|
|
|
|
|
|
|
#endif
|