Skip to content

Commit 1d6d8f4

Browse files
committed
Added section about hardware abstraction
1 parent ae97422 commit 1d6d8f4

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can either download this library as a zip file and unpack it to your Arduino
88

99
## Credits
1010
Many thanks go to Fabrice Weinberg (@FWeinb) for optimizing and refactoring the UI library.
11-
The init sequence for the SSD1306 was inspired by Adafruits library for the same display.
11+
The init sequence for the SSD1306 was inspired by Adafruit's library for the same display.
1212

1313
## Usage
1414

@@ -38,9 +38,39 @@ Choose the font family, style and size, check the preview image and if you like
3838

3939
![FontTool](https://github.com/squix78/esp8266-oled-ssd1306/raw/master/resources/FontTool.png)
4040

41+
## Hardware Abstraction
42+
43+
The library supports different protocols to access the OLED display. Currently there is support for I2C using the built in Wire.h library, I2C by using the much faster BRZO I2C library [https://github.com/pasko-zh/brzo_i2c] written in assembler and it also supports displays which come with the SPI interface.
44+
45+
### I2C with Wire.h
46+
47+
```C++
48+
#include <Wire.h>
49+
#include "SSD1306.h"
50+
51+
SSD1306 display(ADDRESS, SDA, SDC);
52+
```
53+
54+
### I2C with brzo_i2c
55+
56+
```C++
57+
#include <brzo_i2c.h>
58+
#include "SSD1306Brzo.h"
59+
60+
SSD1306Brzo display(ADDRESS, SDA, SDC);
61+
```
62+
### SPI
63+
64+
```C++
65+
#include <SPI.h>
66+
#include "SSD1306Spi.h"
67+
68+
SSD1306Spi display(RES, DC, CS);
69+
```
4170
4271
## API
4372
73+
4474
### Display Control
4575
4676
```C++

0 commit comments

Comments
 (0)