Skip to content

Commit 3ae7029

Browse files
committed
Add new Pbs to match 6c842d81bf332dfc0fbfef4d2045c2d934e467f3
1 parent 420d319 commit 3ae7029

File tree

19 files changed

+207
-105
lines changed

19 files changed

+207
-105
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*!
2+
* @file WipperSnapper_I2C_Driver_Out_Ssd1306.h
3+
*
4+
* Device driver for SSD1306 Monochrome I2C OLED displays
5+
*
6+
* Adafruit invests time and resources providing this open source code,
7+
* please support Adafruit and open-source hardware by purchasing
8+
* products from Adafruit!
9+
*
10+
* Copyright (c) Brent Rubell for Adafruit Industries 2025
11+
*
12+
* MIT license, all text here must be included in any redistribution.
13+
*
14+
*/
15+
16+
#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H
17+
#define WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H
18+
19+
#include "WipperSnapper_I2C_Driver_Out.h"
20+
#include <Adafruit_GFX.h>
21+
#include <Adafruit_SSD1306.h>
22+
23+
24+
/*!
25+
@brief Class that provides a driver interface for SSD1306 OLED displays
26+
*/
27+
class WipperSnapper_I2C_Driver_Out_Ssd1306
28+
: public WipperSnapper_I2C_Driver_Out {
29+
30+
public:
31+
/*******************************************************************************/
32+
/*!
33+
@brief Constructor for an SSD1306 display.
34+
@param i2c
35+
The I2C interface.
36+
@param sensorAddress
37+
7-bit device address.
38+
*/
39+
/*******************************************************************************/
40+
WipperSnapper_I2C_Driver_Out_Ssd1306(TwoWire *i2c,
41+
uint16_t sensorAddress)
42+
: WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) {
43+
_i2c = i2c;
44+
_sensorAddress = sensorAddress;
45+
}
46+
47+
/*!
48+
@brief Destructor for an SSD1306 display.
49+
*/
50+
~WipperSnapper_I2C_Driver_Out_Ssd1306() {
51+
if (_display != nullptr) {
52+
delete _display;
53+
_display = nullptr;
54+
}
55+
}
56+
57+
/*!
58+
@brief Initializes the SSD1306 display and begins I2C.
59+
@returns True if initialized successfully, False otherwise.
60+
*/
61+
bool begin() {
62+
_display = new Adafruit_SSD1306(_width, _height, _i2c);
63+
bool did_begin = _display->begin(SSD1306_SWITCHCAPVCC, _sensorAddress);
64+
return did_begin;
65+
}
66+
67+
/*!
68+
@brief Writes a message to an SSD1306 display.
69+
@param message
70+
The message to be displayed.
71+
*/
72+
void WriteMessage(const char *message) {
73+
74+
}
75+
76+
protected:
77+
Adafruit_SSD1306 *_display =
78+
nullptr; ///< ptr to an SSD1306 display object
79+
int32_t _width; ///< Width of the display in pixels
80+
int32_t _height; ///< Height of the display in pixels
81+
};
82+
83+
#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H

src/wippersnapper/description/v1/description.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Wed May 14 16:42:42 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Fri May 16 18:09:01 2025. */
33

44
#include "wippersnapper/description/v1/description.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/description/v1/description.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Wed May 14 16:42:42 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Fri May 16 18:09:01 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED

src/wippersnapper/ds18x20/v1/ds18x20.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Wed May 14 16:42:42 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Fri May 16 18:09:01 2025. */
33

44
#include "wippersnapper/ds18x20/v1/ds18x20.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/ds18x20/v1/ds18x20.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Wed May 14 16:42:42 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Fri May 16 18:09:01 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED

src/wippersnapper/i2c/v1/i2c.pb.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Wed May 14 16:42:42 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Fri May 16 18:09:01 2025. */
33

44
#include "wippersnapper/i2c/v1/i2c.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40
@@ -57,7 +57,10 @@ PB_BIND(wippersnapper_i2c_v1_I2CDeviceOutputWrite, wippersnapper_i2c_v1_I2CDevic
5757
PB_BIND(wippersnapper_i2c_v1_LedBackpackConfig, wippersnapper_i2c_v1_LedBackpackConfig, AUTO)
5858

5959

60-
PB_BIND(wippersnapper_i2c_v1_CharLCDConfig, wippersnapper_i2c_v1_CharLCDConfig, AUTO)
60+
PB_BIND(wippersnapper_i2c_v1_CharLcdConfig, wippersnapper_i2c_v1_CharLcdConfig, AUTO)
61+
62+
63+
PB_BIND(wippersnapper_i2c_v1_Ssd1306Config, wippersnapper_i2c_v1_Ssd1306Config, AUTO)
6164

6265

6366
PB_BIND(wippersnapper_i2c_v1_I2cOutputAdd, wippersnapper_i2c_v1_I2cOutputAdd, AUTO)
@@ -66,7 +69,10 @@ PB_BIND(wippersnapper_i2c_v1_I2cOutputAdd, wippersnapper_i2c_v1_I2cOutputAdd, AU
6669
PB_BIND(wippersnapper_i2c_v1_LedBackpackWrite, wippersnapper_i2c_v1_LedBackpackWrite, AUTO)
6770

6871

69-
PB_BIND(wippersnapper_i2c_v1_CharLCDWrite, wippersnapper_i2c_v1_CharLCDWrite, AUTO)
72+
PB_BIND(wippersnapper_i2c_v1_CharLcdWrite, wippersnapper_i2c_v1_CharLcdWrite, AUTO)
73+
74+
75+
PB_BIND(wippersnapper_i2c_v1_Ssd1306Write, wippersnapper_i2c_v1_Ssd1306Write, AUTO)
7076

7177

7278

0 commit comments

Comments
 (0)