ssd1306xled 1.0.0
SSD1306/SSD1315/SSH1106 OLED driver for ATtiny85
Loading...
Searching...
No Matches
ssd1306xled.h File Reference

Driver for SSD1306, SSD1315, and SSH1106 OLED displays. More...

#include <stdint.h>
#include <Arduino.h>
#include <util/delay.h>
Include dependency graph for ssd1306xled.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  SSD1306Device
 Driver for SSD1306-family OLED displays over bit-banged I2C. More...
 

Macros

#define _SSD1306XLED_TINY_INIT_SUPPORTED_
 
#define _SSD1306XLED_INIT_VERTICAL_SUPPORTED_
 
#define SSD1306_SCL   PB2
 
#define SSD1306_SDA   PB0
 
#define SSD1306_SA   0X3C
 
#define DDR_USI   DDRB
 
#define PORT_USI   PORTB
 
#define PIN_USI   PINB
 
#define PORT_USI_SDA   PORTB0
 
#define PORT_USI_SCL   PORTB2
 
#define PIN_USI_SDA   PINB0
 
#define PIN_USI_SCL   PINB2
 
#define DDR_USI_CL   DDR_USI
 
#define PORT_USI_CL   PORT_USI
 
#define PIN_USI_CL   PIN_USI
 
#define TWI_FAST_MODE
 
#define DELAY_T2TWI   (_delay_us(2))
 
#define DELAY_T4TWI   (_delay_us(1))
 
#define TWI_NACK_BIT   0
 
#define SSD1306_COMMAND   0x00
 
#define SSD1306_DATA   0x40
 
#define SSD1306_NO_FONT_6X8
 
#define SSD1306_NO_FONT_8X16
 
#define SSD1306_NO_DRAW_BMP
 
#define SSD1306_QUICK_BEGIN
 

Variables

const unsigned char USISR_8bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0x0<<USICNT0
 
const unsigned char USISR_1bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0xE<<USICNT0
 
SSD1306Device SSD1306
 Global driver instance.
 

Detailed Description

Driver for SSD1306, SSD1315, and SSH1106 OLED displays.

Bit-bangs I2C via the ATtiny85 USI peripheral. No Wire library needed – saves about 1 KB of flash compared to TinyWireM. Works on any AVR with USI by redefining the pin macros.

Originally by Neven Boyanov (Tinusaur). I2C rewrite based on TinyI2C by David Johnson-Davies. Maintained by Tejashwi Kalp Taru.

Version
1.0.0
See also
https://github.com/tejashwikalptaru/ssd1306xled

Macro Definition Documentation

◆ _SSD1306XLED_INIT_VERTICAL_SUPPORTED_

#define _SSD1306XLED_INIT_VERTICAL_SUPPORTED_

◆ _SSD1306XLED_TINY_INIT_SUPPORTED_

#define _SSD1306XLED_TINY_INIT_SUPPORTED_

◆ DDR_USI

#define DDR_USI   DDRB

◆ DDR_USI_CL

#define DDR_USI_CL   DDR_USI

◆ DELAY_T2TWI

#define DELAY_T2TWI   (_delay_us(2))

◆ DELAY_T4TWI

#define DELAY_T4TWI   (_delay_us(1))

◆ PIN_USI

#define PIN_USI   PINB

◆ PIN_USI_CL

#define PIN_USI_CL   PIN_USI

◆ PIN_USI_SCL

#define PIN_USI_SCL   PINB2

◆ PIN_USI_SDA

#define PIN_USI_SDA   PINB0

◆ PORT_USI

#define PORT_USI   PORTB

◆ PORT_USI_CL

#define PORT_USI_CL   PORT_USI

◆ PORT_USI_SCL

#define PORT_USI_SCL   PORTB2

◆ PORT_USI_SDA

#define PORT_USI_SDA   PORTB0

◆ SSD1306_COMMAND

#define SSD1306_COMMAND   0x00

I2C control byte: next bytes are commands.

◆ SSD1306_DATA

#define SSD1306_DATA   0x40

I2C control byte: next bytes are display data.

◆ TWI_FAST_MODE

#define TWI_FAST_MODE

◆ TWI_NACK_BIT

#define TWI_NACK_BIT   0

Variable Documentation

◆ SSD1306

SSD1306Device SSD1306
extern

Global driver instance.

Use this to call all display functions. Do not create additional instances.

SSD1306.ssd1306_string_font6x8("hello");
void ssd1306_init(void)
Initialize the display and clear the screen.
Definition ssd1306xled.cpp:241
SSD1306Device SSD1306
Global driver instance.
Definition ssd1306xled.cpp:607

◆ USISR_1bit

const unsigned char USISR_1bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0xE<<USICNT0

◆ USISR_8bit

const unsigned char USISR_8bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0x0<<USICNT0