-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArduboy.h
66 lines (59 loc) · 2.49 KB
/
Arduboy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef Arduboy_h
#define Arduboy_h
#include <SPI.h>
#include <Print.h>
#define CS 6
#define DC 4
#define RST 12
#define WIDTH 128
#define HEIGHT 64
class Arduboy : public Print
{
public:
Arduboy();
uint8_t getInput();
void start();
void blank();
void clearDisplay();
void display(uint8_t bufferNum);
void drawScreen(const unsigned char *image);
void drawScreen(unsigned char image[]);
void drawPixel(int x, int y, uint16_t value);
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t color);
void fillScreen(uint16_t color);
void drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
void fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
void setCursor(int16_t x, int16_t y);
void setTextSize(uint8_t s);
void setTextWrap(boolean w);
uint8_t width();
uint8_t height();
virtual size_t write(uint8_t);
void swap(int16_t& a, int16_t& b);
void copyScreen(const uint8_t *bitmap, uint8_t bufferNum);
private:
unsigned char sBuffer0[(HEIGHT*WIDTH)/8];
unsigned char sBuffer1[(HEIGHT*WIDTH)/8];
uint8_t readCapacitivePin(int pinToMeasure);
uint8_t readCapXtal(int pinToMeasure);
volatile uint8_t *mosiport, *clkport, *csport, *dcport;
uint8_t mosipinmask, clkpinmask, cspinmask, dcpinmask;
// Adafruit stuff
protected:
int16_t cursor_x, cursor_y;
uint8_t textsize;
boolean wrap; // If set, 'wrap' text at right edge of display
};
#endif