diff --git a/.gitignore b/.gitignore index b22a8d404..1caed0bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,8 @@ examples/Wippersnapper_demo/build/ .pio/ # Secrets -data/ \ No newline at end of file +data/ + +# Misc. Data +tests/ +venv/ \ No newline at end of file diff --git a/library.properties b/library.properties index d851b0cd6..728a8bb18 100644 --- a/library.properties +++ b/library.properties @@ -7,4 +7,4 @@ paragraph=Arduino application for Adafruit.io WipperSnapper category=Communication url=https://github.com/adafruit/Adafruit_Wippersnapper_Arduino architectures=* -depends=SdFat - Adafruit Fork, Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit INA260 Library, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library +depends=SdFat - Adafruit Fork, Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit INA260 Library, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library, Adafruit LED Backpack Library, Adafruit LiquidCrystal, Adafruit SSD1306 diff --git a/platformio.ini b/platformio.ini index 3e10e4fe2..338e55c8b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -67,7 +67,6 @@ lib_deps = stm32duino/STM32duino VL53L4CD stm32duino/STM32duino VL53L4CX adafruit/Adafruit_VL6180X - adafruit/Adafruit PM25 AQI Sensor adafruit/Adafruit VEML7700 Library adafruit/Adafruit LC709203F adafruit/Adafruit LPS2X @@ -82,6 +81,10 @@ lib_deps = adafruit/Adafruit TouchScreen adafruit/Adafruit MQTT Library bblanchon/ArduinoJson + adafruit/Adafruit LiquidCrystal + adafruit/Adafruit LED Backpack Library + adafruit/Adafruit PM25 AQI Sensor + adafruit/Adafruit SSD1306 https://github.com/pstolarz/OneWireNg.git https://github.com/milesburton/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 022583587..4d7beb15e 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -871,6 +871,28 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field, if (!encodeI2CResponse(&msgi2cResponse)) { return false; } + } else if (field->tag == + wippersnapper_signal_v1_I2CRequest_req_i2c_device_out_write_tag) { + WS_DEBUG_PRINTLN("[app] I2C Device Output Write"); + // Decode stream into an I2CDeviceDeinitRequest + wippersnapper_i2c_v1_I2CDeviceOutputWrite msgDeviceWrite = + wippersnapper_i2c_v1_I2CDeviceOutputWrite_init_zero; + // Decode stream into struct, msgI2CDeviceDeinitRequest + if (!ws_pb_decode(stream, wippersnapper_i2c_v1_I2CDeviceOutputWrite_fields, + &msgDeviceWrite)) { + WS_DEBUG_PRINTLN( + "[app] ERROR: Failed decoding I2CDeviceOutputWrite message."); + return false; + } + + if (!WS._i2cPort0->Handle_I2cDeviceOutputWrite(&msgDeviceWrite)) { + WS_DEBUG_PRINTLN("[app] ERROR: Failed to write to I2C output device."); + return false; // fail out if we can't decode, we don't have a response to + // publish + } + WS_DEBUG_PRINTLN("[app] I2C Device Output Write Done"); + return true; // we successfully wrote to the device, this subtype has no + // response to publish to IO } else { WS_DEBUG_PRINTLN("ERROR: Undefined I2C message tag"); return false; // fail out, we didn't encode anything to publish @@ -2814,7 +2836,6 @@ void Wippersnapper::connect() { #endif // Configure hardware - WS.pinCfgCompleted = false; while (!WS.pinCfgCompleted) { WS_DEBUG_PRINTLN( "Polling for message containing hardware configuration..."); diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index e14193adb..927afa3c3 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -838,6 +838,71 @@ bool WipperSnapper_Component_I2C::initI2CDevice( _adt7410->configureDriver(msgDeviceInitReq); drivers.push_back(_adt7410); WS_DEBUG_PRINTLN("ADT7410 Initialized Successfully!"); + } else if (strcmp("quadalphanum", msgDeviceInitReq->i2c_device_name) == 0) { + _quadAlphaNum = + new WipperSnapper_I2C_Driver_Out_QuadAlphaNum(this->_i2c, i2cAddress); + _quadAlphaNum->ConfigureI2CBackpack( + msgDeviceInitReq->i2c_output_add.config.led_backpack_config.brightness, + msgDeviceInitReq->i2c_output_add.config.led_backpack_config.alignment); + if (!_quadAlphaNum->begin()) { + WS_DEBUG_PRINTLN("ERROR: Failed to initialize Quad Alphanum. Display!"); + _busStatusResponse = + wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; + return false; + } + _drivers_out.push_back(_quadAlphaNum); + WS_DEBUG_PRINTLN("Quad Alphanum. Display Initialized Successfully!"); + } else if (strcmp("charlcd", msgDeviceInitReq->i2c_device_name) == 0) { + _charLcd = new WipperSnapper_I2C_Driver_Out_CharLcd(this->_i2c, i2cAddress); + _charLcd->ConfigureCharLcd( + msgDeviceInitReq->i2c_output_add.config.char_lcd_config.rows, + msgDeviceInitReq->i2c_output_add.config.char_lcd_config.columns); + if (!_charLcd->begin()) { + WS_DEBUG_PRINTLN("ERROR: Failed to initialize Character LCD!"); + _busStatusResponse = + wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; + return false; + } + _drivers_out.push_back(_charLcd); + WS_DEBUG_PRINTLN("Char LCD Display Initialized Successfully!"); + } else if (strcmp("7seg", msgDeviceInitReq->i2c_device_name) == 0) { + _sevenSeg = new WipperSnapper_I2C_Driver_Out_7Seg(this->_i2c, i2cAddress); + _sevenSeg->ConfigureI2CBackpack( + msgDeviceInitReq->i2c_output_add.config.led_backpack_config.brightness, + msgDeviceInitReq->i2c_output_add.config.led_backpack_config.alignment); + if (!_sevenSeg->begin()) { + WS_DEBUG_PRINTLN("ERROR: Failed to initialize 7-Segement LED Matrix!"); + _busStatusResponse = + wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; + return false; + } + _drivers_out.push_back(_sevenSeg); + WS_DEBUG_PRINTLN("7-Segement LED Matrix Initialized Successfully!"); + } else if (strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) == + 0 || + strcmp("oled128x32large", msgDeviceInitReq->i2c_device_name) == + 0 || + strcmp("oled128x64default", msgDeviceInitReq->i2c_device_name) == + 0 || + strcmp("oled128x64large", msgDeviceInitReq->i2c_device_name) == + 0) { + WS_DEBUG_PRINTLN("SSD1306 display detected!"); + _ssd1306 = new WipperSnapper_I2C_Driver_Out_Ssd1306(this->_i2c, i2cAddress); + WS_DEBUG_PRINTLN("Configuring SSD1306 display..."); + _ssd1306->ConfigureSSD1306( + (uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.width, + (uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.height, + (uint8_t) + msgDeviceInitReq->i2c_output_add.config.ssd1306_config.text_size); + if (!_ssd1306->begin()) { + WS_DEBUG_PRINTLN("ERROR: Failed to initialize ssd1306!"); + _busStatusResponse = + wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; + return false; + } + WS_DEBUG_PRINTLN("SSD1306 display configured successfully!"); + _drivers_out.push_back(_ssd1306); + WS_DEBUG_PRINTLN("SSD1306 display initialized Successfully!"); } else { WS_DEBUG_PRINTLN("ERROR: I2C device type not found!") _busStatusResponse = @@ -886,8 +951,9 @@ void WipperSnapper_Component_I2C::updateI2CDeviceProperties( void WipperSnapper_Component_I2C::deinitI2CDevice( wippersnapper_i2c_v1_I2CDeviceDeinitRequest *msgDeviceDeinitReq) { uint16_t deviceAddr = (uint16_t)msgDeviceDeinitReq->i2c_device_address; - std::vector::iterator iter, end; + // Check input (sensor) drivers + std::vector::iterator iter, end; for (iter = drivers.begin(), end = drivers.end(); iter != end; ++iter) { if ((*iter)->getI2CAddress() == deviceAddr) { // Delete the object that iter points to @@ -905,6 +971,28 @@ void WipperSnapper_Component_I2C::deinitI2CDevice( WS_DEBUG_PRINTLN("I2C Device De-initialized!"); } } + + // Check for output drivers + std::vector::iterator out_iter, out_end; + for (out_iter = _drivers_out.begin(), out_end = _drivers_out.end(); + out_iter != out_end; ++out_iter) { + if ((*out_iter)->getI2CAddress() == deviceAddr) { + // Set the driver to nullptr + *out_iter = nullptr; +// ESP-IDF, Erase–remove iter ptr from driver vector +#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) + *out_iter = nullptr; + _drivers_out.erase( + remove(_drivers_out.begin(), _drivers_out.end(), nullptr), + _drivers_out.end()); +#else + // Arduino can not erase-remove, erase only + _drivers_out.erase(out_iter); +#endif + WS_DEBUG_PRINTLN("I2C Device De-initialized!"); + } + } + _busStatusResponse = wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_SUCCESS; } @@ -1073,6 +1161,54 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage( } } +/*******************************************************************************/ +/*! + @brief Handles an I2CDeviceOutputWrite message. + @param msgDeviceWrite + A decoded I2CDeviceOutputWrite message. + @returns True if the message was handled successfully, false otherwise. +*/ +/*******************************************************************************/ +bool WipperSnapper_Component_I2C::Handle_I2cDeviceOutputWrite( + wippersnapper_i2c_v1_I2CDeviceOutputWrite *msgDeviceWrite) { + + // Create a ptr to the base driver out + WipperSnapper_I2C_Driver_Out *driver_out = nullptr; + // Find the matching driver by address in the _drivers_out vector + // TODO: Refactor this outwards + WS_DEBUG_PRINT("Searching for i2c output driver with address: "); + WS_DEBUG_PRINT(msgDeviceWrite->i2c_device_address); + for (size_t i = 0; i < _drivers_out.size(); i++) { + if (_drivers_out[i]->getI2CAddress() == + msgDeviceWrite->i2c_device_address) { + driver_out = _drivers_out[i]; + break; + } + } + if (driver_out == nullptr) { + WS_DEBUG_PRINTLN("ERROR: Driver not found within drivers_out!"); + return false; + } + + // Call the output_msg + if (msgDeviceWrite->which_output_msg == + wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_led_backpack_tag) { + driver_out->WriteLedBackpack( + &msgDeviceWrite->output_msg.write_led_backpack); + } else if (msgDeviceWrite->which_output_msg == + wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_char_lcd_tag) { + driver_out->WriteMessageCharLCD(&msgDeviceWrite->output_msg.write_char_lcd); + } else if (msgDeviceWrite->which_output_msg == + wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_ssd1306_tag) { + driver_out->WriteMessageSSD1306( + msgDeviceWrite->output_msg.write_ssd1306.message); + } else { + WS_DEBUG_PRINTLN("ERROR: Unknown output message type!"); + return false; + } + return true; +} + /*******************************************************************************/ /*! @brief Queries all I2C device drivers for new values. Fills and sends an @@ -1080,7 +1216,6 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage( */ /*******************************************************************************/ void WipperSnapper_Component_I2C::update() { - // Create response message wippersnapper_signal_v1_I2CResponse msgi2cResponse = wippersnapper_signal_v1_I2CResponse_init_zero; diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index 670f28f8c..1c17de10a 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -50,6 +50,11 @@ #include "drivers/WipperSnapper_I2C_Driver_MPRLS.h" #include "drivers/WipperSnapper_I2C_Driver_MS8607.h" #include "drivers/WipperSnapper_I2C_Driver_NAU7802.h" +#include "drivers/WipperSnapper_I2C_Driver_Out.h" +#include "drivers/WipperSnapper_I2C_Driver_Out_7Seg.h" +#include "drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h" +#include "drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h" +#include "drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h" #include "drivers/WipperSnapper_I2C_Driver_PCT2075.h" #include "drivers/WipperSnapper_I2C_Driver_PM25.h" #include "drivers/WipperSnapper_I2C_Driver_SCD30.h" @@ -104,6 +109,9 @@ class WipperSnapper_Component_I2C { void update(); + bool Handle_I2cDeviceOutputWrite( + wippersnapper_i2c_v1_I2CDeviceOutputWrite *msgDeviceWrite); + void sensorEventRead( std::vector::iterator &iter, unsigned long curTime, @@ -134,7 +142,10 @@ class WipperSnapper_Component_I2C { int32_t _portNum; TwoWire *_i2c = nullptr; wippersnapper_i2c_v1_BusResponse _busStatusResponse; - std::vector drivers; ///< List of sensor drivers + std::vector + drivers; ///< List of i2c sensor drivers + std::vector + _drivers_out; ///< List of i2c output drivers // Sensor driver objects WipperSnapper_I2C_Driver_AHTX0 *_ahtx0 = nullptr; WipperSnapper_I2C_Driver_DPS310 *_dps310 = nullptr; @@ -190,6 +201,10 @@ class WipperSnapper_Component_I2C { WipperSnapper_I2C_Driver_VL6180X *_vl6180x = nullptr; WipperSnapper_I2C_Driver_MAX17048 *_max17048 = nullptr; WipperSnapper_I2C_Driver_ADT7410 *_adt7410 = nullptr; + WipperSnapper_I2C_Driver_Out_QuadAlphaNum *_quadAlphaNum = nullptr; + WipperSnapper_I2C_Driver_Out_CharLcd *_charLcd = nullptr; + WipperSnapper_I2C_Driver_Out_7Seg *_sevenSeg = nullptr; + WipperSnapper_I2C_Driver_Out_Ssd1306 *_ssd1306 = nullptr; }; extern Wippersnapper WS; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h new file mode 100644 index 000000000..e806a0dab --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h @@ -0,0 +1,143 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out.h + * + * Derived class for I2C output driver components + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2025 for Adafruit Industries. + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_H + +#include "WipperSnapper_I2C_Driver.h" +#include + +/*! + @brief Derived class for I2C output component drivers. +*/ +class WipperSnapper_I2C_Driver_Out : public WipperSnapper_I2C_Driver { + +public: + /*! + @brief Creates a new I2C output component driver. + @param i2c + The I2C hardware interface, default is Wire. + @param sensorAddress + The I2C sensor's unique address. + */ + WipperSnapper_I2C_Driver_Out(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver(i2c, sensorAddress) { + // No-op constructor + } + + /*! + @brief Destructor for an I2C output component. + */ + virtual ~WipperSnapper_I2C_Driver_Out() { + // No-op destructor + } + + /*! + @brief Writes a message to an i2c output device. + @param message + The message to be displayed. +*/ + virtual void WriteMessage(const char *message) { + // noop + } + + /*! + @brief Configures a SSD1306 OLED display. Must be called before driver + begin() + @param width + The width of the display in pixels. + @param height + The height of the display in pixels. + @param text_size + The display's text size. + */ + virtual void ConfigureSSD1306(uint8_t width, uint8_t height, + uint8_t text_size) { + // noop + } + + /*! + @brief Writes a message to the SSD1306 display. + @param message + The message to be displayed. + */ + virtual void WriteMessageSSD1306(const char *message) { + // noop + } + + /*! + @brief Configures a LED backpack. + @param brightness + The brightness of the LED backpack. + @param alignment + The alignment of the LED backpack. + */ + virtual void ConfigureI2CBackpack(int32_t brightness, uint32_t alignment) { + // noop + } + + /*! + @brief Sets the brightness of the LED backpack. + @param b + The brightness value, from 0 (off) to 15 (full brightness). + */ + virtual void SetLedBackpackBrightness(uint8_t b) { + // noop + } + + /*! + @brief Writes a message to the LED backpack. + @param msg_write + Pointer to a wippersnapper_i2c_v1_LedBackpackWrite message. + */ + void WriteLedBackpack(wippersnapper_i2c_v1_LEDBackpackWrite *msg_write) { + WriteMessage(msg_write->message); + } + + /*! + @brief Configures a character LCD. + @param rows + The number of rows in the LCD. + @param cols + The number of columns in the LCD. + */ + virtual void ConfigureCharLcd(uint32_t rows, uint32_t cols) { + // noop + } + + /*! + @brief Turns the character LCD backlight on or off. + @param enable + True to enable the backlight, false to disable it. + */ + void EnableCharLcdBacklight(bool enable) { + // noop + } + + /*! + @brief Writes a message to the LCD. + @param write_char_lcd + Points to a CharLCDWrite message. + @param enable_backlight + True if the backlight should be enabled, false otherwise. + */ + void WriteMessageCharLCD(wippersnapper_i2c_v1_CharLCDWrite *write_char_lcd, + bool enable_backlight = true) { + EnableCharLcdBacklight(enable_backlight); + WriteMessage(write_char_lcd->message); + } +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_H diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_7Seg.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_7Seg.h new file mode 100644 index 000000000..1184e844a --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_7Seg.h @@ -0,0 +1,209 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out_7Seg.h + * + * Device driver designed specifically to work with the Adafruit LED 7-Segment + * I2C backpacks: + * ----> http://www.adafruit.com/products/881 + * ----> http://www.adafruit.com/products/880 + * ----> http://www.adafruit.com/products/879 + * ----> http://www.adafruit.com/products/878 + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell for Adafruit Industries 2025 + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_7SEG_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_7SEG_H + +#include "WipperSnapper_I2C_Driver_Out.h" +#include +#include + +#define LED_BACKPACK_ALIGNMENT_UNSPECIFIED 0 ///< Unspecified alignment +#define LED_BACKPACK_ALIGNMENT_LEFT 1 ///< Left alignment +#define LED_BACKPACK_ALIGNMENT_RIGHT 2 ///< Right alignment +#define LED_BACKPACK_ALIGNMENT_DEFAULT \ + LED_BACKPACK_ALIGNMENT_LEFT ///< Default alignment +#define LED_MAX_CHARS \ + 5 ///< Maximum characters for 7-segment display, including ':' +#define LED_BACKPACK_DEGREE_SYMBOL \ + 0b01100011 ///< Degree symbol for 7-segment display + +/*! + @brief Class that provides a driver interface for 7-Segment + Displays w/I2C Backpack +*/ +class WipperSnapper_I2C_Driver_Out_7Seg : public WipperSnapper_I2C_Driver_Out { + +public: + /*******************************************************************************/ + /*! + @brief Constructor for a 7-Segment display driver. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + /*******************************************************************************/ + WipperSnapper_I2C_Driver_Out_7Seg(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + } + + /*! + @brief Destructor for a 7-Segment display driver. + */ + ~WipperSnapper_I2C_Driver_Out_7Seg() { + if (_matrix != nullptr) { + delete _matrix; + _matrix = nullptr; + } + } + + /*! + @brief Initializes the 7-segment LED matrix and begins I2C + communication. + @returns True if initialized successfully, False otherwise. + */ + bool begin() { + _matrix = new Adafruit_7segment(); + bool did_begin = _matrix->begin(_sensorAddress, _i2c); + return did_begin; + } + + /*! + @brief Configures the LED matrix's I2C backpack. + @param brightness + The brightness of the i2c backpack (0-15). + @param alignment + The alignment of the i2c backpack's LED matrix (left/right). +*/ + void ConfigureI2CBackpack(int32_t brightness, uint32_t alignment) { + if (alignment == LED_BACKPACK_ALIGNMENT_RIGHT) { + _alignment = LED_BACKPACK_ALIGNMENT_RIGHT; + } else { + _alignment = LED_BACKPACK_ALIGNMENT_DEFAULT; + } + + // Note: Adafruit_LEDBackpack normalizes only > 15, but not < 0, + // so, here we're normalizing < 0 to 8 (median brightness) + if (brightness < 0) { + brightness = 8; // Set to median brightness if out of range + } + } + + /*! + @brief Sets the brightness of the LED backpack. + @param b + The brightness value, from 0 (off) to 15 (full brightness). + */ + void SetLedBackpackBrightness(uint8_t b) { + if (_matrix == nullptr) { + return; + } + _matrix->setBrightness(b); + } + + /*! + @brief Writes the first four characters of a message to the Adafruit + 7-segment LED matrix. + @param message + The message to be displayed. + */ + void WriteMessage(const char *message) { + if (_matrix == nullptr || message == nullptr) { + return; + } + + // Clear before writing + _matrix->clear(); + + // Calculate the number of characters to display + size_t len_display = min(strlen(message), (size_t)LED_MAX_CHARS); + + // Set the starting position based on alignment + int pos_start; + if (_alignment == LED_BACKPACK_ALIGNMENT_LEFT) { + pos_start = 0; // start at the leftmost position of the display + } else { + // Exclude decimal points from the character count because those get + // displayed on a "special" segment of the LED display + int seg_chars = 0; + for (size_t i = 0; i < len_display; i++) { + if (message[i] != '.') { + seg_chars++; + } + } + // start at the rightmost position of the display + switch (seg_chars) { + case 4: + pos_start = 0; + break; + case 3: + pos_start = 1; + break; + case 2: + pos_start = 3; // if 2 characters, start at position 3 is required + // because ':' is position 2 and we need to skip it + break; + case 1: + pos_start = 4; + break; + default: + pos_start = 0; // if no characters or overflow, start at position 0 + break; + } + } + + // Write to the display's buffer + int cur_idx = pos_start; + for (size_t i = 0; i < len_display; i++) { + + // skip position 2 + if (cur_idx == 2) { + cur_idx++; + } + // Save the character because if there's a decimal, we need to skip it in + // the buffer + char ch = message[i]; + + // Look-ahead for a decimal point to attach to the current character + bool display_dot = false; + if (i + 1 < len_display && message[i + 1] == '.') { + display_dot = true; + i++; + len_display++; + } else if (message[i] == 0xC2 && message[i + 1] == 0xB0 && + i + 1 < strlen(message)) { + // Write degree symbol + _matrix->writeDigitRaw(cur_idx, LED_BACKPACK_DEGREE_SYMBOL); + i++; + cur_idx++; + continue; // skip to next character + } + // Write the character to the display buffer + _matrix->writeDigitAscii(cur_idx, ch, display_dot); + cur_idx++; + } + // Issue the buffered data in RAM to the display + _matrix->writeDisplay(); + } + +protected: + Adafruit_7segment *_matrix = + nullptr; ///< ptr to a 7-segment LED matrix object + int32_t _brightness; ///< Brightness of the LED backpack, from 0 (off) to 15 + ///< (full brightness) + uint32_t _alignment = + LED_BACKPACK_ALIGNMENT_DEFAULT; ///< Determines L/R alignment of the + ///< message displayed +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_7SEG_H \ No newline at end of file diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h new file mode 100644 index 000000000..8e3ce8265 --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h @@ -0,0 +1,142 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out_CharLcd.h + * + * Device driver for I2C Character LCDs (HD44780) + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell for Adafruit Industries 2025 + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_CHARLCD_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_CHARLCD_H + +#include "WipperSnapper_I2C_Driver_Out.h" +#include + +/*! + @brief Class that provides a driver interface for a lcd character display. + This class is a wrapper around the Adafruit_LiquidCrystal library. +*/ +class WipperSnapper_I2C_Driver_Out_CharLcd + : public WipperSnapper_I2C_Driver_Out { + +public: + /*! + @brief Constructor for a LCD character display. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + WipperSnapper_I2C_Driver_Out_CharLcd(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + } + + /*! + @brief Destructor for an MS8607 sensor. + */ + ~WipperSnapper_I2C_Driver_Out_CharLcd() { + if (_lcd != nullptr) { + delete _lcd; + _lcd = nullptr; + } + } + + /*! + @brief Initializes the drvOutQuadAlphaNum component and begins I2C. + @returns True if initialized successfully, False otherwise. + */ + bool begin() { + _lcd = new Adafruit_LiquidCrystal(_sensorAddress, _i2c); + bool did_begin = _lcd->begin(_cols, _rows); + if (did_begin) { + _lcd->setBacklight(HIGH); + } + return did_begin; + } + + /*! + @brief Writes a message to the LCD. + @note MUST be called prior to begin() to configure the LCD's size + @param rows + The number of rows in the LCD. + @param cols + The number of columns in the LCD. + */ + void ConfigureCharLcd(uint8_t rows, uint8_t cols) { + _rows = rows; + _cols = cols; + } + + /*! + @brief Turns the character LCD backlight on or off. + @param enable + True to enable the backlight, false to disable it. + */ + void EnableCharLcdBacklight(bool enable = true) { + if (_lcd == nullptr) + return; + + if (enable) { + _lcd->setBacklight(HIGH); + } else { + _lcd->setBacklight(LOW); + } + } + + /*! + @brief Writes a message to the LCD. + @param message + The message to be displayed. + */ + void WriteMessage(const char *message) { + if (_lcd == nullptr) + return; + + // Before writing, let's clear the display + _lcd->clear(); + + size_t message_length = strlen(message); + size_t cur_idx = 0; // Current index in the message + + // Write each row until it hits: \n, or the end of the message, or the last + // column/row position + for (int cur_row = 0; cur_row < _rows && cur_idx < message_length; + cur_row++) { + // Write each row out at the beginning of the row + _lcd->setCursor(0, cur_row); + for (int cur_col = 0; cur_col < _cols && cur_idx < message_length; + cur_col++) { + char c = message[cur_idx]; + if (c == '\\' && cur_idx + 1 < message_length && + message[cur_idx + 1] == 'n') { + cur_idx += 2; // Skip the '\n' character in the buffer + break; // and move to the next row + } else if (c == 194 && cur_idx + 1 < message_length && + message[cur_idx + 1] == 176) { + cur_idx += 2; // Skip the degree symbol sequence in the buffer + _lcd->write(0xDF); // and write the degree symbol + } else { + _lcd->write(c); + cur_idx++; + } + } + } + } + +protected: + Adafruit_LiquidCrystal *_lcd = + nullptr; ///< Pointer to the Adafruit_LiquidCrystal object + uint8_t _rows; ///< Number of rows in the display + uint8_t _cols; ///< Number of columns in the display +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_CHARLCD_H \ No newline at end of file diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h new file mode 100644 index 000000000..02553e208 --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h @@ -0,0 +1,178 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h + * + * Device driver for Quad Alphanumeric Displays w/I2C Backpack + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell for Adafruit Industries 2025 + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_QUADALPHANUM_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_QUADALPHANUM_H + +#include "WipperSnapper_I2C_Driver_Out.h" +#include +#include + +#define LED_BACKPACK_ALIGNMENT_UNSPECIFIED 0 ///< Unspecified alignment +#define LED_BACKPACK_ALIGNMENT_LEFT 1 ///< Left alignment +#define LED_BACKPACK_ALIGNMENT_RIGHT 2 ///< Right alignment +#define LED_BACKPACK_ALIGNMENT_DEFAULT \ + LED_BACKPACK_ALIGNMENT_LEFT ///< Default alignment +#define LED_MAX_CHARS \ + 4 ///< Maximum number of characters to display on the alphanumeric display +#define ALPHANUM_DEGREE_SYMBOL \ + 0b0000000011100011 ///< Degree symbol for alphanumeric display + +/*! + @brief Class that provides a driver interface for Quad Alphanumeric + Displays w/I2C Backpack +*/ +class WipperSnapper_I2C_Driver_Out_QuadAlphaNum + : public WipperSnapper_I2C_Driver_Out { + +public: + /*******************************************************************************/ + /*! + @brief Constructor for an MS8607 sensor. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + /*******************************************************************************/ + WipperSnapper_I2C_Driver_Out_QuadAlphaNum(TwoWire *i2c, + uint16_t sensorAddress) + : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + } + + /*! + @brief Destructor for an MS8607 sensor. + */ + ~WipperSnapper_I2C_Driver_Out_QuadAlphaNum() { + if (_alpha4 != nullptr) { + delete _alpha4; + _alpha4 = nullptr; + } + } + + /*! + @brief Initializes the drvOutQuadAlphaNum component and begins I2C. + @returns True if initialized successfully, False otherwise. + */ + bool begin() { + _alpha4 = new Adafruit_AlphaNum4(); + bool did_begin = _alpha4->begin(_sensorAddress, _i2c); + _alpha4->setBrightness(_brightness); + return did_begin; + } + + /*! + @brief Configures a LED backpack. + @param brightness + The brightness of the LED backpack. + @param alignment + The alignment of the LED backpack. +*/ + void ConfigureI2CBackpack(int32_t brightness, uint32_t alignment) { + if (alignment == LED_BACKPACK_ALIGNMENT_RIGHT) { + _alignment = LED_BACKPACK_ALIGNMENT_RIGHT; + } else { + _alignment = LED_BACKPACK_ALIGNMENT_DEFAULT; + } + _brightness = brightness; + } + + /*! + @brief Sets the brightness of the LED backpack. + @param b + The brightness value, from 0 (off) to 15 (full brightness). + */ + void SetLedBackpackBrightness(uint8_t b) { + if (_alpha4 == nullptr) { + return; + } + _alpha4->setBrightness(b); + } + + /*! + @brief Writes the first four characters of a message to the quad + alphanumeric display. + @param message + The message to be displayed. + */ + void WriteMessage(const char *message) { + if (_alpha4 == nullptr || message == nullptr) { + return; + } + // Clear before writing + _alpha4->clear(); + + // Calculate the number of characters to display + size_t len_display = min(strlen(message), (size_t)LED_MAX_CHARS); + + // Set the starting position based on alignment + int pos_start; + if (_alignment == LED_BACKPACK_ALIGNMENT_LEFT) { + pos_start = 0; // start at the leftmost position of the display + } else { + // Exclude decimal points from the character count because those get + // displayed on a "special" segment of the LED display + int seg_chars = 0; + for (size_t i = 0; i < len_display; i++) { + if (message[i] != '.') { + seg_chars++; + } + } + // start at the rightmost position of the display + pos_start = LED_MAX_CHARS - seg_chars; + } + + // Write to the display's buffer + int cur_idx = pos_start; + for (size_t i = 0; i < len_display; i++) { + // Save the character because if there's a decimal, we need to skip it in + // the buffer + char ch = message[i]; + + // Look-ahead for a decimal point to attach to the current character + bool display_dot = false; + if (i + 1 < len_display && message[i + 1] == '.') { + display_dot = true; + i++; + len_display++; + } else if (message[i] == 0xC2 && message[i + 1] == 0xB0 && + i + 1 < strlen(message)) { + // Write the degree symbol + _alpha4->writeDigitRaw(cur_idx, ALPHANUM_DEGREE_SYMBOL); + i++; + cur_idx++; + continue; + } + // Write the character to the display buffer + _alpha4->writeDigitAscii(cur_idx, ch, display_dot); + cur_idx++; + } + // Issue the buffered data in RAM to the display + _alpha4->writeDisplay(); + } + +protected: + Adafruit_AlphaNum4 *_alpha4 = + nullptr; ///< ptr to a 4-digit alphanumeric display object + int32_t _brightness; ///< Brightness of the LED backpack, from 0 (off) to 15 + ///< (full brightness) + uint32_t _alignment = + LED_BACKPACK_ALIGNMENT_DEFAULT; ///< Determines L/R alignment of the + ///< message displayed +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_QUADALPHANUM_H \ No newline at end of file diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h new file mode 100644 index 000000000..c3bd93870 --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h @@ -0,0 +1,149 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out_Ssd1306.h + * + * Device driver for a SSD1306 OLED Display + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell for Adafruit Industries 2025 + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H + +#include "WipperSnapper_I2C_Driver_Out.h" +#include +#include + +#define DEFAULT_WIDTH 128 ///< Default width for a ssd1306 128x64 display +#define DEFAULT_HEIGHT 64 ///< Default height for a ssd1306 128x64 display + +/*! + @brief Class that provides a driver interface for a SSD1306 + OLED Display +*/ +class WipperSnapper_I2C_Driver_Out_Ssd1306 + : public WipperSnapper_I2C_Driver_Out { + +public: + /*******************************************************************************/ + /*! + @brief Constructor for a SSD1306 OLED display. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + /*******************************************************************************/ + WipperSnapper_I2C_Driver_Out_Ssd1306(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + _width = DEFAULT_WIDTH; + _height = DEFAULT_HEIGHT; + } + + /*! + @brief Destructor for a SSD1306 OLED display. + */ + ~WipperSnapper_I2C_Driver_Out_Ssd1306() { + if (_display != nullptr) { + _display->clearDisplay(); + _display->display(); + _display->ssd1306_command(SSD1306_DISPLAYOFF); + delete _display; + _display = nullptr; + } + } + + /*! + @brief Initializes the SSD1306 display and begins I2C. + @returns True if initialized successfully, False otherwise. + */ + bool begin() { + // Attempt to create and allocate a SSD1306 obj. + _display = new Adafruit_SSD1306(_width, _height, _i2c); + if (!_display->begin(SSD1306_SWITCHCAPVCC, _sensorAddress)) + return false; + // Configure the text size and color + _display->setTextSize(_text_sz); + _display->setTextColor(SSD1306_WHITE); + // Use full 256 char 'Code Page 437' font + _display->cp437(true); + // Clear the buffer + _display->clearDisplay(); + _display->display(); + return true; + } + + /*! + @brief Configures a SSD1306 OLED display. Must be called before driver + begin() + @param width + The width of the display in pixels. + @param height + The height of the display in pixels. + @param text_size + The magnification factor for the text size. + */ + void ConfigureSSD1306(uint8_t width, uint8_t height, uint8_t text_size) { + _width = width; + _height = height; + _text_sz = text_size; + } + + /*! + @brief Writes a message to the SSD1306 display. + @param message + The message to be displayed. + */ + void WriteMessageSSD1306(const char *message) { + if (_display == nullptr) + return; + + // Start with a fresh display buffer + // and settings + int16_t y_idx = 0; + _display->clearDisplay(); + _display->setTextSize(_text_sz); + _display->setTextColor(SSD1306_WHITE); + _display->setCursor(0, y_idx); + _display->display(); + + // Calculate the line height based on the text size (NOTE: base height is + // 8px) + int16_t line_height = 8 * _text_sz; + uint16_t c_idx = 0; + size_t msg_size = strlen(message); + for (size_t i = 0; i < msg_size && c_idx < msg_size; i++) { + if (message[i] == '\\' && i + 1 < msg_size && message[i + 1] == 'n') { + // detected a newline char sequence (\n) + i++; + // Skip to the next possible line + y_idx += line_height; + _display->setCursor(0, y_idx); + } else if (message[i] == 0xC2 && message[i + 1] == 0xB0) { + _display->write(char(248)); + _display->display(); + i++; + } else { + _display->print(message[i]); + _display->display(); + } + } + } + +protected: + Adafruit_SSD1306 *_display = + nullptr; ///< Pointer to the Adafruit_SSD1306 object + uint8_t _width; ///< Width of the display in pixels + uint8_t _height; ///< Height of the display in pixels + uint8_t _text_sz; ///< Text size of the display +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H \ No newline at end of file diff --git a/src/wippersnapper/description/v1/description.pb.c b/src/wippersnapper/description/v1/description.pb.c index 892b3cd94..a2a9a0b81 100644 --- a/src/wippersnapper/description/v1/description.pb.c +++ b/src/wippersnapper/description/v1/description.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/description/v1/description.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/description/v1/description.pb.h b/src/wippersnapper/description/v1/description.pb.h index f9a22c7d7..04bccb232 100644 --- a/src/wippersnapper/description/v1/description.pb.h +++ b/src/wippersnapper/description/v1/description.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED #define PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED diff --git a/src/wippersnapper/ds18x20/v1/ds18x20.pb.c b/src/wippersnapper/ds18x20/v1/ds18x20.pb.c index 4d3172b5d..d98a397d0 100644 --- a/src/wippersnapper/ds18x20/v1/ds18x20.pb.c +++ b/src/wippersnapper/ds18x20/v1/ds18x20.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/ds18x20/v1/ds18x20.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/ds18x20/v1/ds18x20.pb.h b/src/wippersnapper/ds18x20/v1/ds18x20.pb.h index 101908aba..c3c8afafb 100644 --- a/src/wippersnapper/ds18x20/v1/ds18x20.pb.h +++ b/src/wippersnapper/ds18x20/v1/ds18x20.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED #define PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED diff --git a/src/wippersnapper/i2c/v1/i2c.pb.c b/src/wippersnapper/i2c/v1/i2c.pb.c index b0f46a992..8707945f0 100644 --- a/src/wippersnapper/i2c/v1/i2c.pb.c +++ b/src/wippersnapper/i2c/v1/i2c.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/i2c/v1/i2c.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -27,13 +27,13 @@ PB_BIND(wippersnapper_i2c_v1_I2CDeviceSensorProperties, wippersnapper_i2c_v1_I2C PB_BIND(wippersnapper_i2c_v1_I2CDeviceInitRequests, wippersnapper_i2c_v1_I2CDeviceInitRequests, AUTO) -PB_BIND(wippersnapper_i2c_v1_I2CDeviceInitRequest, wippersnapper_i2c_v1_I2CDeviceInitRequest, AUTO) +PB_BIND(wippersnapper_i2c_v1_I2CDeviceInitRequest, wippersnapper_i2c_v1_I2CDeviceInitRequest, 2) PB_BIND(wippersnapper_i2c_v1_I2CDeviceInitResponse, wippersnapper_i2c_v1_I2CDeviceInitResponse, AUTO) -PB_BIND(wippersnapper_i2c_v1_I2CDeviceUpdateRequest, wippersnapper_i2c_v1_I2CDeviceUpdateRequest, AUTO) +PB_BIND(wippersnapper_i2c_v1_I2CDeviceUpdateRequest, wippersnapper_i2c_v1_I2CDeviceUpdateRequest, 2) PB_BIND(wippersnapper_i2c_v1_I2CDeviceUpdateResponse, wippersnapper_i2c_v1_I2CDeviceUpdateResponse, AUTO) @@ -51,6 +51,32 @@ PB_BIND(wippersnapper_i2c_v1_SensorEvent, wippersnapper_i2c_v1_SensorEvent, AUTO PB_BIND(wippersnapper_i2c_v1_I2CDeviceEvent, wippersnapper_i2c_v1_I2CDeviceEvent, AUTO) +PB_BIND(wippersnapper_i2c_v1_I2CDeviceOutputWrite, wippersnapper_i2c_v1_I2CDeviceOutputWrite, 2) + + +PB_BIND(wippersnapper_i2c_v1_LEDBackpackConfig, wippersnapper_i2c_v1_LEDBackpackConfig, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_CharLCDConfig, wippersnapper_i2c_v1_CharLCDConfig, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_SSD1306Config, wippersnapper_i2c_v1_SSD1306Config, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_I2COutputAdd, wippersnapper_i2c_v1_I2COutputAdd, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_LEDBackpackWrite, wippersnapper_i2c_v1_LEDBackpackWrite, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_CharLCDWrite, wippersnapper_i2c_v1_CharLCDWrite, AUTO) + + +PB_BIND(wippersnapper_i2c_v1_SSD1306Write, wippersnapper_i2c_v1_SSD1306Write, 2) + + + + diff --git a/src/wippersnapper/i2c/v1/i2c.pb.h b/src/wippersnapper/i2c/v1/i2c.pb.h index f6865e1fd..639e4d1c2 100644 --- a/src/wippersnapper/i2c/v1/i2c.pb.h +++ b/src/wippersnapper/i2c/v1/i2c.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_I2C_V1_WIPPERSNAPPER_I2C_V1_I2C_PB_H_INCLUDED #define PB_WIPPERSNAPPER_I2C_V1_WIPPERSNAPPER_I2C_V1_I2C_PB_H_INCLUDED @@ -60,11 +60,33 @@ typedef enum _wippersnapper_i2c_v1_SensorType { wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC = 35 } wippersnapper_i2c_v1_SensorType; +typedef enum _wippersnapper_i2c_v1_LEDBackpackAlignment { + wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_UNSPECIFIED = 0, + wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_LEFT = 1, + wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_RIGHT = 2 +} wippersnapper_i2c_v1_LEDBackpackAlignment; + +typedef enum _wippersnapper_i2c_v1_SSD1306TextSize { + wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_UNSPECIFIED = 0, + wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_1 = 1, + wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2 = 2 +} wippersnapper_i2c_v1_SSD1306TextSize; + /* Struct definitions */ typedef struct _wippersnapper_i2c_v1_I2CDeviceInitRequests { pb_callback_t list; } wippersnapper_i2c_v1_I2CDeviceInitRequests; +typedef struct _wippersnapper_i2c_v1_CharLCDConfig { + uint32_t rows; + uint32_t columns; +} wippersnapper_i2c_v1_CharLCDConfig; + +typedef struct _wippersnapper_i2c_v1_CharLCDWrite { + char message[128]; + bool enable_backlight; +} wippersnapper_i2c_v1_CharLCDWrite; + typedef struct _wippersnapper_i2c_v1_I2CBusInitRequest { int32_t i2c_pin_scl; int32_t i2c_pin_sda; @@ -112,6 +134,25 @@ typedef struct _wippersnapper_i2c_v1_I2CDeviceUpdateResponse { wippersnapper_i2c_v1_BusResponse bus_response; } wippersnapper_i2c_v1_I2CDeviceUpdateResponse; +typedef struct _wippersnapper_i2c_v1_LEDBackpackConfig { + int32_t brightness; + wippersnapper_i2c_v1_LEDBackpackAlignment alignment; +} wippersnapper_i2c_v1_LEDBackpackConfig; + +typedef struct _wippersnapper_i2c_v1_LEDBackpackWrite { + char message[5]; +} wippersnapper_i2c_v1_LEDBackpackWrite; + +typedef struct _wippersnapper_i2c_v1_SSD1306Config { + uint32_t width; + uint32_t height; + wippersnapper_i2c_v1_SSD1306TextSize text_size; +} wippersnapper_i2c_v1_SSD1306Config; + +typedef struct _wippersnapper_i2c_v1_SSD1306Write { + char message[256]; +} wippersnapper_i2c_v1_SSD1306Write; + typedef struct _wippersnapper_i2c_v1_SensorEvent { wippersnapper_i2c_v1_SensorType type; float value; @@ -129,23 +170,46 @@ typedef struct _wippersnapper_i2c_v1_I2CDeviceEvent { wippersnapper_i2c_v1_SensorEvent sensor_event[15]; } wippersnapper_i2c_v1_I2CDeviceEvent; -typedef struct _wippersnapper_i2c_v1_I2CDeviceInitRequest { +typedef struct _wippersnapper_i2c_v1_I2CDeviceOutputWrite { + uint32_t i2c_device_address; + char i2c_device_name[256]; + pb_size_t which_output_msg; + union { + wippersnapper_i2c_v1_LEDBackpackWrite write_led_backpack; + wippersnapper_i2c_v1_CharLCDWrite write_char_lcd; + wippersnapper_i2c_v1_SSD1306Write write_ssd1306; + } output_msg; +} wippersnapper_i2c_v1_I2CDeviceOutputWrite; + +typedef struct _wippersnapper_i2c_v1_I2CDeviceUpdateRequest { int32_t i2c_port_number; - bool has_i2c_bus_init_req; - wippersnapper_i2c_v1_I2CBusInitRequest i2c_bus_init_req; uint32_t i2c_device_address; - char i2c_device_name[15]; + char i2c_device_name[256]; pb_size_t i2c_device_properties_count; wippersnapper_i2c_v1_I2CDeviceSensorProperties i2c_device_properties[15]; -} wippersnapper_i2c_v1_I2CDeviceInitRequest; +} wippersnapper_i2c_v1_I2CDeviceUpdateRequest; -typedef struct _wippersnapper_i2c_v1_I2CDeviceUpdateRequest { +typedef struct _wippersnapper_i2c_v1_I2COutputAdd { + pb_size_t which_config; + union { + wippersnapper_i2c_v1_LEDBackpackConfig led_backpack_config; + wippersnapper_i2c_v1_CharLCDConfig char_lcd_config; + wippersnapper_i2c_v1_SSD1306Config ssd1306_config; + } config; +} wippersnapper_i2c_v1_I2COutputAdd; + +typedef struct _wippersnapper_i2c_v1_I2CDeviceInitRequest { int32_t i2c_port_number; + bool has_i2c_bus_init_req; + wippersnapper_i2c_v1_I2CBusInitRequest i2c_bus_init_req; uint32_t i2c_device_address; - char i2c_device_name[15]; + char i2c_device_name[256]; pb_size_t i2c_device_properties_count; wippersnapper_i2c_v1_I2CDeviceSensorProperties i2c_device_properties[15]; -} wippersnapper_i2c_v1_I2CDeviceUpdateRequest; + bool is_output_device; + bool has_i2c_output_add; + wippersnapper_i2c_v1_I2COutputAdd i2c_output_add; +} wippersnapper_i2c_v1_I2CDeviceInitRequest; /* Helper constants for enums */ @@ -157,6 +221,14 @@ typedef struct _wippersnapper_i2c_v1_I2CDeviceUpdateRequest { #define _wippersnapper_i2c_v1_SensorType_MAX wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC #define _wippersnapper_i2c_v1_SensorType_ARRAYSIZE ((wippersnapper_i2c_v1_SensorType)(wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC+1)) +#define _wippersnapper_i2c_v1_LEDBackpackAlignment_MIN wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_UNSPECIFIED +#define _wippersnapper_i2c_v1_LEDBackpackAlignment_MAX wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_RIGHT +#define _wippersnapper_i2c_v1_LEDBackpackAlignment_ARRAYSIZE ((wippersnapper_i2c_v1_LEDBackpackAlignment)(wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_RIGHT+1)) + +#define _wippersnapper_i2c_v1_SSD1306TextSize_MIN wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_UNSPECIFIED +#define _wippersnapper_i2c_v1_SSD1306TextSize_MAX wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2 +#define _wippersnapper_i2c_v1_SSD1306TextSize_ARRAYSIZE ((wippersnapper_i2c_v1_SSD1306TextSize)(wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2+1)) + #ifdef __cplusplus extern "C" { @@ -170,7 +242,7 @@ extern "C" { #define wippersnapper_i2c_v1_I2CBusScanResponse_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default {_wippersnapper_i2c_v1_SensorType_MIN, 0} #define wippersnapper_i2c_v1_I2CDeviceInitRequests_init_default {{{NULL}, NULL}} -#define wippersnapper_i2c_v1_I2CDeviceInitRequest_init_default {0, false, wippersnapper_i2c_v1_I2CBusInitRequest_init_default, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default}} +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_init_default {0, false, wippersnapper_i2c_v1_I2CBusInitRequest_init_default, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default}, 0, false, wippersnapper_i2c_v1_I2COutputAdd_init_default} #define wippersnapper_i2c_v1_I2CDeviceInitResponse_init_default {0, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_init_default {0, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_default}} #define wippersnapper_i2c_v1_I2CDeviceUpdateResponse_init_default {0, _wippersnapper_i2c_v1_BusResponse_MIN} @@ -178,6 +250,14 @@ extern "C" { #define wippersnapper_i2c_v1_I2CDeviceDeinitResponse_init_default {0, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_SensorEvent_init_default {_wippersnapper_i2c_v1_SensorType_MIN, 0} #define wippersnapper_i2c_v1_I2CDeviceEvent_init_default {0, 0, {wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default, wippersnapper_i2c_v1_SensorEvent_init_default}} +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_init_default {0, "", 0, {wippersnapper_i2c_v1_LEDBackpackWrite_init_default}} +#define wippersnapper_i2c_v1_LEDBackpackConfig_init_default {0, _wippersnapper_i2c_v1_LEDBackpackAlignment_MIN} +#define wippersnapper_i2c_v1_CharLCDConfig_init_default {0, 0} +#define wippersnapper_i2c_v1_SSD1306Config_init_default {0, 0, _wippersnapper_i2c_v1_SSD1306TextSize_MIN} +#define wippersnapper_i2c_v1_I2COutputAdd_init_default {0, {wippersnapper_i2c_v1_LEDBackpackConfig_init_default}} +#define wippersnapper_i2c_v1_LEDBackpackWrite_init_default {""} +#define wippersnapper_i2c_v1_CharLCDWrite_init_default {"", 0} +#define wippersnapper_i2c_v1_SSD1306Write_init_default {""} #define wippersnapper_i2c_v1_I2CBusInitRequest_init_zero {0, 0, 0, 0} #define wippersnapper_i2c_v1_I2CBusInitResponse_init_zero {_wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_I2CBusSetFrequency_init_zero {0, 0} @@ -185,7 +265,7 @@ extern "C" { #define wippersnapper_i2c_v1_I2CBusScanResponse_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero {_wippersnapper_i2c_v1_SensorType_MIN, 0} #define wippersnapper_i2c_v1_I2CDeviceInitRequests_init_zero {{{NULL}, NULL}} -#define wippersnapper_i2c_v1_I2CDeviceInitRequest_init_zero {0, false, wippersnapper_i2c_v1_I2CBusInitRequest_init_zero, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero}} +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_init_zero {0, false, wippersnapper_i2c_v1_I2CBusInitRequest_init_zero, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero}, 0, false, wippersnapper_i2c_v1_I2COutputAdd_init_zero} #define wippersnapper_i2c_v1_I2CDeviceInitResponse_init_zero {0, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_init_zero {0, 0, "", 0, {wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero, wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero}} #define wippersnapper_i2c_v1_I2CDeviceUpdateResponse_init_zero {0, _wippersnapper_i2c_v1_BusResponse_MIN} @@ -193,9 +273,21 @@ extern "C" { #define wippersnapper_i2c_v1_I2CDeviceDeinitResponse_init_zero {0, _wippersnapper_i2c_v1_BusResponse_MIN} #define wippersnapper_i2c_v1_SensorEvent_init_zero {_wippersnapper_i2c_v1_SensorType_MIN, 0} #define wippersnapper_i2c_v1_I2CDeviceEvent_init_zero {0, 0, {wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero, wippersnapper_i2c_v1_SensorEvent_init_zero}} +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_init_zero {0, "", 0, {wippersnapper_i2c_v1_LEDBackpackWrite_init_zero}} +#define wippersnapper_i2c_v1_LEDBackpackConfig_init_zero {0, _wippersnapper_i2c_v1_LEDBackpackAlignment_MIN} +#define wippersnapper_i2c_v1_CharLCDConfig_init_zero {0, 0} +#define wippersnapper_i2c_v1_SSD1306Config_init_zero {0, 0, _wippersnapper_i2c_v1_SSD1306TextSize_MIN} +#define wippersnapper_i2c_v1_I2COutputAdd_init_zero {0, {wippersnapper_i2c_v1_LEDBackpackConfig_init_zero}} +#define wippersnapper_i2c_v1_LEDBackpackWrite_init_zero {""} +#define wippersnapper_i2c_v1_CharLCDWrite_init_zero {"", 0} +#define wippersnapper_i2c_v1_SSD1306Write_init_zero {""} /* Field tags (for use in manual encoding/decoding) */ #define wippersnapper_i2c_v1_I2CDeviceInitRequests_list_tag 1 +#define wippersnapper_i2c_v1_CharLCDConfig_rows_tag 1 +#define wippersnapper_i2c_v1_CharLCDConfig_columns_tag 2 +#define wippersnapper_i2c_v1_CharLCDWrite_message_tag 1 +#define wippersnapper_i2c_v1_CharLCDWrite_enable_backlight_tag 2 #define wippersnapper_i2c_v1_I2CBusInitRequest_i2c_pin_scl_tag 1 #define wippersnapper_i2c_v1_I2CBusInitRequest_i2c_pin_sda_tag 2 #define wippersnapper_i2c_v1_I2CBusInitRequest_i2c_frequency_tag 3 @@ -215,21 +307,38 @@ extern "C" { #define wippersnapper_i2c_v1_I2CDeviceSensorProperties_sensor_period_tag 2 #define wippersnapper_i2c_v1_I2CDeviceUpdateResponse_i2c_device_address_tag 1 #define wippersnapper_i2c_v1_I2CDeviceUpdateResponse_bus_response_tag 3 +#define wippersnapper_i2c_v1_LEDBackpackConfig_brightness_tag 1 +#define wippersnapper_i2c_v1_LEDBackpackConfig_alignment_tag 2 +#define wippersnapper_i2c_v1_LEDBackpackWrite_message_tag 1 +#define wippersnapper_i2c_v1_SSD1306Config_width_tag 1 +#define wippersnapper_i2c_v1_SSD1306Config_height_tag 2 +#define wippersnapper_i2c_v1_SSD1306Config_text_size_tag 3 +#define wippersnapper_i2c_v1_SSD1306Write_message_tag 1 #define wippersnapper_i2c_v1_SensorEvent_type_tag 1 #define wippersnapper_i2c_v1_SensorEvent_value_tag 2 #define wippersnapper_i2c_v1_I2CBusScanRequest_i2c_port_number_tag 1 #define wippersnapper_i2c_v1_I2CBusScanRequest_bus_init_request_tag 2 #define wippersnapper_i2c_v1_I2CDeviceEvent_sensor_address_tag 1 #define wippersnapper_i2c_v1_I2CDeviceEvent_sensor_event_tag 2 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_i2c_device_address_tag 1 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_i2c_device_name_tag 2 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_led_backpack_tag 3 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_char_lcd_tag 4 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_write_ssd1306_tag 5 +#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_port_number_tag 1 +#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_address_tag 2 +#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_name_tag 3 +#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_properties_tag 4 +#define wippersnapper_i2c_v1_I2COutputAdd_led_backpack_config_tag 1 +#define wippersnapper_i2c_v1_I2COutputAdd_char_lcd_config_tag 2 +#define wippersnapper_i2c_v1_I2COutputAdd_ssd1306_config_tag 3 #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_port_number_tag 1 #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_bus_init_req_tag 2 #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_device_address_tag 3 #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_device_name_tag 4 #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_device_properties_tag 5 -#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_port_number_tag 1 -#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_address_tag 2 -#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_name_tag 3 -#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_i2c_device_properties_tag 4 +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_is_output_device_tag 6 +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_output_add_tag 7 /* Struct field encoding specification for nanopb */ #define wippersnapper_i2c_v1_I2CBusInitRequest_FIELDLIST(X, a) \ @@ -281,11 +390,14 @@ X(a, STATIC, SINGULAR, INT32, i2c_port_number, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, i2c_bus_init_req, 2) \ X(a, STATIC, SINGULAR, UINT32, i2c_device_address, 3) \ X(a, STATIC, SINGULAR, STRING, i2c_device_name, 4) \ -X(a, STATIC, REPEATED, MESSAGE, i2c_device_properties, 5) +X(a, STATIC, REPEATED, MESSAGE, i2c_device_properties, 5) \ +X(a, STATIC, SINGULAR, BOOL, is_output_device, 6) \ +X(a, STATIC, OPTIONAL, MESSAGE, i2c_output_add, 7) #define wippersnapper_i2c_v1_I2CDeviceInitRequest_CALLBACK NULL #define wippersnapper_i2c_v1_I2CDeviceInitRequest_DEFAULT NULL #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_bus_init_req_MSGTYPE wippersnapper_i2c_v1_I2CBusInitRequest #define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_device_properties_MSGTYPE wippersnapper_i2c_v1_I2CDeviceSensorProperties +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_i2c_output_add_MSGTYPE wippersnapper_i2c_v1_I2COutputAdd #define wippersnapper_i2c_v1_I2CDeviceInitResponse_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, i2c_device_address, 2) \ @@ -333,6 +445,63 @@ X(a, STATIC, REPEATED, MESSAGE, sensor_event, 2) #define wippersnapper_i2c_v1_I2CDeviceEvent_DEFAULT NULL #define wippersnapper_i2c_v1_I2CDeviceEvent_sensor_event_MSGTYPE wippersnapper_i2c_v1_SensorEvent +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, i2c_device_address, 1) \ +X(a, STATIC, SINGULAR, STRING, i2c_device_name, 2) \ +X(a, STATIC, ONEOF, MESSAGE, (output_msg,write_led_backpack,output_msg.write_led_backpack), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (output_msg,write_char_lcd,output_msg.write_char_lcd), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (output_msg,write_ssd1306,output_msg.write_ssd1306), 5) +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_CALLBACK NULL +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_DEFAULT NULL +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_output_msg_write_led_backpack_MSGTYPE wippersnapper_i2c_v1_LEDBackpackWrite +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_output_msg_write_char_lcd_MSGTYPE wippersnapper_i2c_v1_CharLCDWrite +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_output_msg_write_ssd1306_MSGTYPE wippersnapper_i2c_v1_SSD1306Write + +#define wippersnapper_i2c_v1_LEDBackpackConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, INT32, brightness, 1) \ +X(a, STATIC, SINGULAR, UENUM, alignment, 2) +#define wippersnapper_i2c_v1_LEDBackpackConfig_CALLBACK NULL +#define wippersnapper_i2c_v1_LEDBackpackConfig_DEFAULT NULL + +#define wippersnapper_i2c_v1_CharLCDConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, rows, 1) \ +X(a, STATIC, SINGULAR, UINT32, columns, 2) +#define wippersnapper_i2c_v1_CharLCDConfig_CALLBACK NULL +#define wippersnapper_i2c_v1_CharLCDConfig_DEFAULT NULL + +#define wippersnapper_i2c_v1_SSD1306Config_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, width, 1) \ +X(a, STATIC, SINGULAR, UINT32, height, 2) \ +X(a, STATIC, SINGULAR, UENUM, text_size, 3) +#define wippersnapper_i2c_v1_SSD1306Config_CALLBACK NULL +#define wippersnapper_i2c_v1_SSD1306Config_DEFAULT NULL + +#define wippersnapper_i2c_v1_I2COutputAdd_FIELDLIST(X, a) \ +X(a, STATIC, ONEOF, MESSAGE, (config,led_backpack_config,config.led_backpack_config), 1) \ +X(a, STATIC, ONEOF, MESSAGE, (config,char_lcd_config,config.char_lcd_config), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (config,ssd1306_config,config.ssd1306_config), 3) +#define wippersnapper_i2c_v1_I2COutputAdd_CALLBACK NULL +#define wippersnapper_i2c_v1_I2COutputAdd_DEFAULT NULL +#define wippersnapper_i2c_v1_I2COutputAdd_config_led_backpack_config_MSGTYPE wippersnapper_i2c_v1_LEDBackpackConfig +#define wippersnapper_i2c_v1_I2COutputAdd_config_char_lcd_config_MSGTYPE wippersnapper_i2c_v1_CharLCDConfig +#define wippersnapper_i2c_v1_I2COutputAdd_config_ssd1306_config_MSGTYPE wippersnapper_i2c_v1_SSD1306Config + +#define wippersnapper_i2c_v1_LEDBackpackWrite_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, message, 1) +#define wippersnapper_i2c_v1_LEDBackpackWrite_CALLBACK NULL +#define wippersnapper_i2c_v1_LEDBackpackWrite_DEFAULT NULL + +#define wippersnapper_i2c_v1_CharLCDWrite_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, message, 1) \ +X(a, STATIC, SINGULAR, BOOL, enable_backlight, 2) +#define wippersnapper_i2c_v1_CharLCDWrite_CALLBACK NULL +#define wippersnapper_i2c_v1_CharLCDWrite_DEFAULT NULL + +#define wippersnapper_i2c_v1_SSD1306Write_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, message, 1) +#define wippersnapper_i2c_v1_SSD1306Write_CALLBACK NULL +#define wippersnapper_i2c_v1_SSD1306Write_DEFAULT NULL + extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CBusInitRequest_msg; extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CBusInitResponse_msg; extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CBusSetFrequency_msg; @@ -348,6 +517,14 @@ extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceDeinitRequest_msg; extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceDeinitResponse_msg; extern const pb_msgdesc_t wippersnapper_i2c_v1_SensorEvent_msg; extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceEvent_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceOutputWrite_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_LEDBackpackConfig_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_CharLCDConfig_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_SSD1306Config_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_I2COutputAdd_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_LEDBackpackWrite_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_CharLCDWrite_msg; +extern const pb_msgdesc_t wippersnapper_i2c_v1_SSD1306Write_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define wippersnapper_i2c_v1_I2CBusInitRequest_fields &wippersnapper_i2c_v1_I2CBusInitRequest_msg @@ -365,6 +542,14 @@ extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceEvent_msg; #define wippersnapper_i2c_v1_I2CDeviceDeinitResponse_fields &wippersnapper_i2c_v1_I2CDeviceDeinitResponse_msg #define wippersnapper_i2c_v1_SensorEvent_fields &wippersnapper_i2c_v1_SensorEvent_msg #define wippersnapper_i2c_v1_I2CDeviceEvent_fields &wippersnapper_i2c_v1_I2CDeviceEvent_msg +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_fields &wippersnapper_i2c_v1_I2CDeviceOutputWrite_msg +#define wippersnapper_i2c_v1_LEDBackpackConfig_fields &wippersnapper_i2c_v1_LEDBackpackConfig_msg +#define wippersnapper_i2c_v1_CharLCDConfig_fields &wippersnapper_i2c_v1_CharLCDConfig_msg +#define wippersnapper_i2c_v1_SSD1306Config_fields &wippersnapper_i2c_v1_SSD1306Config_msg +#define wippersnapper_i2c_v1_I2COutputAdd_fields &wippersnapper_i2c_v1_I2COutputAdd_msg +#define wippersnapper_i2c_v1_LEDBackpackWrite_fields &wippersnapper_i2c_v1_LEDBackpackWrite_msg +#define wippersnapper_i2c_v1_CharLCDWrite_fields &wippersnapper_i2c_v1_CharLCDWrite_msg +#define wippersnapper_i2c_v1_SSD1306Write_fields &wippersnapper_i2c_v1_SSD1306Write_msg /* Maximum encoded size of messages (where known) */ #define wippersnapper_i2c_v1_I2CBusInitRequest_size 39 @@ -374,14 +559,22 @@ extern const pb_msgdesc_t wippersnapper_i2c_v1_I2CDeviceEvent_msg; #define wippersnapper_i2c_v1_I2CBusScanResponse_size 722 #define wippersnapper_i2c_v1_I2CDeviceSensorProperties_size 8 /* wippersnapper_i2c_v1_I2CDeviceInitRequests_size depends on runtime parameters */ -#define wippersnapper_i2c_v1_I2CDeviceInitRequest_size 224 +#define wippersnapper_i2c_v1_I2CDeviceInitRequest_size 486 #define wippersnapper_i2c_v1_I2CDeviceInitResponse_size 8 -#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_size 183 +#define wippersnapper_i2c_v1_I2CDeviceUpdateRequest_size 425 #define wippersnapper_i2c_v1_I2CDeviceUpdateResponse_size 8 #define wippersnapper_i2c_v1_I2CDeviceDeinitRequest_size 17 #define wippersnapper_i2c_v1_I2CDeviceDeinitResponse_size 8 #define wippersnapper_i2c_v1_SensorEvent_size 7 #define wippersnapper_i2c_v1_I2CDeviceEvent_size 141 +#define wippersnapper_i2c_v1_I2CDeviceOutputWrite_size 525 +#define wippersnapper_i2c_v1_LEDBackpackConfig_size 13 +#define wippersnapper_i2c_v1_CharLCDConfig_size 12 +#define wippersnapper_i2c_v1_SSD1306Config_size 14 +#define wippersnapper_i2c_v1_I2COutputAdd_size 16 +#define wippersnapper_i2c_v1_LEDBackpackWrite_size 6 +#define wippersnapper_i2c_v1_CharLCDWrite_size 132 +#define wippersnapper_i2c_v1_SSD1306Write_size 258 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/wippersnapper/pin/v1/pin.pb.c b/src/wippersnapper/pin/v1/pin.pb.c index cadf00dee..1af87d19c 100644 --- a/src/wippersnapper/pin/v1/pin.pb.c +++ b/src/wippersnapper/pin/v1/pin.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/pin/v1/pin.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/pin/v1/pin.pb.h b/src/wippersnapper/pin/v1/pin.pb.h index 9859c9ff2..25a1c308c 100644 --- a/src/wippersnapper/pin/v1/pin.pb.h +++ b/src/wippersnapper/pin/v1/pin.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_PIN_V1_WIPPERSNAPPER_PIN_V1_PIN_PB_H_INCLUDED #define PB_WIPPERSNAPPER_PIN_V1_WIPPERSNAPPER_PIN_V1_PIN_PB_H_INCLUDED diff --git a/src/wippersnapper/pixels/v1/pixels.pb.c b/src/wippersnapper/pixels/v1/pixels.pb.c index 1e3532d81..cc0676d86 100644 --- a/src/wippersnapper/pixels/v1/pixels.pb.c +++ b/src/wippersnapper/pixels/v1/pixels.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/pixels/v1/pixels.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/pixels/v1/pixels.pb.h b/src/wippersnapper/pixels/v1/pixels.pb.h index 81a309c19..ec7012740 100644 --- a/src/wippersnapper/pixels/v1/pixels.pb.h +++ b/src/wippersnapper/pixels/v1/pixels.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_PIXELS_V1_WIPPERSNAPPER_PIXELS_V1_PIXELS_PB_H_INCLUDED #define PB_WIPPERSNAPPER_PIXELS_V1_WIPPERSNAPPER_PIXELS_V1_PIXELS_PB_H_INCLUDED diff --git a/src/wippersnapper/pwm/v1/pwm.pb.c b/src/wippersnapper/pwm/v1/pwm.pb.c index 743548385..5b7e93edd 100644 --- a/src/wippersnapper/pwm/v1/pwm.pb.c +++ b/src/wippersnapper/pwm/v1/pwm.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/pwm/v1/pwm.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/pwm/v1/pwm.pb.h b/src/wippersnapper/pwm/v1/pwm.pb.h index 5146ed396..6276ce124 100644 --- a/src/wippersnapper/pwm/v1/pwm.pb.h +++ b/src/wippersnapper/pwm/v1/pwm.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_PWM_V1_WIPPERSNAPPER_PWM_V1_PWM_PB_H_INCLUDED #define PB_WIPPERSNAPPER_PWM_V1_WIPPERSNAPPER_PWM_V1_PWM_PB_H_INCLUDED diff --git a/src/wippersnapper/servo/v1/servo.pb.c b/src/wippersnapper/servo/v1/servo.pb.c index e96dc47b1..2abade5e6 100644 --- a/src/wippersnapper/servo/v1/servo.pb.c +++ b/src/wippersnapper/servo/v1/servo.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/servo/v1/servo.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/servo/v1/servo.pb.h b/src/wippersnapper/servo/v1/servo.pb.h index ee5fdeb43..f2c1335ae 100644 --- a/src/wippersnapper/servo/v1/servo.pb.h +++ b/src/wippersnapper/servo/v1/servo.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_SERVO_V1_WIPPERSNAPPER_SERVO_V1_SERVO_PB_H_INCLUDED #define PB_WIPPERSNAPPER_SERVO_V1_WIPPERSNAPPER_SERVO_V1_SERVO_PB_H_INCLUDED diff --git a/src/wippersnapper/signal/v1/signal.pb.c b/src/wippersnapper/signal/v1/signal.pb.c index e793af832..bc878712c 100644 --- a/src/wippersnapper/signal/v1/signal.pb.c +++ b/src/wippersnapper/signal/v1/signal.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/signal/v1/signal.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -18,7 +18,7 @@ PB_BIND(wippersnapper_signal_v1_Ds18x20Request, wippersnapper_signal_v1_Ds18x20R PB_BIND(wippersnapper_signal_v1_Ds18x20Response, wippersnapper_signal_v1_Ds18x20Response, AUTO) -PB_BIND(wippersnapper_signal_v1_I2CRequest, wippersnapper_signal_v1_I2CRequest, AUTO) +PB_BIND(wippersnapper_signal_v1_I2CRequest, wippersnapper_signal_v1_I2CRequest, 2) PB_BIND(wippersnapper_signal_v1_I2CResponse, wippersnapper_signal_v1_I2CResponse, 2) diff --git a/src/wippersnapper/signal/v1/signal.pb.h b/src/wippersnapper/signal/v1/signal.pb.h index 328fd3757..246580f6a 100644 --- a/src/wippersnapper/signal/v1/signal.pb.h +++ b/src/wippersnapper/signal/v1/signal.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_SIGNAL_V1_WIPPERSNAPPER_SIGNAL_V1_SIGNAL_PB_H_INCLUDED #define PB_WIPPERSNAPPER_SIGNAL_V1_WIPPERSNAPPER_SIGNAL_V1_SIGNAL_PB_H_INCLUDED @@ -56,6 +56,7 @@ typedef struct _wippersnapper_signal_v1_I2CRequest { wippersnapper_i2c_v1_I2CDeviceDeinitRequest req_i2c_device_deinit; wippersnapper_i2c_v1_I2CDeviceUpdateRequest req_i2c_device_update; wippersnapper_i2c_v1_I2CDeviceInitRequests req_i2c_device_init_requests; + wippersnapper_i2c_v1_I2CDeviceOutputWrite req_i2c_device_out_write; } payload; } wippersnapper_signal_v1_I2CRequest; @@ -201,6 +202,7 @@ extern "C" { #define wippersnapper_signal_v1_I2CRequest_req_i2c_device_deinit_tag 5 #define wippersnapper_signal_v1_I2CRequest_req_i2c_device_update_tag 6 #define wippersnapper_signal_v1_I2CRequest_req_i2c_device_init_requests_tag 7 +#define wippersnapper_signal_v1_I2CRequest_req_i2c_device_out_write_tag 8 #define wippersnapper_signal_v1_I2CResponse_resp_i2c_scan_tag 2 #define wippersnapper_signal_v1_I2CResponse_resp_i2c_device_init_tag 3 #define wippersnapper_signal_v1_I2CResponse_resp_i2c_device_deinit_tag 4 @@ -265,7 +267,8 @@ X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_set_freq,payload.req_i2c_set X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_init,payload.req_i2c_device_init), 4) \ X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_deinit,payload.req_i2c_device_deinit), 5) \ X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_update,payload.req_i2c_device_update), 6) \ -X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_init_requests,payload.req_i2c_device_init_requests), 7) +X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_init_requests,payload.req_i2c_device_init_requests), 7) \ +X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_out_write,payload.req_i2c_device_out_write), 8) #define wippersnapper_signal_v1_I2CRequest_CALLBACK NULL #define wippersnapper_signal_v1_I2CRequest_DEFAULT NULL #define wippersnapper_signal_v1_I2CRequest_payload_req_i2c_scan_MSGTYPE wippersnapper_i2c_v1_I2CBusScanRequest @@ -274,6 +277,7 @@ X(a, STATIC, ONEOF, MSG_W_CB, (payload,req_i2c_device_init_requests,payload #define wippersnapper_signal_v1_I2CRequest_payload_req_i2c_device_deinit_MSGTYPE wippersnapper_i2c_v1_I2CDeviceDeinitRequest #define wippersnapper_signal_v1_I2CRequest_payload_req_i2c_device_update_MSGTYPE wippersnapper_i2c_v1_I2CDeviceUpdateRequest #define wippersnapper_signal_v1_I2CRequest_payload_req_i2c_device_init_requests_MSGTYPE wippersnapper_i2c_v1_I2CDeviceInitRequests +#define wippersnapper_signal_v1_I2CRequest_payload_req_i2c_device_out_write_MSGTYPE wippersnapper_i2c_v1_I2CDeviceOutputWrite #define wippersnapper_signal_v1_I2CResponse_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MSG_W_CB, (payload,resp_i2c_scan,payload.resp_i2c_scan), 2) \ @@ -393,7 +397,7 @@ extern const pb_msgdesc_t wippersnapper_signal_v1_PWMResponse_msg; #define wippersnapper_signal_v1_Ds18x20Request_size 39 #define wippersnapper_signal_v1_Ds18x20Response_size 26 #if defined(wippersnapper_i2c_v1_I2CDeviceInitRequests_size) -union wippersnapper_signal_v1_I2CRequest_payload_size_union {char f7[(6 + wippersnapper_i2c_v1_I2CDeviceInitRequests_size)]; char f0[227];}; +union wippersnapper_signal_v1_I2CRequest_payload_size_union {char f7[(6 + wippersnapper_i2c_v1_I2CDeviceInitRequests_size)]; char f0[528];}; #define wippersnapper_signal_v1_I2CRequest_size (0 + sizeof(union wippersnapper_signal_v1_I2CRequest_payload_size_union)) #endif #define wippersnapper_signal_v1_I2CResponse_size 725 diff --git a/src/wippersnapper/uart/v1/uart.pb.c b/src/wippersnapper/uart/v1/uart.pb.c index b58470741..b87ed0bcd 100644 --- a/src/wippersnapper/uart/v1/uart.pb.c +++ b/src/wippersnapper/uart/v1/uart.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #include "wippersnapper/uart/v1/uart.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/wippersnapper/uart/v1/uart.pb.h b/src/wippersnapper/uart/v1/uart.pb.h index fc197c4c2..fe6e092a3 100644 --- a/src/wippersnapper/uart/v1/uart.pb.h +++ b/src/wippersnapper/uart/v1/uart.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5-dev at Wed Sep 6 18:22:09 2023. */ +/* Generated by nanopb-0.4.5-dev at Thu Jun 5 15:39:11 2025. */ #ifndef PB_WIPPERSNAPPER_UART_V1_WIPPERSNAPPER_UART_V1_UART_PB_H_INCLUDED #define PB_WIPPERSNAPPER_UART_V1_WIPPERSNAPPER_UART_V1_UART_PB_H_INCLUDED