esp32 firmware for a toaster reflow oven WIP!!!!!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
reflower/main/graphics/drawing.h

78 lines
2.2 KiB

/**
* TODO file description
*
* Created on 2020/01/05.
*/
#ifndef LCD_DRAWING_H
#define LCD_DRAWING_H
#include <stdint.h>
#include <stdbool.h>
#include "utf8.h"
enum Color {
WHITE = 0,
BLACK = 1,
};
// This function sets a pixel on displayMap to your preferred
// color. 1=Black, 0= white.
void LCD_setPixel(int x, int y, enum Color bw);
// setLine draws a line from x0,y0 to x1,y1 with the set color
void LCD_setLine(int x0, int y0, int x1, int y1, enum Color bw);
// setRect will draw a rectangle from x0,y0 top-left corner to
// a x1,y1 bottom-right corner. Can be filled with the fill
// parameter, and colored with bw.
void LCD_setRect(int x0, int y0, int x1, int y1, bool fill, enum Color bw);
// setCircle draws a circle centered around x0,y0 with a defined
// radius. The circle can be black or white. And have a line
// thickness ranging from 1 to the radius of the circle.
void LCD_setCircle (int x0, int y0, int radius, enum Color bw, int lineThickness);
void LCD_setBitmap(const uint8_t *bitArray);
/*
FONT FUNCTIONS
size = 1 ... normal
size = 2 ... 2x
size = 3 ... normal bold
size | 0x80 ... clear background behind characters
*/
enum FontStyle {
FONT_NORMAL = 1,
FONT_DOUBLE = 2,
FONT_BOLD = 3,
FONT_BG = 0x80,
};
// This function will draw a char (defined in the ASCII table
// near the beginning of this sketch) at a defined x and y).
// The color can be either black (1) or white (0).
void LCD_setChar(struct Utf8Char character, int x, int y, enum Color bw);
void LCD_setCharEx(struct Utf8Char character, int x, int y, enum Color bw, uint8_t style);
// setStr draws a string of characters, calling setChar with
// progressive coordinates until it's done.
// This function was grabbed from the SparkFun ColorLCDShield
// library.
void LCD_setStr(const char * dString, int x, int y, enum Color bw);
void LCD_setStrEx(const char *dString, int x, int y, enum Color bw, uint8_t style);
// This function clears the entire display either white (0) or
// black (1).
// The screen won't actually clear until you call updateDisplay()!
void LCD_clearDisplay(enum Color bw);
/* Invert colors (hard change in data; does NOT send to display immediately) */
void LCD_invertDisplayData();
#endif //LCD_DRAWING_H