Skip to content
Open
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
13 changes: 9 additions & 4 deletions schema/core.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://harp-tech.org/draft-03/schema/core.json",
"type": "object",
"allOf": [
{
"properties": {
"protocolVersion": {
"description": "Specifies the version of the device protocol.",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
"type": "string"
"$ref": "#/$defs/version"
}
},
"required": ["protocolVersion"]
},
{ "$ref": "registers.json" }
]
],
"$defs": {
"version": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
}
}
}
18 changes: 12 additions & 6 deletions schema/device.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://harp-tech.org/draft-03/schema/device.json",
"type": "object",
"allOf": [
Expand All @@ -15,13 +15,19 @@
},
"firmwareVersion": {
"description": "Specifies the version of the device firmware.",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
"type": "string"
"$ref": "core.json#/$defs/version"
},
"hardwareTargets": {
"description": "Specifies the version of the device hardware.",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
"type": "string"
"description": "Specifies the version of the hardware targets.",
"oneOf": [
{ "$ref": "core.json#/$defs/version" },
{
"type": "array",
"items": { "$ref": "core.json#/$defs/version" },
"uniqueItems": true,
"minItems": 1
}
]
},
"registers": {
"additionalProperties": {
Expand Down
12 changes: 6 additions & 6 deletions schema/ios.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://harp-tech.org/draft-03/schema/ios.json",
"type": "object",
"description": "Specifies the IO pin configuration used to automatically generate firmware.",
"additionalProperties": {
"oneOf": [
{ "$ref": "#/definitions/inputPin" },
{ "$ref": "#/definitions/outputPin" }
{ "$ref": "#/$defs/inputPin" },
{ "$ref": "#/$defs/outputPin" }
]
},
"definitions": {
"$defs": {
"portPin": {
"type": "object",
"properties": {
Expand All @@ -34,7 +34,7 @@
"required": ["port", "pinNumber", "direction"]
},
"inputPin": {
"allOf": [{ "$ref": "#/definitions/portPin" }],
"allOf": [{ "$ref": "#/$defs/portPin" }],
"properties": {
"direction": {
"enum": ["input"]
Expand Down Expand Up @@ -62,7 +62,7 @@
}
},
"outputPin": {
"allOf": [{ "$ref": "#/definitions/portPin" }],
"allOf": [{ "$ref": "#/$defs/portPin" }],
"properties": {
"direction": {
"enum": ["output"]
Expand Down
46 changes: 23 additions & 23 deletions schema/registers.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://harp-tech.org/draft-03/schema/registers.json",
"type": "object",
"properties": {
"registers": {
"type": "object",
"description": "Specifies the collection of registers implementing the device function.",
"additionalProperties": { "$ref": "#/definitions/register" }
"additionalProperties": { "$ref": "#/$defs/register" }
},
"bitMasks": {
"type": "object",
"description": "Specifies the collection of masks available to be used with the different registers.",
"additionalProperties": { "$ref": "#/definitions/bitMask" }
"additionalProperties": { "$ref": "#/$defs/bitMask" }
},
"groupMasks": {
"type": "object",
"description": "Specifies the collection of group masks available to be used with the different registers.",
"additionalProperties": { "$ref": "#/definitions/groupMask" }
"additionalProperties": { "$ref": "#/$defs/groupMask" }
}
},
"required": ["registers"],
"definitions": {
"$defs": {
"type": {
"description": "Specifies the type of the register payload.",
"type": "string",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
"bits": {
"type": "object",
"additionalProperties": { "$ref": "#/definitions/maskValue" }
"additionalProperties": { "$ref": "#/$defs/maskValue" }
}
},
"required": ["bits"]
Expand All @@ -75,7 +75,7 @@
},
"values": {
"type": "object",
"additionalProperties": { "$ref": "#/definitions/maskValue" }
"additionalProperties": { "$ref": "#/$defs/maskValue" }
}
},
"required": ["values"]
Expand Down Expand Up @@ -120,12 +120,12 @@
"description": "Specifies a summary description of the payload member.",
"type": "string"
},
"minValue": { "$ref": "#/definitions/minValue" },
"maxValue": { "$ref": "#/definitions/maxValue" },
"defaultValue": { "$ref": "#/definitions/defaultValue" },
"maskType": { "$ref": "#/definitions/maskType" },
"interfaceType": { "$ref": "#/definitions/interfaceType" },
"converter": { "$ref": "#/definitions/converter" }
"minValue": { "$ref": "#/$defs/minValue" },
"maxValue": { "$ref": "#/$defs/maxValue" },
"defaultValue": { "$ref": "#/$defs/defaultValue" },
"maskType": { "$ref": "#/$defs/maskType" },
"interfaceType": { "$ref": "#/$defs/interfaceType" },
"converter": { "$ref": "#/$defs/converter" }
}
},
"register": {
Expand All @@ -136,7 +136,7 @@
"type": "integer",
"maximum": 255
},
"type": { "$ref": "#/definitions/type" },
"type": { "$ref": "#/$defs/type" },
"length": {
"description": "Specifies the length of the register payload.",
"type": "integer",
Expand All @@ -145,10 +145,10 @@
"access": {
"description": "Specifies the expected use of the register.",
"oneOf": [
{ "$ref": "#/definitions/access" },
{ "$ref": "#/$defs/access" },
{
"type": "array",
"items": { "$ref": "#/definitions/access" },
"items": { "$ref": "#/$defs/access" },
"uniqueItems": true,
"minItems": 1,
"maxItems": 3
Expand All @@ -159,10 +159,10 @@
"description": "Specifies a summary description of the register function.",
"type": "string"
},
"minValue": { "$ref": "#/definitions/minValue" },
"maxValue": { "$ref": "#/definitions/maxValue" },
"defaultValue": { "$ref": "#/definitions/defaultValue" },
"maskType": { "$ref": "#/definitions/maskType" },
"minValue": { "$ref": "#/$defs/minValue" },
"maxValue": { "$ref": "#/$defs/maxValue" },
"defaultValue": { "$ref": "#/$defs/defaultValue" },
"maskType": { "$ref": "#/$defs/maskType" },
"visibility": {
"description": "Specifies whether the register function is exposed in the high-level interface.",
"type": "string",
Expand All @@ -174,10 +174,10 @@
},
"payloadSpec": {
"type": "object",
"additionalProperties": { "$ref": "#/definitions/payloadMember" }
"additionalProperties": { "$ref": "#/$defs/payloadMember" }
},
"interfaceType": { "$ref": "#/definitions/interfaceType" },
"converter": { "$ref": "#/definitions/converter" }
"interfaceType": { "$ref": "#/$defs/interfaceType" },
"converter": { "$ref": "#/$defs/converter" }
},
"required": ["address", "access", "type"]
}
Expand Down