This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.json
102 lines (102 loc) · 3.11 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/device",
"definitions": {
"device": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"mcu_type": { "type": "integer" },
"device_type": { "type": "integer" },
"support_usb": { "type": "boolean" },
"support_serial": { "type": "boolean" },
"support_net": { "type": "boolean" },
"description": { "type": "string" },
"config_registers": {
"type": "array",
"items": { "$ref": "#/definitions/config-register" }
},
"variants": {
"type": "array",
"items": { "$ref": "#/definitions/variant" }
}
},
"required": ["description", "device_type", "mcu_type", "name", "variants"]
},
"config-register": {
"type": "object",
"additionalProperties": false,
"properties": {
"offset": { "type": "integer" },
"name": { "type": "string" },
"description": { "type": "string" },
"reset": { "type": "integer" },
"type": { "$ref": "#/definitions/int-type" },
"fields": {
"type": "array",
"items": { "$ref": "#/definitions/field" }
},
"explaination": {
"$ref": "#/definitions/explaination"
}
},
"required": ["name", "offset", "reset"]
},
"field": {
"type": "object",
"additionalProperties": false,
"properties": {
"bit_range": {
"type": "array",
"items": [
{ "type": "integer", "minimum": 0 },
{ "type": "integer", "minimum": 0 }
]
},
"name": { "type": "string" },
"description": { "type": "string" },
"explaination": { "$ref": "#/definitions/explaination" }
},
"required": ["bit_range", "name"]
},
"explaination": {
"type": "object",
"additionalProperties": true,
"propertyNames": {
"oneOf": [
{ "type": "integer", "minimum": 0 },
{ "type": "string", "pattern": "0b[01]+" },
{ "const": "_" }
]
}
},
"variant": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"chip_id": { "type": "integer" },
"flash_size": { "$ref": "#/definitions/eeprom-size" },
"eeprom_size": { "$ref": "#/definitions/eeprom-size" },
"eeprom_start_addr": { "$ref": "#/definitions/eeprom-size" },
"config_registers": { "type": "string" },
"alt_chip_ids": {
"type": "array",
"items": { "oneOf": [{ "type": "integer" }, { "const": "ALL" }] }
},
"support_usb": { "type": "boolean" },
"support_serial": { "type": "boolean" },
"support_net": { "type": "boolean" }
},
"required": ["chip_id", "flash_size", "name"]
},
"eeprom-size": {
"anyOf": [
{ "type": "integer", "minimum": 0 },
{ "type": "string", "pattern": "\\d+K$" }
]
},
"int-type": { "enum": ["u32"] }
}
}