I2C address added to device descriptor

This commit is contained in:
UncleRus 2016-11-23 13:32:10 +05:00
parent 14c79a9ab8
commit 06086b0994
3 changed files with 14 additions and 5 deletions

View file

@ -21,6 +21,7 @@
#ifdef I2C_CONNECTION
#define PROTOCOL SSD1306_PROTO_I2C
#define ADDR SSD1306_I2C_ADDR_0
#define SCL_PIN 5
#define SDA_PIN 4
#else
@ -32,7 +33,9 @@
/* Declare device descriptor */
static const ssd1306_t dev = {
.protocol = PROTOCOL,
#ifndef I2C_CONNECTION
#ifdef I2C_CONNECTION
.addr = ADDR,
#else
.cs_pin = CS_PIN,
.dc_pin = DC_PIN,
#endif