DIY Logging Volt/Ampmeter
ssd1306.h File Reference
#include <stddef.h>
#include <_ansi.h>
#include "ssd1306_conf.h"
#include "stm32f1xx_hal.h"
#include "ssd1306_fonts.h"

Go to the source code of this file.

Data Structures

struct  SSD1306_t
 
struct  SSD1306_VERTEX
 

Macros

#define SSD1306_SPI_PORT   hspi2
 
#define SSD1306_CS_Port   GPIOB
 
#define SSD1306_CS_Pin   GPIO_PIN_12
 
#define SSD1306_DC_Port   GPIOB
 
#define SSD1306_DC_Pin   GPIO_PIN_14
 
#define SSD1306_Reset_Port   GPIOA
 
#define SSD1306_Reset_Pin   GPIO_PIN_8
 
#define SSD1306_HEIGHT   64
 
#define SSD1306_BUFFER_SIZE   SSD1306_WIDTH * SSD1306_HEIGHT / 8
 

Enumerations

enum  SSD1306_COLOR { Black = 0x00, White = 0x01 }
 
enum  SSD1306_Error_t { SSD1306_OK = 0x00, SSD1306_ERR = 0x01 }
 

Functions

void ssd1306_SelectDisplay (uint8_t display)
 
void ssd1306_Init (void)
 
void ssd1306_Fill (SSD1306_COLOR color)
 
void ssd1306_UpdateScreen (void)
 
void ssd1306_DrawPixel (uint8_t x, uint8_t y, SSD1306_COLOR color)
 
char ssd1306_WriteChar (char ch, FontDef Font, SSD1306_COLOR color)
 
char ssd1306_WriteString (char *str, FontDef Font, SSD1306_COLOR color)
 
void ssd1306_SetCursor (uint8_t x, uint8_t y)
 
void ssd1306_Line (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, SSD1306_COLOR color)
 
void ssd1306_DrawArc (uint8_t x, uint8_t y, uint8_t radius, uint16_t start_angle, uint16_t sweep, SSD1306_COLOR color)
 
void ssd1306_DrawCircle (uint8_t par_x, uint8_t par_y, uint8_t par_r, SSD1306_COLOR color)
 
void ssd1306_Polyline (const SSD1306_VERTEX *par_vertex, uint16_t par_size, SSD1306_COLOR color)
 
void ssd1306_DrawRectangle (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, SSD1306_COLOR color)
 
void ssd1306_SetContrast (const uint8_t value)
 Sets the contrast of the display. More...
 
void ssd1306_SetDisplayOn (const uint8_t on)
 Set Display ON/OFF. More...
 
uint8_t ssd1306_GetDisplayOn ()
 Reads DisplayOn state. More...
 
void ssd1306_Reset (void)
 
void ssd1306_WriteCommand (uint8_t byte)
 
void ssd1306_WriteData (uint8_t *buffer, size_t buff_size)
 
SSD1306_Error_t ssd1306_FillBuffer (uint8_t *buf, uint32_t len)
 

Variables

I2C_HandleTypeDef hi2c1
 

Macro Definition Documentation

◆ SSD1306_BUFFER_SIZE

#define SSD1306_BUFFER_SIZE   SSD1306_WIDTH * SSD1306_HEIGHT / 8

Definition at line 101 of file ssd1306.h.

◆ SSD1306_CS_Pin

#define SSD1306_CS_Pin   GPIO_PIN_12

Definition at line 63 of file ssd1306.h.

◆ SSD1306_CS_Port

#define SSD1306_CS_Port   GPIOB

Definition at line 60 of file ssd1306.h.

◆ SSD1306_DC_Pin

#define SSD1306_DC_Pin   GPIO_PIN_14

Definition at line 70 of file ssd1306.h.

◆ SSD1306_DC_Port

#define SSD1306_DC_Port   GPIOB

Definition at line 67 of file ssd1306.h.

◆ SSD1306_HEIGHT

#define SSD1306_HEIGHT   64

Definition at line 92 of file ssd1306.h.

◆ SSD1306_Reset_Pin

#define SSD1306_Reset_Pin   GPIO_PIN_8

Definition at line 77 of file ssd1306.h.

◆ SSD1306_Reset_Port

#define SSD1306_Reset_Port   GPIOA

Definition at line 74 of file ssd1306.h.

◆ SSD1306_SPI_PORT

#define SSD1306_SPI_PORT   hspi2

This Library was originally written by Olivier Van den Eede (4ilo) in 2016. Some refactoring was done and SPI support was added by Aleksander Alekseev (afiskon) in 2018.

https://github.com/afiskon/stm32-ssd1306

Definition at line 56 of file ssd1306.h.

Enumeration Type Documentation

◆ SSD1306_COLOR

Enumerator
Black 
White 

Definition at line 105 of file ssd1306.h.

105  {
106  Black = 0x00, /* Black color, no pixel */
107  White = 0x01 /* Pixel is set. Color depends on OLED */
108 } SSD1306_COLOR;

◆ SSD1306_Error_t

Enumerator
SSD1306_OK 
SSD1306_ERR 

Definition at line 110 of file ssd1306.h.

110  {
111  SSD1306_OK = 0x00,
112  SSD1306_ERR = 0x01 /* Generic error. */

Function Documentation

◆ ssd1306_DrawArc()

void ssd1306_DrawArc ( uint8_t  x,
uint8_t  y,
uint8_t  radius,
uint16_t  start_angle,
uint16_t  sweep,
SSD1306_COLOR  color 
)

Definition at line 429 of file ssd1306.c.

429  {
430  #define CIRCLE_APPROXIMATION_SEGMENTS 36
431  float approx_degree;
432  uint32_t approx_segments;
433  uint8_t xp1;
434  uint8_t xp2;
435  uint8_t yp1;
436  uint8_t yp2;
437  uint32_t count = 0;
438  uint32_t loc_sweep = 0;
439  float rad;
440 
441  loc_sweep = ssd1306_NormalizeTo0_360(sweep);
442 
443  count = (ssd1306_NormalizeTo0_360(start_angle) * CIRCLE_APPROXIMATION_SEGMENTS) / 360;
444  approx_segments = (loc_sweep * CIRCLE_APPROXIMATION_SEGMENTS) / 360;
445  approx_degree = loc_sweep / (float)approx_segments;
446  while(count < approx_segments)
447  {
448  rad = ssd1306_DegToRad(count*approx_degree);
449  xp1 = x + (int8_t)(sin(rad)*radius);
450  yp1 = y + (int8_t)(cos(rad)*radius);
451  count++;
452  if(count != approx_segments)
453  {
454  rad = ssd1306_DegToRad(count*approx_degree);
455  }
456  else
457  {
458  rad = ssd1306_DegToRad(loc_sweep);
459  }
460  xp2 = x + (int8_t)(sin(rad)*radius);
461  yp2 = y + (int8_t)(cos(rad)*radius);
462  ssd1306_Line(xp1,yp1,xp2,yp2,color);
463  }
464 
465  return;
466 }

◆ ssd1306_DrawCircle()

void ssd1306_DrawCircle ( uint8_t  par_x,
uint8_t  par_y,
uint8_t  par_r,
SSD1306_COLOR  color 
)

Definition at line 468 of file ssd1306.c.

468  {
469  int32_t x = -par_r;
470  int32_t y = 0;
471  int32_t err = 2 - 2 * par_r;
472  int32_t e2;
473 
474  if (par_x >= SSD1306_WIDTH || par_y >= SSD1306_HEIGHT) {
475  return;
476  }
477 
478  do {
479  ssd1306_DrawPixel(par_x - x, par_y + y, par_color);
480  ssd1306_DrawPixel(par_x + x, par_y + y, par_color);
481  ssd1306_DrawPixel(par_x + x, par_y - y, par_color);
482  ssd1306_DrawPixel(par_x - x, par_y - y, par_color);
483  e2 = err;
484  if (e2 <= y) {
485  y++;
486  err = err + (y * 2 + 1);
487  if(-x == y && e2 <= x) {
488  e2 = 0;
489  }
490  else
491  {
492  /* nothing to do */
493  }
494  }
495  else
496  {
497  /* nothing to do */
498  }
499  if(e2 > x) {
500  x++;
501  err = err + (x * 2 + 1);
502  }
503  else
504  {
505  /* nothing to do */
506  }
507  } while(x <= 0);
508 
509  return;
510 }

◆ ssd1306_DrawPixel()

void ssd1306_DrawPixel ( uint8_t  x,
uint8_t  y,
SSD1306_COLOR  color 
)

Definition at line 239 of file ssd1306.c.

239  {
240  if(x >= SSD1306_WIDTH || y >= SSD1306_HEIGHT) {
241  /* Don't write outside the buffer */
242  return;
243  }
244 
245  /* Check if pixel should be inverted */
246  if (ssd1306Display == 0)
247  {
248  if(SSD1306Left.Inverted) {
249  color = (SSD1306_COLOR)!color;
250  }
251  }
252  else if (ssd1306Display == 1)
253  {
254  if(SSD1306Right.Inverted) {
255  color = (SSD1306_COLOR)!color;
256  }
257  }
258 
259 
260  /* Draw in the right color */
261  if(color == White) {
262  if (ssd1306Display == 0) SSD1306_BufferLeft[x + (y / 8) * SSD1306_WIDTH] |= 1 << (y % 8);
263  else if (ssd1306Display == 1) SSD1306_BufferRight[x + (y / 8) * SSD1306_WIDTH] |= 1 << (y % 8);
264  } else {
265  if (ssd1306Display == 0) SSD1306_BufferLeft[x + (y / 8) * SSD1306_WIDTH] &= ~(1 << (y % 8));
266  else if (ssd1306Display == 1) SSD1306_BufferRight[x + (y / 8) * SSD1306_WIDTH] &= ~(1 << (y % 8));
267  }
268 }

◆ ssd1306_DrawRectangle()

void ssd1306_DrawRectangle ( uint8_t  x1,
uint8_t  y1,
uint8_t  x2,
uint8_t  y2,
SSD1306_COLOR  color 
)

Definition at line 513 of file ssd1306.c.

513  {
514  ssd1306_Line(x1,y1,x2,y1,color);
515  ssd1306_Line(x2,y1,x2,y2,color);
516  ssd1306_Line(x2,y2,x1,y2,color);
517  ssd1306_Line(x1,y2,x1,y1,color);
518 
519  return;
520 }

◆ ssd1306_Fill()

void ssd1306_Fill ( SSD1306_COLOR  color)

Definition at line 199 of file ssd1306.c.

199  {
200  /* Set memory */
201  uint32_t i;
202 
203  if (ssd1306Display == 0)
204  {
205  for(i = 0; i < sizeof(SSD1306_BufferLeft); i++) {
206  SSD1306_BufferLeft[i] = (color == Black) ? 0x00 : 0xFF;
207  }
208  }
209  else if (ssd1306Display == 1)
210  {
211  for(i = 0; i < sizeof(SSD1306_BufferRight); i++) {
212  SSD1306_BufferRight[i] = (color == Black) ? 0x00 : 0xFF;
213  }
214  }
215 
216 
217 }

◆ ssd1306_FillBuffer()

SSD1306_Error_t ssd1306_FillBuffer ( uint8_t *  buf,
uint32_t  len 
)

Definition at line 83 of file ssd1306.c.

83  {
85  if (len <= SSD1306_BUFFER_SIZE) {
86  if (ssd1306Display == 0) memcpy(SSD1306_BufferLeft,buf,len);
87  else if (ssd1306Display == 1) memcpy(SSD1306_BufferRight,buf,len);
88  ret = SSD1306_OK;
89  }
90  return (ret);
91 }

◆ ssd1306_GetDisplayOn()

uint8_t ssd1306_GetDisplayOn ( )

Reads DisplayOn state.

Returns
0: OFF. 1: ON.

Definition at line 542 of file ssd1306.c.

542  {
543  if (ssd1306Display == 0) return (SSD1306Left.DisplayOn);
544  else if (ssd1306Display == 1) return (SSD1306Right.DisplayOn);
545  return (0);
546 }

◆ ssd1306_Init()

void ssd1306_Init ( void  )

Definition at line 94 of file ssd1306.c.

94  {
95  /* Reset OLED */
96  ssd1306_Reset();
97 
98  /* Wait for the screen to boot */
99  LL_mDelay(100);
100 
101  /* Init OLED */
102  ssd1306_SetDisplayOn(0); /* display off */
103 
104  ssd1306_WriteCommand(0x20); /* Set Memory Addressing Mode */
105  ssd1306_WriteCommand(0x00); /* 00b,Horizontal Addressing Mode; 01b,Vertical Addressing Mode; */
106  /* 10b,Page Addressing Mode (RESET); 11b,Invalid */
107 
108  ssd1306_WriteCommand(0xB0); /*Set Page Start Address for Page Addressing Mode,0-7 */
109 
110 #ifdef SSD1306_MIRROR_VERT
111  ssd1306_WriteCommand(0xC0); /* Mirror vertically */
112 #else
113  ssd1306_WriteCommand(0xC8); /* Set COM Output Scan Direction */
114 #endif
115 
116  ssd1306_WriteCommand(0x00); /* ---set low column address */
117  ssd1306_WriteCommand(0x10); /* ---set high column address */
118 
119  ssd1306_WriteCommand(0x40); /* --set start line address - CHECK */
120 
121  ssd1306_SetContrast(0xFF);
122 
123 #ifdef SSD1306_MIRROR_HORIZ
124  ssd1306_WriteCommand(0xA0); /* Mirror horizontally */
125 #else
126  ssd1306_WriteCommand(0xA1); /* --set segment re-map 0 to 127 - CHECK */
127 #endif
128 
129 #ifdef SSD1306_INVERSE_COLOR
130  ssd1306_WriteCommand(0xA7); /* --set inverse color */
131 #else
132  ssd1306_WriteCommand(0xA6); /* --set normal color */
133 #endif
134 
135 /* Set multiplex ratio. */
136 #if (SSD1306_HEIGHT == 128)
137  /* Found in the Luma Python lib for SH1106. */
138  ssd1306_WriteCommand(0xFF);
139 #else
140  ssd1306_WriteCommand(0xA8); /* --set multiplex ratio(1 to 64) - CHECK */
141 #endif
142 
143 #if (SSD1306_HEIGHT == 32)
144  ssd1306_WriteCommand(0x1F);
145 #elif (SSD1306_HEIGHT == 64)
146  ssd1306_WriteCommand(0x3F);
147 #elif (SSD1306_HEIGHT == 128)
148  ssd1306_WriteCommand(0x3F); /* Seems to work for 128px high displays too. */
149 #else
150 #error "Only 32, 64, or 128 lines of height are supported!"
151 #endif
152 
153  ssd1306_WriteCommand(0xA4); /* 0xa4,Output follows RAM content;0xa5,Output ignores RAM content */
154 
155  ssd1306_WriteCommand(0xD3); /* -set display offset - CHECK */
156  ssd1306_WriteCommand(0x00); /* -not offset */
157 
158  ssd1306_WriteCommand(0xD5); /* --set display clock divide ratio/oscillator frequency */
159  ssd1306_WriteCommand(0xF0); /* --set divide ratio */
160 
161  ssd1306_WriteCommand(0xD9); /* --set pre-charge period */
162  ssd1306_WriteCommand(0x22);
163 
164  ssd1306_WriteCommand(0xDA); /* --set com pins hardware configuration - CHECK */
165 #if (SSD1306_HEIGHT == 32)
166  ssd1306_WriteCommand(0x02);
167 #elif (SSD1306_HEIGHT == 64)
168  ssd1306_WriteCommand(0x12);
169 #elif (SSD1306_HEIGHT == 128)
170  ssd1306_WriteCommand(0x12);
171 #else
172 #error "Only 32, 64, or 128 lines of height are supported!"
173 #endif
174 
175  ssd1306_WriteCommand(0xDB); /* --set vcomh */
176  ssd1306_WriteCommand(0x20); /* 0x20,0.77xVcc */
177 
178  ssd1306_WriteCommand(0x8D); /* --set DC-DC enable */
179  ssd1306_WriteCommand(0x14);
180  ssd1306_SetDisplayOn(1); /* --turn on SSD1306 panel */
181 
182  /* Clear screen */
184 
185  /* Flush buffer to screen */
187 
188  /* Set default values for screen object */
189  if (ssd1306Display == 0) SSD1306Left.CurrentX = 0;
190  else if (ssd1306Display == 1) SSD1306Right.CurrentX = 0;
191  if (ssd1306Display == 0) SSD1306Left.CurrentY = 0;
192  else if (ssd1306Display == 1) SSD1306Right.CurrentY = 0;
193 
194  if (ssd1306Display == 0) SSD1306Left.Initialized = 1;
195  else if (ssd1306Display == 1) SSD1306Right.Initialized = 1;
196 }

◆ ssd1306_Line()

void ssd1306_Line ( uint8_t  x1,
uint8_t  y1,
uint8_t  x2,
uint8_t  y2,
SSD1306_COLOR  color 
)

Definition at line 358 of file ssd1306.c.

358  {
359  int32_t deltaX = abs(x2 - x1);
360  int32_t deltaY = abs(y2 - y1);
361  int32_t signX = ((x1 < x2) ? 1 : -1);
362  int32_t signY = ((y1 < y2) ? 1 : -1);
363  int32_t error = deltaX - deltaY;
364  int32_t error2;
365 
366  ssd1306_DrawPixel(x2, y2, color);
367  while((x1 != x2) || (y1 != y2))
368  {
369  ssd1306_DrawPixel(x1, y1, color);
370  error2 = error * 2;
371  if(error2 > -deltaY)
372  {
373  error -= deltaY;
374  x1 += signX;
375  }
376  else
377  {
378  /* nothing to do */
379  }
380 
381  if(error2 < deltaX)
382  {
383  error += deltaX;
384  y1 += signY;
385  }
386  else
387  {
388  /* nothing to do */
389  }
390  }
391  return;
392 }

◆ ssd1306_Polyline()

void ssd1306_Polyline ( const SSD1306_VERTEX par_vertex,
uint16_t  par_size,
SSD1306_COLOR  color 
)

Definition at line 394 of file ssd1306.c.

394  {
395  uint16_t i;
396  if(par_vertex != 0){
397  for(i = 1; i < par_size; i++){
398  ssd1306_Line(par_vertex[i - 1].x, par_vertex[i - 1].y, par_vertex[i].x, par_vertex[i].y, color);
399  }
400  }
401  else
402  {
403  /* nothing to do */
404  }
405  return;
406 }

◆ ssd1306_Reset()

void ssd1306_Reset ( void  )

Definition at line 15 of file ssd1306.c.

15  {
16  /* For I2C - do nothing */
17 }

◆ ssd1306_SelectDisplay()

void ssd1306_SelectDisplay ( uint8_t  display)

Definition at line 19 of file ssd1306.c.

20 {
21  ssd1306Display = display;
22 
23  /* Left display selected */
24  if (display == 0) ssd1306Address = 0x78;
25 
26  /* Right display selected */
27  if (display == 1) ssd1306Address = 0x7A;
28 }

◆ ssd1306_SetContrast()

void ssd1306_SetContrast ( const uint8_t  value)

Sets the contrast of the display.

Parameters
[in]valuecontrast to set.
Note
Contrast increases as the value increases.
RESET = 7Fh.

Definition at line 522 of file ssd1306.c.

522  {
523  const uint8_t kSetContrastControlRegister = 0x81;
524  ssd1306_WriteCommand(kSetContrastControlRegister);
525  ssd1306_WriteCommand(value);
526 }

◆ ssd1306_SetCursor()

void ssd1306_SetCursor ( uint8_t  x,
uint8_t  y 
)

Definition at line 344 of file ssd1306.c.

344  {
345  if (ssd1306Display == 0)
346  {
347  SSD1306Left.CurrentX = x;
348  SSD1306Left.CurrentY = y;
349  }
350  else if (ssd1306Display == 1)
351  {
354  }
355 }

◆ ssd1306_SetDisplayOn()

void ssd1306_SetDisplayOn ( const uint8_t  on)

Set Display ON/OFF.

Parameters
[in]on0 for OFF, any for ON.

Definition at line 528 of file ssd1306.c.

528  {
529  uint8_t value;
530  if (on) {
531  value = 0xAF; /* Display on */
532  if (ssd1306Display == 0) SSD1306Left.DisplayOn = 1;
533  else if (ssd1306Display == 1) SSD1306Right.DisplayOn = 1;
534  } else {
535  value = 0xAE; /* Display off */
536  if (ssd1306Display == 0) SSD1306Left.DisplayOn = 0;
537  else if (ssd1306Display == 1) SSD1306Right.DisplayOn = 0;
538  }
539  ssd1306_WriteCommand(value);
540 }

◆ ssd1306_UpdateScreen()

void ssd1306_UpdateScreen ( void  )

Definition at line 220 of file ssd1306.c.

220  {
221  /* Write data to each page of RAM. Number of pages
222  * depends on the screen height:
223  * - 32px == 4 pages
224  * - 64px == 8 pages
225  * - 128px == 16 pages */
226  for(uint8_t i = 0; i < SSD1306_HEIGHT/8; i++) {
227  ssd1306_WriteCommand(0xB0 + i); /* Set the current RAM page address. */
228  ssd1306_WriteCommand(0x00);
229  ssd1306_WriteCommand(0x10);
232  }
233 }

◆ ssd1306_WriteChar()

char ssd1306_WriteChar ( char  ch,
FontDef  Font,
SSD1306_COLOR  color 
)

Definition at line 274 of file ssd1306.c.

274  {
275  uint32_t i;
276  uint32_t b;
277  uint32_t j;
278 
279  /* Check if character is valid */
280  if (ch < 32 || ch > 126)
281  return (0);
282 
283  /* Check remaining space on current line */
284  if (ssd1306Display == 0)
285  {
286  if (SSD1306_WIDTH < (SSD1306Left.CurrentX + Font.FontWidth) ||
288  {
289  /* Not enough space on current line */
290  return (0);
291  }
292  }
293  else if (ssd1306Display == 1)
294  {
295  if (SSD1306_WIDTH < (SSD1306Right.CurrentX + Font.FontWidth) ||
297  {
298  /* Not enough space on current line */
299  return (0);
300  }
301  }
302 
303 
304  /* Use the font to write */
305  for(i = 0; i < Font.FontHeight; i++) {
306  b = Font.data[(ch - 32) * Font.FontHeight + i];
307  for(j = 0; j < Font.FontWidth; j++) {
308  if((b << j) & 0x8000) {
311  } else {
314  }
315  }
316  }
317 
318  /* The current space is now taken */
319  if (ssd1306Display == 0) SSD1306Left.CurrentX += Font.FontWidth;
320  else if (ssd1306Display == 1) SSD1306Right.CurrentX += Font.FontWidth;
321 
322  /* Return written char for validation */
323  return (ch);
324 }

◆ ssd1306_WriteCommand()

void ssd1306_WriteCommand ( uint8_t  byte)

Definition at line 31 of file ssd1306.c.

31  {
33 }

◆ ssd1306_WriteData()

void ssd1306_WriteData ( uint8_t *  buffer,
size_t  buff_size 
)

Definition at line 36 of file ssd1306.c.

36  {
37  HAL_I2C_Mem_Write(&SSD1306_I2C_PORT, ssd1306Address, 0x40, 1, buffer, buff_size, HAL_MAX_DELAY);
38 }

◆ ssd1306_WriteString()

char ssd1306_WriteString ( char *  str,
FontDef  Font,
SSD1306_COLOR  color 
)

Definition at line 327 of file ssd1306.c.

327  {
328  /* Write until null-byte */
329  while (*str) {
330  if (ssd1306_WriteChar(*str, Font, color) != *str) {
331  /* Char could not be written */
332  return (*str);
333  }
334 
335  /* Next char */
336  str++;
337  }
338 
339  /* Everything ok */
340  return (*str);
341 }

Variable Documentation

◆ hi2c1

Definition at line 27 of file i2c.c.

ssd1306Address
uint8_t ssd1306Address
Definition: ssd1306.c:12
ssd1306Display
uint8_t ssd1306Display
Definition: ssd1306.c:13
SSD1306Right
static SSD1306_t SSD1306Right
Definition: ssd1306.c:80
SSD1306_COLOR
SSD1306_COLOR
Definition: ssd1306.h:105
Black
@ Black
Definition: ssd1306.h:106
ssd1306_UpdateScreen
void ssd1306_UpdateScreen(void)
Definition: ssd1306.c:220
ssd1306_WriteData
void ssd1306_WriteData(uint8_t *buffer, size_t buff_size)
Definition: ssd1306.c:36
HAL_I2C_Mem_Write
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
SSD1306_t::CurrentY
uint16_t CurrentY
Definition: ssd1306.h:118
LL_mDelay
void LL_mDelay(uint32_t Delay)
This function provides accurate delay (in milliseconds) based on SysTick counter flag.
Definition: stm32f1xx_ll_utils.c:182
SSD1306_t::Initialized
uint8_t Initialized
Definition: ssd1306.h:120
SSD1306_Error_t
SSD1306_Error_t
Definition: ssd1306.h:110
CIRCLE_APPROXIMATION_SEGMENTS
#define CIRCLE_APPROXIMATION_SEGMENTS
SSD1306_BufferLeft
static uint8_t SSD1306_BufferLeft[130 *64/8]
Definition: ssd1306.c:75
SSD1306_t::Inverted
uint8_t Inverted
Definition: ssd1306.h:119
ssd1306_SetContrast
void ssd1306_SetContrast(const uint8_t value)
Sets the contrast of the display.
Definition: ssd1306.c:522
ssd1306_WriteChar
char ssd1306_WriteChar(char ch, FontDef Font, SSD1306_COLOR color)
Definition: ssd1306.c:274
SSD1306_I2C_PORT
#define SSD1306_I2C_PORT
Definition: ssd1306_conf.h:24
FontDef::FontWidth
const uint8_t FontWidth
Definition: ssd1306_fonts.h:9
SSD1306_BUFFER_SIZE
#define SSD1306_BUFFER_SIZE
Definition: ssd1306.h:101
FontDef::data
const uint16_t * data
Definition: ssd1306_fonts.h:11
SSD1306_ERR
@ SSD1306_ERR
Definition: ssd1306.h:112
FontDef::FontHeight
uint8_t FontHeight
Definition: ssd1306_fonts.h:10
SSD1306_BufferRight
static uint8_t SSD1306_BufferRight[130 *64/8]
Definition: ssd1306.c:76
SSD1306_t::CurrentX
uint16_t CurrentX
Definition: ssd1306.h:117
ssd1306_WriteCommand
void ssd1306_WriteCommand(uint8_t byte)
Definition: ssd1306.c:31
ssd1306_Reset
void ssd1306_Reset(void)
Definition: ssd1306.c:15
ssd1306_DegToRad
static float ssd1306_DegToRad(float par_deg)
Definition: ssd1306.c:408
SSD1306_OK
@ SSD1306_OK
Definition: ssd1306.h:111
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f1xx_hal_def.h:57
SSD1306_t::DisplayOn
uint8_t DisplayOn
Definition: ssd1306.h:121
SSD1306Left
static SSD1306_t SSD1306Left
Definition: ssd1306.c:79
SSD1306_HEIGHT
#define SSD1306_HEIGHT
Definition: ssd1306.h:92
ssd1306_Line
void ssd1306_Line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, SSD1306_COLOR color)
Definition: ssd1306.c:358
ssd1306_DrawPixel
void ssd1306_DrawPixel(uint8_t x, uint8_t y, SSD1306_COLOR color)
Definition: ssd1306.c:239
White
@ White
Definition: ssd1306.h:107
SSD1306_WIDTH
#define SSD1306_WIDTH
Definition: ssd1306_conf.h:52
ssd1306_NormalizeTo0_360
static uint16_t ssd1306_NormalizeTo0_360(uint16_t par_deg)
Definition: ssd1306.c:412
ssd1306_Fill
void ssd1306_Fill(SSD1306_COLOR color)
Definition: ssd1306.c:199
ssd1306_SetDisplayOn
void ssd1306_SetDisplayOn(const uint8_t on)
Set Display ON/OFF.
Definition: ssd1306.c:528