| { |
| "title": "Sensor descriptor", |
| "description": "Detailed description of a sensor", |
| "type": "object", |
| "properties": { |
| "deps": { |
| "type": "array", |
| "description": "A list of definition files", |
| "items": { |
| "type": "string", |
| "description": "A definition file to include" |
| } |
| }, |
| "compatible": { |
| "type": "object", |
| "description": "A unique identifier of the sensor", |
| "properties": { |
| "org": { |
| "type": "string", |
| "description": "The organization that developed the sensor" |
| }, |
| "part": { |
| "type": "string", |
| "description": "The part number or identifier" |
| } |
| }, |
| "additionalProperties": false, |
| "required": [ |
| "org", |
| "part" |
| ] |
| }, |
| "description": { |
| "type": "string", |
| "description": "A description of the sensor" |
| }, |
| "supported-buses": { |
| "type": "array", |
| "description": "One or more buses which this sensor driver supports", |
| "minItems": 1, |
| "items": { |
| "enum": [ |
| "i2c", |
| "spi" |
| ] |
| } |
| }, |
| "attributes": { |
| "type": "array", |
| "description": "A set of attribute/channel pairs supported by this sensor", |
| "items": { |
| "type": "object", |
| "description": "Pair of supported attribute and channel", |
| "properties": { |
| "attribute": { |
| "type": "string", |
| "description": "Name of the attribute" |
| }, |
| "channel": { |
| "type": "string", |
| "description": "Name of the channel" |
| }, |
| "units": { |
| "type": "string", |
| "description": "Name of the units" |
| } |
| }, |
| "additionalProperties": false, |
| "required": [ |
| "attribute", |
| "channel", |
| "units" |
| ] |
| } |
| }, |
| "channels": { |
| "type": "object", |
| "description": "A set of channels supported by this sensor", |
| "patternProperties": { |
| "^[a-zA-Z_]\\w*$": { |
| "type": "array", |
| "description": "A list specifying each instance of this channel, if not specified then it is assumed to be 1 with the same properties as the parent channel", |
| "items": { |
| "type": "object", |
| "description": "A single instance of a sensor channel", |
| "properties": { |
| "name": { |
| "type": "string", |
| "description": "A name override for the channel instance" |
| }, |
| "description": { |
| "type": "string", |
| "description": "A description override for the channel instance" |
| } |
| }, |
| "additionalProperties": false |
| } |
| } |
| }, |
| "additionalProperties": false, |
| "minProperties": 1 |
| }, |
| "triggers": { |
| "type": "array", |
| "description": "A mapping of triggers to their definitions", |
| "items": { |
| "type": "string", |
| "description": "Trigger name" |
| } |
| }, |
| "extras": { |
| "type": "object", |
| "description": "Any extra data that is useful to the downstream user", |
| "additionalProperties": true |
| } |
| }, |
| "additionalProperties": false, |
| "required": [ |
| "compatible", |
| "supported-buses" |
| ] |
| } |