SSD1306 OLED display driver
1.5.6
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
src
hal
arduino
io.h
Go to the documentation of this file.
1
/*
2
MIT License
3
4
Copyright (c) 2018, Alexey Dynda
5
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in all
14
copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
SOFTWARE.
23
*/
24
29
#ifndef _SSD1306_ARDUINO_IO_H_
30
#define _SSD1306_ARDUINO_IO_H_
31
32
#ifdef ARDUINO
33
34
#if defined(ARDUINO_ARCH_STM32) // stm32duino support
35
#include <Arduino.h>
36
#include <avr/pgmspace.h>
37
#elif defined(ESP8266) || defined(ESP32) || defined(ESP31B) // esp arduino support
38
#include <Arduino.h>
39
#include <pgmspace.h>
40
#else // AVR support
41
#include <Arduino.h>
42
#include <avr/pgmspace.h>
43
#include <avr/interrupt.h>
44
#if !defined(ARDUINO_ARCH_SAMD)
45
#include <avr/sleep.h>
46
#endif
47
#endif
48
54
#if defined(ARDUINO_ARCH_STM32)
55
56
#define SSD1306_WIRE_SUPPORTED
57
58
#define SSD1306_WIRE_CLOCK_CONFIGURABLE
59
60
#define SSD1306_SPI_SUPPORTED
61
62
#elif defined(ARDUINO_AVR_DIGISPARK) || defined(ARDUINO_AVR_DIGISPARKPRO)
63
64
#define SSD1306_WIRE_SUPPORTED
65
#if defined(ARDUINO_AVR_DIGISPARKPRO)
66
67
#define SSD1306_SPI_SUPPORTED
68
#else
69
70
#define SSD1306_I2C_SW_SUPPORTED
71
/* Define lcdint as smallest types to reduce memo usage on tiny controllers. *
72
* Remember, that this can cause issues with large lcd displays, i.e. 320x240*/
73
#define LCDINT_TYPES_DEFINED
74
typedef
int8_t
lcdint_t
;
75
typedef
uint8_t
lcduint_t
;
76
#endif
77
78
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
79
80
#define SSD1306_I2C_SW_SUPPORTED
81
82
#define SSD1306_USI_SPI_SUPPORTED
83
/* Define lcdint as smallest types to reduce memo usage on tiny controllers. *
84
* Remember, that this can cause issues with large lcd displays, i.e. 320x240*/
85
#define LCDINT_TYPES_DEFINED
86
typedef
int8_t
lcdint_t
;
87
typedef
uint8_t
lcduint_t
;
88
89
#elif defined(ESP8266) || defined(ESP32) || defined(ESP31B) || defined(ARDUINO_ARCH_SAMD)
90
/* SW implementation of i2c isn't supported on ESP platforms */
92
#define SSD1306_WIRE_SUPPORTED
93
94
#define SSD1306_WIRE_CLOCK_CONFIGURABLE
95
96
#define SSD1306_SPI_SUPPORTED
97
98
#else
99
100
#define SSD1306_I2C_SW_SUPPORTED
101
102
#define SSD1306_WIRE_SUPPORTED
103
104
#define SSD1306_WIRE_CLOCK_CONFIGURABLE
105
106
#define SSD1306_TWI_SUPPORTED
107
108
#define SSD1306_SPI_SUPPORTED
109
110
#define SSD1306_AVR_SPI_SUPPORTED
111
#endif
112
117
#ifdef SSD1306_WIRE_SUPPORTED
118
#ifdef __cplusplus
119
#include <Wire.h>
120
#endif
121
#endif
122
123
#endif
/* ARDUINO */
124
125
#endif
126
lcduint_t
unsigned int lcduint_t
Definition:
io.h:42
lcdint_t
int lcdint_t
Definition:
io.h:40
Generated by
1.8.11