SSD1306 OLED display driver  1.8.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Classes | Macros | Typedefs | Enumerations
nano_gfx_types.h File Reference
#include "ssd1306_hal/io.h"

Go to the source code of this file.

Classes

struct  SFontHeaderRecord
 
struct  SUnicodeBlockRecord
 
struct  SFixedFontInfo
 
struct  SCharInfo
 
struct  SSD1306_RECT
 
struct  SPRITE
 

Macros

#define min(a, b)   ((a)<(b)?(a):(b))
 
#define max(a, b)   ((a)>(b)?(a):(b))
 
#define RGB_COLOR8(r, g, b)   ( (r & 0xE0) | ((g >> 3)&0x1C) | (b>>6) )
 
#define RGB_COLOR16(r, g, b)   ( ((r<<8) & 0xF800) | ((g << 3)&0x07E0) | (b>>3) )
 
#define RGB8_TO_RGB16(c)
 
#define RGB8_TO_GRAY4(rgb)   ( (rgb >> 6) + ((rgb >> 2) & 0x07) + (rgb & 0x03) )
 
#define GRAY_COLOR4(gray)   ( ((gray >> 4) & 0x0F) | (gray & 0xF0) )
 
#define RGB16_TO_RGB8(c)
 

Typedefs

typedef void(* InitFunction) (void)
 
typedef struct SPRITE SPRITE
 

Enumerations

enum  EFontStyle { STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC }
 
enum  EFontSize { FONT_SIZE_NORMAL = 0, FONT_SIZE_2X = 1, FONT_SIZE_4X = 2, FONT_SIZE_8X = 3 }
 

Detailed Description

Basic structures of nano gfx library

Definition in file nano_gfx_types.h.

Macro Definition Documentation

◆ GRAY_COLOR4

#define GRAY_COLOR4 (   gray)    ( ((gray >> 4) & 0x0F) | (gray & 0xF0) )

Macro to generate 4-bit monochrome color from gray component

Definition at line 58 of file nano_gfx_types.h.

◆ max

#define max (   a,
 
)    ((a)>(b)?(a):(b))

Macros returning maximum of 2 numbers

Definition at line 40 of file nano_gfx_types.h.

◆ min

#define min (   a,
 
)    ((a)<(b)?(a):(b))

Macros returning minimum of 2 numbers

Definition at line 35 of file nano_gfx_types.h.

◆ RGB16_TO_RGB8

#define RGB16_TO_RGB8 (   c)
Value:
( ((uint16_t)(c >> 8) & 0b11100000) | \
((uint16_t)(c >> 6) & 0b00011100) | \
((uint16_t)(c >> 3) & 0b00000011) )

Macro to convert 5-6-5 color to 3-3-2 color

Definition at line 61 of file nano_gfx_types.h.

◆ RGB8_TO_GRAY4

#define RGB8_TO_GRAY4 (   rgb)    ( (rgb >> 6) + ((rgb >> 2) & 0x07) + (rgb & 0x03) )

Macro to convert 8-bit RGB to 4-bit monochrome format

Definition at line 55 of file nano_gfx_types.h.

◆ RGB8_TO_RGB16

#define RGB8_TO_RGB16 (   c)
Value:
( (((uint16_t)c & 0b11100000) << 8) | \
(((uint16_t)c & 0b00011100) << 6) | \
(((uint16_t)c & 0b00000011) << 3) )

Macro to convert 3-3-2 color to 5-6-5 color

Definition at line 50 of file nano_gfx_types.h.

◆ RGB_COLOR16

#define RGB_COLOR16 (   r,
  g,
 
)    ( ((r<<8) & 0xF800) | ((g << 3)&0x07E0) | (b>>3) )

Macro to generate 16-bit color for SSD1351 OLED display

Definition at line 47 of file nano_gfx_types.h.

◆ RGB_COLOR8

#define RGB_COLOR8 (   r,
  g,
 
)    ( (r & 0xE0) | ((g >> 3)&0x1C) | (b>>6) )

Macro to generate 8-bit color for SSD1331 OLED display

Definition at line 44 of file nano_gfx_types.h.

Typedef Documentation

◆ InitFunction

typedef void(* InitFunction) (void)

Pointer type to LCD display initialization function

Definition at line 66 of file nano_gfx_types.h.

◆ SPRITE

typedef struct SPRITE SPRITE

SPRITE structure represents logical graphics object

Deprecated:
Use NanoSprite or NanoFixedSprite instead.

Enumeration Type Documentation

◆ EFontSize

enum EFontSize

Supported scale font values

Definition at line 77 of file nano_gfx_types.h.

◆ EFontStyle

enum EFontStyle

Supported font styles

Definition at line 69 of file nano_gfx_types.h.