Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,4 @@ dmypy.json
cython_debug/


/.vs
65 changes: 64 additions & 1 deletion proto/wippersnapper/display/v1/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,76 @@ This file details the WipperSnapper messaging API for interfacing with a display

The following WipperSnapper Components may utilize `display.proto`:

* E-Ink/E-Paper Displays
* E-Ink/E-Paper Displays (EPD)
* TFT Displays
* OLED Displays
* 7-Segment Displays
* Alphanumeric Displays
* LCD Character Displays

## Supported Display Drivers

### E-Paper/E-Ink Displays (EPD)

| Driver | Description | Adafruit Product |
|--------|-------------|------------------|
| **SSD1680** | EPD controller for monochrome e-paper displays | Various |
| **ILI0373** | EPD controller (also known as SSD167) | Various |
| **UC8253** | 3.7" Monochrome E-Ink Display driver (416x240) | [#6395](https://www.adafruit.com/product/6395) |
| **UC8179** | 5.83" Monochrome E-Ink Display driver (648x480) | [#6397](https://www.adafruit.com/product/6397) |
| **UC8151** | 2.9" Flexible E-Ink Display driver (296x128, also ILI0343) | [#4262](https://www.adafruit.com/product/4262) |
| **SSD1683** | 4.2" Grayscale E-Ink Display driver (300x400) | [#6381](https://www.adafruit.com/product/6381) |

### TFT Displays

| Driver | Description |
|--------|-------------|
| **ST7789** | TFT LCD controller for color displays |

## Display Modes

### EPD Modes

E-Paper displays support different rendering modes:

* **EPD_MODE_GRAYSCALE4** - 4-level grayscale rendering
* **EPD_MODE_MONO** - Monochrome (black and white) rendering

## Configuration

### EPD Displays (SPI)

EPD displays require the following pin configuration:
* **bus** - The SPI bus number
* **pin_dc** - Data/Command pin
* **pin_rst** - Reset pin
* **pin_cs** - Chip Select pin
* **pin_sram_cs** - SRAM Chip Select pin (optional)
* **pin_busy** - Busy signal pin (indicates when display is ready)

EPD configuration parameters:
* **mode** - Display mode (grayscale or mono)
* **width** - Display width in pixels
* **height** - Display height in pixels
* **text_size** - Text scale factor (1 = 6x8px, 2 = 12x16px, etc.)

### TFT Displays (SPI)

TFT displays require the following pin configuration:
* **bus** - The SPI bus number
* **pin_cs** - Chip Select pin
* **pin_dc** - Data/Command pin
* **pin_mosi** - MOSI (Master Out Slave In) pin
* **pin_sck** - SCK (Serial Clock) pin
* **pin_rst** - Reset pin
* **pin_miso** - MISO (Master In Slave Out) pin

TFT configuration parameters:
* **width** - Display width in pixels
* **height** - Display height in pixels
* **rotation** - Display rotation (0-3)
* **text_size** - Text scale factor (1 = 6x8px, 2 = 12x16px, etc.)

## Sequence Diagrams

### Attaching a Display Component to a device running WipperSnapper
Expand Down
18 changes: 18 additions & 0 deletions proto/wippersnapper/display/v1/display.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,26 @@ enum DisplayDriver {
DISPLAY_DRIVER_EPD_SSD1680 = 1; /** EPD SSD1680 driver */
DISPLAY_DRIVER_EPD_ILI0373 = 2; /** EPD SSD167 driver */
DISPLAY_DRIVER_TFT_ST7789 = 3; /** TFT ST7789 driver */
DISPLAY_DRIVER_EPD_UC8253 = 4; /** EPD UC8253 driver */
DISPLAY_DRIVER_EPD_UC8179 = 5; /** EPD UC8179 driver */
DISPLAY_DRIVER_EPD_UC8151 = 6; /** EPD UC8151 driver */
DISPLAY_DRIVER_EPD_SSD1683 = 7; /** EPD SSD1683 driver */
}

/*
5.83" Monochrome E-Ink Display (648x480 UC8179) (#6397)
4.2" Grayscale E-Ink Display (300x400 SSD1683) (#6381)
3.7" Monochrome E-Ink Display (416x240 UC8253) (#6395)
2.9" Flexible E-Ink Display (296x128 UC8151 / now ILI0343) (#4262)

Qualia - pick one
Memento?

T-DisplayS3 ("i8080" intel 8-bit parallel bus - rgb565)

P4 pick one
*/

// ============================================================================
// Configuration Messages
// ============================================================================
Expand Down
78 changes: 78 additions & 0 deletions proto/wippersnapper/i2c/v1/i2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ This file details the API used by hardware running Adafruit WipperSnapper firmwa
The following JSON component definition type(s) reference `i2c.proto`:
* [i2c](https://github.com/adafruit/Wippersnapper_Components/tree/main/components/i2c)

## Bus Response Status Codes

All I2C operations return a `BusResponse` enum value to indicate success or failure:

| Status Code | Description |
|------------|-------------|
| `BUS_RESPONSE_SUCCESS` | I2C bus/device successfully initialized |
| `BUS_RESPONSE_ERROR_HANG` | I2C Bus hang detected - user should reset board if persists |
| `BUS_RESPONSE_ERROR_PULLUPS` | I2C bus failed - SDA or SCL needs a pull-up resistor |
| `BUS_RESPONSE_ERROR_WIRING` | I2C bus failed to communicate - check wiring |
| `BUS_RESPONSE_UNSUPPORTED_SENSOR` | WipperSnapper firmware outdated - update required |
| `BUS_RESPONSE_DEVICE_INIT_FAIL` | I2C device failed to initialize |
| `BUS_RESPONSE_DEVICE_DEINIT_FAIL` | I2C device failed to de-initialize |

## I2C Device Types

### Input Devices (Sensors)

Most I2C devices are sensors that read environmental data and send it to Adafruit IO. These devices use the `I2CDeviceSensorProperties` message to configure:
* **sensor_type** - The type of sensor (temperature, humidity, pressure, etc.) using the `SensorType` enum
* **sensor_period** - How often to read the sensor in milliseconds

### Output Devices

Some I2C devices are output devices (displays, LED controllers, etc.). These are configured with `is_output_device = true` and include an `I2COutputAdd` configuration:
* **LED Backpack** - Alphanumeric LED displays with brightness and alignment control
* **Character LCD** - Character LCD displays with row/column configuration
* **SSD1306 OLED** - Small OLED displays with configurable width, height, and text size

## Sequence Diagrams

### I2C Scan
Expand Down Expand Up @@ -92,4 +121,53 @@ IO->>Device: I2CDeviceDeinitRequest
Device->>IO: I2CDeviceDeinitResponse
```

## Supported Sensor Types

The `SensorType` enum defines all supported sensor measurement types and their units:

### Environmental Sensors
* `SENSOR_TYPE_AMBIENT_TEMPERATURE` - Air temperature in °C
* `SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT` - Air temperature in °F
* `SENSOR_TYPE_OBJECT_TEMPERATURE` - Object/surface temperature in °C
* `SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT` - Object/surface temperature in °F
* `SENSOR_TYPE_RELATIVE_HUMIDITY` - Relative humidity in %
* `SENSOR_TYPE_PRESSURE` - Atmospheric pressure in hPa
* `SENSOR_TYPE_ALTITUDE` - Altitude in meters

### Light Sensors
* `SENSOR_TYPE_LIGHT` - Light level (non-unit-specific)
* `SENSOR_TYPE_LUX` - Light level in lux
* `SENSOR_TYPE_COLOR` - RGB color values (0-1.0 range, 32-bit RGBA)

### Motion & Orientation Sensors
* `SENSOR_TYPE_ACCELEROMETER` - Acceleration in m/s²
* `SENSOR_TYPE_GYROSCOPE` - Angular rate in rad/s
* `SENSOR_TYPE_MAGNETIC_FIELD` - Magnetic field in µT
* `SENSOR_TYPE_ORIENTATION` - Orientation angle in degrees
* `SENSOR_TYPE_GRAVITY` - Gravity in m/s²
* `SENSOR_TYPE_LINEAR_ACCELERATION` - Acceleration (excluding gravity) in m/s²
* `SENSOR_TYPE_ROTATION_VECTOR` - Rotation angle in radians

### Air Quality Sensors
* `SENSOR_TYPE_PM10_STD` / `SENSOR_TYPE_PM10_ENV` - Particulate Matter 1.0 in ppm
* `SENSOR_TYPE_PM25_STD` / `SENSOR_TYPE_PM25_ENV` - Particulate Matter 2.5 in ppm
* `SENSOR_TYPE_PM100_STD` / `SENSOR_TYPE_PM100_ENV` - Particulate Matter 10.0 in ppm
* `SENSOR_TYPE_CO2` - Measured CO2 in ppm
* `SENSOR_TYPE_ECO2` - Estimated/equivalent CO2 in ppm
* `SENSOR_TYPE_GAS_RESISTANCE` - VOC gas resistance in Ω
* `SENSOR_TYPE_VOC_INDEX` - VOC index (1-500, 100 is normal)
* `SENSOR_TYPE_NOX_INDEX` - NOx index (1-500, 100 is normal)
* `SENSOR_TYPE_TVOC` - Total VOC in ppb

### Electrical Sensors
* `SENSOR_TYPE_VOLTAGE` - Voltage in V
* `SENSOR_TYPE_CURRENT` - Current in mA

### Distance & Position
* `SENSOR_TYPE_PROXIMITY` - Distance (non-unit-specific)

### Generic Types
* `SENSOR_TYPE_RAW` - Raw sensor value (no specific unit)
* `SENSOR_TYPE_UNITLESS_PERCENT` - Percentage value (unitless)


Loading
Loading