Skip to content

Add - Settings#197

Merged
brentru merged 4 commits into
refactor/analogiofrom
add/sensor-settings
May 15, 2026
Merged

Add - Settings#197
brentru merged 4 commits into
refactor/analogiofrom
add/sensor-settings

Conversation

@brentru
Copy link
Copy Markdown
Member

@brentru brentru commented May 14, 2026

This pull request allows users to select options such as gain, oversampling, measurement rate, power mode, etc. It replaces the fixed enum for AnalogIn Gain with the generic settings map, and uses the same settings map for I2C device configuration.

Specification
Design overview:

  1. The definition is the source of truth for what settings are exposed for the pin/component
  2. The sensor driver is only place where the index 2 of gain maps.
  3. Protobuf never changes when a component is added, or when a new setting is added to an existing component.

Expected Operation:

  1. Let's assume a user is in the New Component flow in IO.Adafruit.com
  2. User selects BME280
  3. User clicks "Advanced Options" and fills: Temperature Oversampling = 4x, PRessure Oversampling = 8x, Humidity oversampling = 2x.

Protobuf msg is filled using a settings field, which holds all of the device's setting configurations.

map<string, uint32> settings = 3;  

where:

    settings: {
      "temp_oversampling": 3,      // "4x"
      "pressure_oversampling": 4,  // "8x"
      "humidity_oversampling": 2   // "2x"
    }
  1. Message is sent to the device
  2. Firmware passes the map to the driver
  3. Driver stores the raw index map
  4. Driver interprets the raw index map during its begin() call

Related: adafruit/Wippersnapper_Components#327
Resolves #126

Comment thread proto/wippersnapper/analogin.proto Outdated
Comment thread proto/wippersnapper/i2c.proto Outdated
Comment thread proto/wippersnapper/expander.proto Outdated
Copy link
Copy Markdown
Member

@tyeth tyeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks guys for being so amenable to the idea

@brentru
Copy link
Copy Markdown
Member Author

brentru commented May 15, 2026

Awesome, it was needed even if itll be a lift. Once I have the second approval I'll merge

@brentru brentru merged commit 28d04a7 into refactor/analogio May 15, 2026
1 check passed
@brentru brentru deleted the add/sensor-settings branch May 15, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants