26 lines
773 B
C
26 lines
773 B
C
#ifndef _ST7735_FONT_H_
|
|
#define _ST7735_FONT_H_
|
|
|
|
#include <stdint.h>
|
|
#include <avr/pgmspace.h>
|
|
|
|
typedef struct { // Data stored PER GLYPH
|
|
uint16_t bitmapOffset; // Pointer into GFXfont->bitmap
|
|
uint8_t width, height; // Bitmap dimensions in pixels
|
|
uint8_t xAdvance; // Distance to advance cursor (x axis)
|
|
int8_t xOffset, yOffset; // Dist from cursor pos to UL corner
|
|
} GFXglyph;
|
|
|
|
typedef struct { // Data stored for FONT AS A WHOLE:
|
|
uint8_t *bitmap; // Glyph bitmaps, concatenated
|
|
GFXglyph *glyph; // Glyph array
|
|
uint8_t first, last; // ASCII extents
|
|
uint8_t yAdvance; // Newline distance (y axis)
|
|
} GFXfont;
|
|
|
|
|
|
|
|
void st7735_draw_text(int8_t x, int8_t y, char *text, const GFXfont *p_font, uint8_t size, uint16_t color);
|
|
|
|
#endif
|