| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://prod2u.local/schemas/prod2u-p4-normal-host-contract-v4.schema.json",
- "title": "Prod2U Profile 4 Normal minimal actuator host contract v4",
- "type": "object",
- "additionalProperties": false,
- "required": [
- "schema",
- "profile",
- "profile_id",
- "protocol",
- "version_source",
- "wire",
- "frame_types",
- "commands",
- "unsupported_commands",
- "responses",
- "motion",
- "limit",
- "watchdog",
- "programming"
- ],
- "properties": {
- "schema": {"const": "prod2u-p4-normal-host-contract-v4"},
- "profile": {"const": "prod2u-p4-normal-actuator-binary921-v3"},
- "profile_id": {"const": 4},
- "protocol": {"const": "binary921-v3"},
- "version_source": {"const": "lowercase_git_sha8"},
- "wire": {
- "type": "object",
- "required": [
- "magic_hex",
- "version",
- "seq",
- "timestamp_tick",
- "header_offsets",
- "crc16",
- "request_compatibility",
- "ordinary_response_order",
- "motor_status_response_order",
- "temperature_response_order",
- "unsolicited_frames"
- ],
- "properties": {
- "magic_hex": {"const": "A55A"},
- "version": {"const": 2},
- "seq": {"const": 0},
- "timestamp_tick": {"const": 0},
- "header_offsets": {
- "const": {
- "magic": [0, 1],
- "version": 2,
- "profile_id": 3,
- "frame_type": 4,
- "seq_u32_le": [5, 8],
- "timestamp_tick_u32_le": [9, 12],
- "payload_length_u8": 13,
- "payload": [14, "14+payload_length-1"],
- "crc16_le": ["14+payload_length", "15+payload_length"]
- }
- },
- "crc16": {
- "const": {
- "name": "CRC-16/CCITT-FALSE",
- "polynomial": 4129,
- "initial": 65535,
- "reflect_input": false,
- "reflect_output": false,
- "xor_output": 0,
- "coverage": "version_through_payload_inclusive",
- "wire_byte_order": "little-endian"
- }
- },
- "request_compatibility": {"const": "BYTE_EXACT_FROZEN"},
- "ordinary_response_order": {"const": ["HOST_ACK"]},
- "motor_status_response_order": {"const": ["HOST_ACK", "MOTION_STATUS"]},
- "temperature_response_order": {"const": ["TEMPERATURE_SHORT"]},
- "unsolicited_frames": {"const": false}
- },
- "additionalProperties": false
- },
- "frame_types": {
- "const": {
- "HOST_CMD": 5,
- "HOST_ACK": 6,
- "HOST_BATCH_CMD": 7,
- "TEMPERATURE_SHORT": 16,
- "MOTION_CMD": 17,
- "MOTION_STATUS": 18
- }
- },
- "commands": {
- "type": "object",
- "required": ["get_status", "disable", "get_temperatures", "set_output_snapshot", "jog", "mark_closed", "get_motor_status"],
- "properties": {
- "get_status": {"$ref": "#/$defs/command"},
- "disable": {"$ref": "#/$defs/command"},
- "get_temperatures": {"$ref": "#/$defs/temperatureCommand"},
- "set_output_snapshot": {"$ref": "#/$defs/snapshotCommand"},
- "jog": {"$ref": "#/$defs/jogCommand"},
- "mark_closed": {"$ref": "#/$defs/command"},
- "get_motor_status": {"$ref": "#/$defs/command"}
- },
- "additionalProperties": false
- },
- "unsupported_commands": {
- "type": "object",
- "required": ["0x29", "0x36"],
- "properties": {
- "0x29": {"$ref": "#/$defs/unsupported"},
- "0x36": {"$ref": "#/$defs/unsupported"}
- },
- "additionalProperties": false
- },
- "responses": {
- "type": "object",
- "required": ["host_ack", "temperature_short", "motion_status"],
- "properties": {
- "host_ack": {
- "type": "object",
- "required": ["frame_type", "payload_length", "full_frame_length", "byte_offsets", "state_hash16", "snapshot_detail_bits", "snapshot_result_flag_bits", "status_codes"],
- "properties": {
- "frame_type": {"const": 6},
- "payload_length": {"const": 8},
- "full_frame_length": {"const": 24},
- "byte_offsets": {"type": "object"},
- "state_hash16": {
- "type": "object",
- "required": ["algorithm", "encoding", "input_order", "semantic"],
- "properties": {
- "algorithm": {"const": "CRC-16/CCITT-FALSE"},
- "encoding": {"const": "u16_le"},
- "input_order": {"type": "array", "minItems": 3, "maxItems": 3},
- "semantic": {"const": "ACTUAL_APPLIED_SYNCHRONOUS_OUTPUTS"}
- },
- "additionalProperties": false
- },
- "snapshot_detail_bits": {"const": {"all_bits": "ZERO"}},
- "snapshot_result_flag_bits": {"type": "object"},
- "status_codes": {"type": "object"}
- },
- "additionalProperties": false
- },
- "temperature_short": {
- "type": "object",
- "required": ["frame_type", "payload_length", "full_frame_length", "layout", "crc_coverage", "value_order"],
- "properties": {
- "frame_type": {"const": 16},
- "payload_length": {"const": 27},
- "full_frame_length": {"const": 35},
- "layout": {"const": "A5 5A 02 04 10 1B values[27] crc16_le"},
- "crc_coverage": {"const": "02 04 10 1B values[27]"},
- "value_order": {
- "const": [
- "U6.local",
- "U6.remote1..8",
- "U24.local",
- "U24.remote1..8",
- "U25.local",
- "U25.remote1..8"
- ]
- }
- },
- "additionalProperties": false
- },
- "motion_status": {
- "type": "object",
- "required": ["frame_type", "payload_length", "full_frame_length", "layout", "position_values", "position_valid_mask", "current_xyz", "target_xyz", "busy_mask", "busy_semantic", "busy_role", "enable_active", "fault_mask", "z_current_target", "z_valid_busy_fault"],
- "properties": {
- "frame_type": {"const": 18},
- "payload_length": {"const": 10},
- "full_frame_length": {"const": 26},
- "layout": {"type": "string"},
- "position_values": {"const": {"UNKNOWN": 255}},
- "position_valid_mask": {"const": 0},
- "current_xyz": {"const": [255, 255, 255]},
- "target_xyz": {"const": [255, 255, 255]},
- "busy_mask": {"const": 0},
- "busy_semantic": {"const": "ALWAYS_ZERO"},
- "busy_role": {"const": "RESERVED_CONSTANT_ZERO"},
- "enable_active": {"const": 1},
- "fault_mask": {"const": 0},
- "z_current_target": {"const": 255},
- "z_valid_busy_fault": {"const": 0}
- },
- "additionalProperties": false
- }
- },
- "additionalProperties": false
- },
- "motion": {
- "type": "object",
- "required": ["axes", "execution", "motor_driving_commands", "jog_ack_semantics", "same_axis_jog_while_active", "peer_axis_may_start", "dir_setup_us", "effective_step_rate_hz", "normal_step_stop", "motor_stop_sources"],
- "properties": {
- "axes": {"const": ["X", "Y"]},
- "execution": {"const": "TWO_INDEPENDENT_PARALLEL_EXECUTORS"},
- "motor_driving_commands": {"const": ["0x35"]},
- "jog_ack_semantics": {"const": "FIRST_STEP_EMITTED"},
- "same_axis_jog_while_active": {"const": "IMMEDIATE_RELOAD_AND_RESTART_DIR_SETUP"},
- "peer_axis_may_start": {"const": true},
- "dir_setup_us": {"const": 1000},
- "effective_step_rate_hz": {"const": 1000},
- "normal_step_stop": {"const": "NEW_SAME_AXIS_JOG_MAY_TRUNCATE_OLD_STEP"},
- "motor_stop_sources": {"const": ["RESET", "POWER_LOSS", "RECONFIGURATION"]}
- },
- "additionalProperties": false
- },
- "limit": {
- "type": "object",
- "required": ["axes", "polarity", "open_voltage_v", "closed_voltage_v", "synchronizer_stages", "pins_retained", "logic_consumer", "used_only_for", "motion_effect", "dir0_jog_ignores_limit", "dir1_jog_ignores_limit", "position_memory", "direction_learning"],
- "properties": {
- "axes": {"const": ["X", "Y"]},
- "polarity": {"const": "ACTIVE_HIGH"},
- "open_voltage_v": {"const": 0.0},
- "closed_voltage_v": {"const": 3.3},
- "synchronizer_stages": {"const": 0},
- "pins_retained": {"const": true},
- "logic_consumer": {"const": "NONE"},
- "used_only_for": {"const": "RETAINED_PINS_NO_LOGIC_CONSUMER"},
- "motion_effect": {"const": "NONE"},
- "dir0_jog_ignores_limit": {"const": true},
- "dir1_jog_ignores_limit": {"const": true},
- "position_memory": {"const": false},
- "direction_learning": {"const": false}
- },
- "additionalProperties": false
- },
- "watchdog": {
- "type": "object",
- "required": ["timeout_seconds", "accepted_output_arms", "accepted_motion_arms", "armed_get_motor_status_refreshes", "status_query_cannot_arm_or_revive", "expiry_beats_same_cycle_refresh", "expiry_requires_disable_before_rearm", "next_valid_output_clears_timeout_and_rearms", "motor_effect", "non_motor_effect"],
- "properties": {
- "timeout_seconds": {"const": 5},
- "accepted_output_arms": {"const": true},
- "accepted_motion_arms": {"const": false},
- "armed_get_motor_status_refreshes": {"const": true},
- "status_query_cannot_arm_or_revive": {"const": true},
- "expiry_beats_same_cycle_refresh": {"const": true},
- "expiry_requires_disable_before_rearm": {"const": false},
- "next_valid_output_clears_timeout_and_rearms": {"const": true},
- "motor_effect": {"const": "NONE"},
- "non_motor_effect": {"const": "SAFE_OUTPUTS"}
- },
- "additionalProperties": false
- },
- "programming": {
- "type": "object",
- "required": ["operation", "speed_hz", "attempt_limit", "automatic_retry", "flash_allowed"],
- "properties": {
- "operation": {"const": "PROGRAM_SRAM"},
- "speed_hz": {"const": 200000},
- "attempt_limit": {"const": 1},
- "automatic_retry": {"const": false},
- "flash_allowed": {"const": false}
- },
- "additionalProperties": false
- }
- },
- "$defs": {
- "command": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length"],
- "properties": {
- "frame_type": {"type": "integer", "minimum": 0, "maximum": 255},
- "command": {"type": "integer", "minimum": 0, "maximum": 255},
- "payload_length": {"type": "integer", "minimum": 0, "maximum": 255}
- },
- "additionalProperties": true
- },
- "temperatureCommand": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length", "request_payload_hex", "success_response", "powerup_under_one_second", "nack_policy", "bus_error_status", "bus_error_status_code", "read_order", "addresses", "registers"],
- "properties": {
- "frame_type": {"const": 5},
- "command": {"const": 40},
- "payload_length": {"const": 4},
- "request_payload_hex": {"const": "28 00 00 00"},
- "success_response": {"const": "TEMPERATURE_SHORT_ONLY_NO_ACK"},
- "powerup_under_one_second": {"const": "ALL_FF_NO_I2C"},
- "nack_policy": {"const": "CURRENT_VALUE_FF_CONTINUE"},
- "bus_error_status": {"const": "TEMPERATURE_BUS_ERROR"},
- "bus_error_status_code": {"const": 10},
- "read_order": {"const": ["U6", "U24", "U25"]},
- "addresses": {"const": [73, 72, 75]},
- "registers": {"const": [0, 1, 2, 3, 4, 5, 6, 7, 8]}
- },
- "additionalProperties": false
- },
- "snapshotCommand": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length", "full_frame_length", "input_layout", "ptc_range", "fan_range", "binary_values", "xyz_range", "xyz_policy", "motor_effect", "ptc_fan_commit_when_motion_busy", "solenoid_change_when_any_xy_busy", "axis_policy", "response"],
- "properties": {
- "frame_type": {"const": 7},
- "command": {"const": 42},
- "payload_length": {"const": 34},
- "full_frame_length": {"const": 50},
- "input_layout": {"const": "2A flags PTC1..24 FAN1..4 solenoid X Y Z"},
- "ptc_range": {"const": [0, 100]},
- "fan_range": {"const": [0, 100]},
- "binary_values": {"const": [0, 100]},
- "xyz_range": {"const": [0, 255]},
- "xyz_policy": {"const": "IGNORE_ANY_U8_NO_MOTOR_EFFECT"},
- "motor_effect": {"const": "NONE"},
- "ptc_fan_commit_when_motion_busy": {"const": true},
- "solenoid_change_when_any_xy_busy": {"const": "ALWAYS_COMMIT"},
- "axis_policy": {"const": "IGNORE_ANY_U8_NO_MOTOR_EFFECT"},
- "response": {"const": "HOST_ACK"}
- },
- "additionalProperties": false
- },
- "jogCommand": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length", "full_frame_length", "input_layout", "axes", "cli_axes", "reserved_z_status", "direction", "speed_codes", "step_range", "step_field_policy", "fast_path_policy", "executed_step_cap", "over_cap_status", "over_cap_behavior", "speed_field_policy", "effective_step_rate_hz", "ack_semantics", "arms_watchdog", "same_axis_active_policy", "same_axis_host_rule", "same_axis_violation_policy", "multiple_pending_policy", "replacement_dir_setup_us", "limit_policy", "rejects_busy", "admission_ignores", "watchdog_timeout_recovery", "peer_axis_busy_does_not_block", "completion_event", "response"],
- "properties": {
- "frame_type": {"const": 17},
- "command": {"const": 53},
- "payload_length": {"const": 8},
- "full_frame_length": {"const": 24},
- "input_layout": {"const": "35 axis raw_dir speed_code steps_u16_le 00 00"},
- "axes": {"type": "object"},
- "cli_axes": {"const": ["X", "Y"]},
- "reserved_z_status": {"const": "BAD_VALUE"},
- "direction": {"type": "object"},
- "speed_codes": {"const": [0, 1, 2, 3]},
- "step_range": {"const": [1, 65535]},
- "step_field_policy": {"const": "RAW_U16_TRUSTED_HOST_NO_CPLD_CAP"},
- "fast_path_policy": {"const": "RX_FAST_JOG_BYPASSES_NORMAL_REQUEST_SLOT"},
- "executed_step_cap": {"const": null},
- "over_cap_status": {"const": "NOT_APPLICABLE"},
- "over_cap_behavior": {"const": "EXECUTE_REQUESTED_U16_STEPS"},
- "speed_field_policy": {"const": "VALIDATE_0_TO_3_THEN_IGNORE"},
- "effective_step_rate_hz": {"const": 1000},
- "ack_semantics": {"const": "FIRST_STEP_EMITTED"},
- "arms_watchdog": {"const": false},
- "same_axis_active_policy": {"const": "IMMEDIATE_RELOAD_AND_RESTART_DIR_SETUP"},
- "same_axis_host_rule": {"const": "HOST_MUST_NOT_REPEAT_SAME_AXIS_BEFORE_COMPLETION"},
- "same_axis_violation_policy": {"const": "LATEST_COMMAND_WINS_OLD_ACK_NOT_GUARANTEED"},
- "multiple_pending_policy": {"const": "NONE"},
- "replacement_dir_setup_us": {"const": 1000},
- "limit_policy": {"const": "IGNORE_ALL_INPUTS"},
- "rejects_busy": {"const": false},
- "admission_ignores": {"const": ["AXIS_ACTIVE", "SNAPSHOT_VALID", "LIMIT_INPUTS", "WATCHDOG_TIMEOUT"]},
- "watchdog_timeout_recovery": {"const": "NOT_APPLICABLE_TIMEOUT_HAS_NO_MOTOR_EFFECT"},
- "peer_axis_busy_does_not_block": {"const": true},
- "completion_event": {"const": "NONE_HOST_TRACKS_TIME"},
- "response": {"const": "HOST_ACK"}
- },
- "additionalProperties": false
- },
- "unsupported": {
- "type": "object",
- "required": ["status", "status_code", "changes_state", "arms_watchdog"],
- "properties": {
- "status": {"const": "UNSUPPORTED_IN_PROFILE"},
- "status_code": {"const": 1},
- "changes_state": {"const": false},
- "arms_watchdog": {"const": false},
- "request_payload_hex": {"type": "string"}
- },
- "additionalProperties": false
- }
- }
- }
|