MSPM0_ValvanoWare  1.0
ECE445L starter code
SSD1306.h
Go to the documentation of this file.
1 
78 #ifndef _SSD1306_H_
79 #define _SSD1306_H_
80 #include <stdint.h>
81 
85 #define SSD1306_BLACK 0
89 #define SSD1306_WHITE 1
93 #define SSD1306_INVERSE 2
97 #define SSD1306_EXTERNALVCC 0x01
101 #define SSD1306_SWITCHCAPVCC 0x02
105 #define true 1
109 #define false 0
110 
114 // With rotation at 0
115 // 0,0 <-x-> 0,127
116 // ------------------------
117 // | |
118 // | |
119 // | |
120 // ------------------------
121 // 63,0 63,127
128 int SSD1306_Init(int vccst);
129 
135 void SSD1306_OutBuffer(void);
136 
159 void SSD1306_Dim(int dim);
160 
176 void SSD1306_DrawPixel(int16_t x, int16_t y, uint16_t color);
177 
194 void SSD1306_DrawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
195 
212 void SSD1306_DrawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
213 
224 void SSD1306_startscrollright(uint8_t start, uint8_t stop);
234 void SSD1306_startscrollleft(uint8_t start, uint8_t stop);
235 
245 void SSD1306_startscrolldiagright(uint8_t start, uint8_t stop);
246 
256 void SSD1306_startscrolldiagleft(uint8_t start, uint8_t stop);
257 
263 
275 int SSD1306_GetPixel(int16_t x, int16_t y);
276 
282 uint8_t *SSD1306_getBuffer(void);
283 
299 void SSD1306_DrawChar(int16_t x, int16_t y, char letter, uint16_t color);
300 
318 void SSD1306_DrawString(int16_t x, int16_t y, char *pt, uint16_t color);
319 
335 void SSD1306_DrawUDec(int16_t x, int16_t y, uint16_t n, uint16_t color);
336 
345 
351 void SSD1306_OutClear(void);
352 
361 void SSD1306_DrawFullImage(const uint8_t *ptr);
362 
395 void SSD1306_DrawBMP(uint8_t xpos, uint8_t ypos, const uint8_t *ptr, uint8_t threshold, uint16_t color);
396 
405 void SSD1306_SetCursor(uint16_t newX, uint16_t newY);
406 
421 void SSD1306_OutChar(char data);
422 
432 void SSD1306_OutString(char *ptr);
433 
442 void SSD1306_OutUDec(uint16_t n);
443 
452 void SSD1306_OutSDec(int16_t n);
453 
463 void SSD1306_OutUFix1(uint16_t n);
464 
465 
475 void SSD1306_OutU3Fix1(uint16_t n);
476 
486 void SSD1306_OutSFix1(int32_t n);
487 
496 void SSD1306_OutHex7(uint8_t n);
497 
506 void SSD1306_OutUHex7(uint8_t n);
507 
516 void SSD1306_OutUHex32(uint32_t n);
517 
526 void SSD1306_OutUDec16(uint32_t n);
527 
536 void SSD1306_OutUDec2(uint32_t n);
537 
549 void SSD1306_SetPlot(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY, uint16_t color);
561 void SSD1306_DrawPoint(int32_t x, int32_t y);
562 
568 #endif // _SSD1306_H_
void SSD1306_DrawPoint(int32_t x, int32_t y)
Set/clear/invert a single pixel. SSD1306_SetPlot initializes scaling.
void SSD1306_SetCursor(uint16_t newX, uint16_t newY)
void SSD1306_DrawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Draw a vertical line. This is also invoked by the Adafruit_GFX library in generating many higher-leve...
void SSD1306_startscrollleft(uint8_t start, uint8_t stop)
Activate a left-handed scroll for all or part of the display.
void SSD1306_OutHex7(uint8_t n)
Print one hex digit.
void SSD1306_SetPlot(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY, uint16_t color)
Initialize parameters for plotting.
void SSD1306_Dim(int dim)
Dim the display.
void SSD1306_OutUHex32(uint32_t n)
Print 16 hex digits.
void SSD1306_startscrolldiagright(uint8_t start, uint8_t stop)
Activate a diagonal scroll for all or part of the display.
void SSD1306_OutString(char *ptr)
Print a string of characters to the OLED.
void SSD1306_DrawChar(int16_t x, int16_t y, char letter, uint16_t color)
Draw a character.
void SSD1306_OutUDec16(uint32_t n)
Print three decimal digits.
void SSD1306_stopscroll(void)
Cease a previously-begun scrolling action.
void SSD1306_DrawUDec(int16_t x, int16_t y, uint16_t n, uint16_t color)
Draw a 3 digit integer.
void SSD1306_startscrolldiagleft(uint8_t start, uint8_t stop)
Activate alternate diagonal scroll for all or part of the display.
void SSD1306_OutBuffer(void)
void SSD1306_startscrollright(uint8_t start, uint8_t stop)
Activate a right-handed scroll for all or part of the display.
void SSD1306_OutU3Fix1(uint16_t n)
Print a 16-bit unsigned fixed-point number to the OLED.
void SSD1306_OutUHex7(uint8_t n)
Print two hex digits.
void SSD1306_InitPrintf(void)
Initialize the SSD1306 for printf.
void SSD1306_DrawString(int16_t x, int16_t y, char *pt, uint16_t color)
Draw a string.
void SSD1306_OutUFix1(uint16_t n)
Print a 16-bit unsigned fixed-point number to the OLED.
int SSD1306_GetPixel(int16_t x, int16_t y)
Return color of a single pixel in display buffer.
void SSD1306_ClearBuffer(void)
Clear contents of display buffer (set all pixels to off).
void SSD1306_DrawPixel(int16_t x, int16_t y, uint16_t color)
Set/clear/invert a single pixel. This is also invoked by the Adafruit_GFX library in generating many ...
void SSD1306_DrawFullImage(const uint8_t *ptr)
Fill the whole screen by drawing a 128x64 bitmap image.
int SSD1306_Init(int vccst)
II2 driver for SSD1306 OLED display.
void SSD1306_OutSDec(int16_t n)
Print a 16-bit signed number to the OLED.
void SSD1306_InvertDisplay(int i)
Enable or disable display invert mode (white-on-black vs black-on-white).
void SSD1306_OutUDec2(uint32_t n)
Print two decimal digits.
uint8_t * SSD1306_getBuffer(void)
Get base address of display buffer for direct reading or writing.
void SSD1306_DrawBMP(uint8_t xpos, uint8_t ypos, const uint8_t *ptr, uint8_t threshold, uint16_t color)
Draw a raw bitmap to the RAM buffer.
void SSD1306_DrawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
Draw a horizontal line. This is also invoked by the Adafruit_GFX library in generating many higher-le...
void SSD1306_OutUDec(uint16_t n)
Print a 16-bit unsigned number to the OLED.
void SSD1306_OutChar(char data)
Print a character to the OLED.
void SSD1306_OutSFix1(int32_t n)
Print a 32-bit signed fixed-point number to the OLED.
void SSD1306_OutClear(void)
Clear the LCD by writing zeros to the entire screen and reset the cursor to (0,0) (top left corner of...