Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 121 → Rev 129

/PIC Stuff/PIC_27J13/oled_ssd1331.h
3,6 → 3,7
 
#define SSD1331_LCDWIDTH 96
#define SSD1331_LCDHEIGHT 64
#define SSD1331_STRING_BUFFER_SIZE 32
 
// Select one of these defines to set the pixel color order
#define SSD1331_COLORORDER_RGB
49,6 → 50,22
#define SSD1331_YELLOW 0xFFE0
#define SSD1331_WHITE 0xFFFF
 
typedef struct __SSD1331_DATA {
int WIDTH, HEIGHT; // raw display size
int _width, _height; // size depending on rotation
int cursor_x, cursor_y;
unsigned int textcolor, textbgcolor;
unsigned char textsize;
unsigned char rotation;
unsigned char wrap; // If set, wrap text at right side
} SSD1331_DATA;
 
// Misc functions
int SSD1331_Abs(int i);
void SSD1331_Swap(int *a, int *b);
unsigned int SSD1331_Color565(unsigned char r, unsigned char g, unsigned char b);
 
// Core functions
void SSD1331_Init(void);
void SSD1331_Begin(void);
void SSD1331_GoTo(int x, int y);
56,14 → 73,41
void SSD1331_Command(unsigned char c);
void SSD1331_Data(unsigned char d);
 
// Display functions
void SSD1331_Clear_Display(void);
 
void SSD1331_Draw_Pixel(int x, int y, unsigned int color);
void SSD1331_Draw_Line(int x0, int y0, int x1, int y1, unsigned int color);
void SSD1331_Draw_Fast_VLine(int x, int y, int h, unsigned int color);
void SSD1331_Draw_Fast_HLine(int x, int y, int w, unsigned int color);
void SSD1331_Draw_Rect(int x0, int y0, int x1, int y1, unsigned int color);
void SSD1331_Fill_Rect(int x0, int y0, int x1, int y1, unsigned int color);
void SSD1331_Clear_Display(void);
 
unsigned int SSD1331_Color565(unsigned char r, unsigned char g, unsigned char b);
void SSD1331_Draw_Circle(int x0, int y0, int r, unsigned int color);
void SSD1331_Draw_Circle_Helper(int x0, int y0, int r, unsigned char cornername, unsigned int color);
void SSD1331_Fill_Circle(int x0, int y0, int r, unsigned int color);
void SSD1331_Fill_Circle_Helper(int x0, int y0, int r, unsigned char cornername, int delta, unsigned int color);
 
void SSD1331_Draw_Triangle(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color);
void SSD1331_Fill_Triangle(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color);
void SSD1331_Draw_Round_Rect(int x0, int y0, int w, int h, int radius, unsigned int color);
void SSD1331_Fill_Round_Rect(int x0, int y0, int w, int h, int radius, unsigned int color);
 
void SSD1331_Draw_Bitmap(int x, int y, const unsigned char *bitmap, int w, int h, unsigned int color);
void SSD1331_Draw_Char(int x, int y, unsigned char c, unsigned int color, unsigned int bg, unsigned char size);
 
void SSD1331_Write(unsigned char c);
void SSD1331_Write_String(const rom char *fmt, ...);
//void SSD1331_Append_String(const rom char *fmt, ...);
 
void SSD1331_Set_Cursor(int x, int y);
void SSD1331_Set_Text_Color(unsigned int c);
void SSD1331_Set_Text_Color_BG(unsigned int c, unsigned int bg);
void SSD1331_Set_Text_Size(unsigned char s);
void SSD1331_Set_Text_Wrap(unsigned char w);
void SSD1331_Set_Rotation(unsigned char r);
 
// Test functions
void SSD1331_Test_DrawLines(unsigned int color);
void SSD1331_Test_DrawRect(unsigned int color);
void SSD1331_Test_FillRect(unsigned int color1, unsigned int color2);