{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "project_id", "profile", "display_name", "device", "uart", "outputs", "motors", "limits", "temperature", "pins", "resource_policy", "protocol", "timeouts", "watchdog" ], "properties": { "project_id": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "profile": { "type": "string" }, "display_name": { "type": "string", "minLength": 1 }, "device": { "type": "object", "required": [ "family", "part", "clock_hz", "clock_ball" ], "properties": { "family": { "type": "string" }, "part": { "type": "string" }, "clock_hz": { "type": "integer" }, "clock_ball": { "type": "string" } }, "additionalProperties": false }, "uart": { "type": "object", "required": [ "baud", "data_bits", "parity", "stop_bits", "flow_control", "clks_per_bit", "inter_byte_timeout_ms", "rx_ball", "tx_ball" ], "properties": { "baud": { "type": "integer" }, "data_bits": { "type": "integer" }, "parity": { "type": "string" }, "stop_bits": { "type": "integer" }, "flow_control": { "type": "string" }, "clks_per_bit": { "type": "integer" }, "inter_byte_timeout_ms": { "type": "integer" }, "rx_ball": { "type": "string" }, "tx_ball": { "type": "string" } }, "additionalProperties": false }, "outputs": { "type": "object", "required": [ "ptc_count", "fan_count", "ptc_channels", "fan_channels", "pwm_bits", "pwm_internal_width", "pwm_max_duty", "pwm_phase_count", "pwm_slot_clks", "pwm_frequency_hz", "pwm_actual_frequency_hz", "ptc_polarity", "fan_polarity", "ptc_default", "fan_default", "fan_connector_active_level", "fan_board_inverts", "boot_targets" ], "properties": { "ptc_count": { "type": "integer" }, "fan_count": { "type": "integer" }, "ptc_channels": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/channel" } }, "fan_channels": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/channel" } }, "pwm_bits": { "type": "integer" }, "pwm_internal_width": { "type": "integer" }, "pwm_max_duty": { "type": "integer" }, "pwm_phase_count": { "type": "integer" }, "pwm_slot_clks": { "type": "integer" }, "pwm_frequency_hz": { "type": "integer" }, "pwm_actual_frequency_hz": { "type": "number" }, "ptc_polarity": { "type": "string" }, "fan_polarity": { "type": "string" }, "ptc_default": { "type": "integer" }, "fan_default": { "type": "integer" }, "fan_connector_active_level": { "type": "string" }, "fan_board_inverts": { "type": "boolean" }, "boot_targets": { "type": "object", "required": [ "ptc", "fan" ], "properties": { "ptc": { "type": "integer" }, "fan": { "type": "integer" } }, "additionalProperties": false } }, "additionalProperties": false }, "motors": { "type": "object", "required": [ "count", "order", "role", "fixed_steps", "execution", "busy_wait_ms", "step_rate_hz", "step_half_cycles", "dir_setup_cycles", "command_values", "heartbeat_value", "mapping", "enable_n" ], "properties": { "count": { "type": "integer" }, "order": { "type": "array" }, "role": { "type": "string" }, "fixed_steps": { "type": "integer" }, "execution": { "type": "string" }, "busy_wait_ms": { "type": "integer", "minimum": 600 }, "step_rate_hz": { "type": "integer" }, "step_half_cycles": { "type": "integer" }, "dir_setup_cycles": { "type": "integer" }, "command_values": { "type": "array" }, "heartbeat_value": { "type": "integer" }, "mapping": { "type": "object", "required": [ "x", "y" ], "properties": { "x": { "$ref": "#/$defs/motor" }, "y": { "$ref": "#/$defs/motor" } }, "additionalProperties": false }, "enable_n": { "type": "object", "required": [ "ball", "active_level", "policy" ], "properties": { "ball": { "type": "string" }, "active_level": { "type": "string" }, "policy": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "limits": { "type": "object", "required": [ "limit_count", "active_level", "functional_use", "channels" ], "properties": { "limit_count": { "type": "integer" }, "active_level": { "type": "string" }, "functional_use": { "type": "boolean" }, "channels": { "type": "array", "minItems": 2, "maxItems": 2, "prefixItems": [ { "$ref": "#/$defs/x_limit" }, { "$ref": "#/$defs/y_limit" } ], "items": false } }, "additionalProperties": false }, "temperature": { "type": "object", "required": [ "value_count", "device_addresses", "registers", "scl_ball", "sda_ball", "bus", "device", "invalid_value", "maximum_celsius", "conversion" ], "properties": { "value_count": { "type": "integer" }, "device_addresses": { "type": "array" }, "registers": { "type": "array" }, "scl_ball": { "type": "string" }, "sda_ball": { "type": "string" }, "bus": { "type": "string" }, "device": { "type": "string" }, "invalid_value": { "type": "integer" }, "maximum_celsius": { "type": "integer" }, "conversion": { "type": "object", "required": [ "profile", "raw_shift", "raw_width", "reject_sign_bit" ], "properties": { "profile": { "type": "string" }, "raw_shift": { "type": "integer" }, "raw_width": { "type": "integer" }, "reject_sign_bit": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, "pins": { "type": "object", "required": [ "host_uart_rx", "host_uart_tx", "temp_scl", "temp_sda", "ptc_pwm", "fan_pwm", "motor_en_n", "x_step", "x_dir", "y_step", "y_dir", "x_limit_raw", "y_limit_raw" ], "properties": { "host_uart_rx": { "type": "string" }, "host_uart_tx": { "type": "string" }, "temp_scl": { "type": "string" }, "temp_sda": { "type": "string" }, "ptc_pwm": { "type": "array", "minItems": 1, "maxItems": 64 }, "fan_pwm": { "type": "array", "minItems": 1, "maxItems": 64 }, "motor_en_n": { "type": "string" }, "x_step": { "type": "string" }, "x_dir": { "type": "string" }, "y_step": { "type": "string" }, "y_dir": { "type": "string" }, "x_limit_raw": { "type": "string" }, "y_limit_raw": { "type": "string" } }, "additionalProperties": false }, "resource_policy": { "type": "object", "required": [ "target_ram_blocks", "request_ram_blocks", "temperature_ram_blocks", "dsp", "shared_pwm_comparators", "shared_motor_executors", "shared_i2c_readers" ], "properties": { "target_ram_blocks": { "type": "integer" }, "request_ram_blocks": { "type": "integer" }, "temperature_ram_blocks": { "type": "integer" }, "dsp": { "type": "integer" }, "shared_pwm_comparators": { "type": "integer" }, "shared_motor_executors": { "type": "integer" }, "shared_i2c_readers": { "type": "integer" } }, "additionalProperties": false }, "protocol": { "type": "object", "required": [ "header_hex", "crc", "commands", "set_all", "temperature_data" ], "properties": { "header_hex": { "type": "string" }, "crc": { "type": "object", "required": [ "name", "polynomial", "initial", "reflect_input", "reflect_output", "xor_output", "coverage", "wire_order" ], "properties": { "name": { "type": "string" }, "polynomial": { "type": "integer" }, "initial": { "type": "integer" }, "reflect_input": { "type": "boolean" }, "reflect_output": { "type": "boolean" }, "xor_output": { "type": "integer" }, "coverage": { "type": "string" }, "wire_order": { "type": "string" } }, "additionalProperties": false }, "commands": { "type": "object", "required": [ "set_all", "get_temperature", "temperature_data" ], "properties": { "set_all": { "type": "integer" }, "get_temperature": { "type": "integer" }, "temperature_data": { "type": "integer" } }, "additionalProperties": false }, "set_all": { "type": "object", "required": [ "payload_length", "ptc_offset", "fan_offset", "motor_x_offset", "motor_y_offset", "duty_min", "duty_max", "motor_values", "heartbeat", "response" ], "properties": { "payload_length": { "type": "integer" }, "ptc_offset": { "type": "integer" }, "fan_offset": { "type": "integer" }, "motor_x_offset": { "type": "integer" }, "motor_y_offset": { "type": "integer" }, "duty_min": { "type": "integer" }, "duty_max": { "type": "integer" }, "motor_values": { "type": "array" }, "heartbeat": { "type": "array" }, "response": { "type": "string" } }, "additionalProperties": false }, "temperature_data": { "type": "object", "required": [ "payload_length", "frame_length" ], "properties": { "payload_length": { "type": "integer" }, "frame_length": { "type": "integer" } }, "additionalProperties": false } }, "additionalProperties": false }, "timeouts": { "type": "object", "required": [ "frame_inter_byte_ms", "host_get_response_ms" ], "properties": { "frame_inter_byte_ms": { "type": "integer" }, "host_get_response_ms": { "type": "integer" } }, "additionalProperties": false }, "watchdog": { "type": "object", "required": [ "timeout_seconds", "tick_us", "tick_clks", "timeout_ticks", "target" ], "properties": { "timeout_seconds": { "type": "integer" }, "tick_us": { "type": "integer" }, "tick_clks": { "type": "integer" }, "timeout_ticks": { "type": "integer" }, "target": { "type": "object", "required": [ "ptc", "fan" ], "properties": { "ptc": { "type": "integer" }, "fan": { "type": "integer" } }, "additionalProperties": false } }, "additionalProperties": false } }, "$defs": { "channel": { "type": "object", "required": [ "index", "name", "signal", "board_signal", "ball", "connector", "connector_pin", "polarity" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "name": { "type": "string", "pattern": "^(ptc|fan)[1-9][0-9]*$" }, "signal": { "type": "string", "pattern": "^(ptc|fan)_pwm_out\\[[0-9]+\\]$" }, "board_signal": { "type": "string", "minLength": 1 }, "ball": { "type": "string", "pattern": "^[A-Z][0-9]+$" }, "connector": { "type": "string", "pattern": "^CON[0-9]+$" }, "connector_pin": { "type": "integer", "minimum": 1, "maximum": 14 }, "polarity": { "type": "string", "enum": [ "active_high", "active_low" ] } }, "additionalProperties": false }, "motor": { "type": "object", "required": [ "axis", "role", "step_ball", "dir_ball" ], "properties": { "axis": { "type": "string", "enum": [ "x", "y" ] }, "role": { "type": "string" }, "step_ball": { "type": "string", "enum": [ "C11", "D15" ] }, "dir_ball": { "type": "string", "enum": [ "B12", "H14" ] } }, "additionalProperties": false }, "x_limit": { "type": "object", "required": [ "name", "ball" ], "properties": { "name": { "type": "string" }, "ball": { "type": "string" } }, "additionalProperties": false }, "y_limit": { "type": "object", "required": [ "name", "ball" ], "properties": { "name": { "type": "string" }, "ball": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }