project.schema.json 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "type": "object",
  4. "required": ["project_id", "profile", "device", "uart", "outputs", "motors", "temperature", "pins", "resources", "protocol", "timeouts"],
  5. "properties": {
  6. "project_id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
  7. "profile": {"type": "string", "const": "prod2u-normal-multiproject-115200-v1"},
  8. "device": {
  9. "type": "object",
  10. "required": ["family", "part", "clock_hz", "clock_ball"],
  11. "properties": {
  12. "family": {"type": "string", "const": "EF2"},
  13. "part": {"type": "string", "const": "EF2L45BG256B"},
  14. "clock_hz": {"type": "integer", "const": 25000000},
  15. "clock_ball": {"type": "string", "const": "J1"}
  16. },
  17. "additionalProperties": false
  18. },
  19. "uart": {
  20. "type": "object",
  21. "required": ["baud", "data_bits", "parity", "stop_bits", "flow_control", "clks_per_bit", "inter_byte_timeout_ms"],
  22. "properties": {
  23. "baud": {"type": "integer", "const": 115200},
  24. "data_bits": {"type": "integer", "const": 8},
  25. "parity": {"type": "string", "const": "N"},
  26. "stop_bits": {"type": "integer", "const": 1},
  27. "flow_control": {"type": "string", "const": "none"},
  28. "clks_per_bit": {"type": "integer", "const": 217},
  29. "inter_byte_timeout_ms": {"type": "integer", "const": 10}
  30. },
  31. "additionalProperties": false
  32. },
  33. "outputs": {
  34. "type": "object",
  35. "required": ["ptc_count", "fan_count", "pwm_bits", "pwm_frequency_hz", "ptc_polarity", "fan_polarity", "ptc_default", "fan_default", "fan_connector_active_level", "fan_board_inverts", "solenoid_policy", "z_policy"],
  36. "properties": {
  37. "ptc_count": {"type": "integer", "const": 24},
  38. "fan_count": {"type": "integer", "const": 4},
  39. "pwm_bits": {"type": "integer", "const": 8},
  40. "pwm_frequency_hz": {"type": "integer", "const": 20},
  41. "ptc_polarity": {"type": "string", "const": "active_high"},
  42. "fan_polarity": {"type": "string", "const": "active_low"},
  43. "ptc_default": {"type": "integer", "const": 0},
  44. "fan_default": {"type": "integer", "const": 26},
  45. "fan_connector_active_level": {"type": "string", "const": "high"},
  46. "fan_board_inverts": {"type": "boolean", "const": true},
  47. "solenoid_policy": {"type": "string", "const": "constant_safe_zero"},
  48. "z_policy": {"type": "string", "const": "constant_zero"}
  49. },
  50. "additionalProperties": false
  51. },
  52. "motors": {
  53. "type": "object",
  54. "required": ["count", "fixed_steps", "execution", "order", "step_rate_hz", "step_half_cycles", "dir_setup_cycles", "direction_values", "direction_meaning", "limits", "mapping", "enable_n"],
  55. "properties": {
  56. "count": {"type": "integer", "const": 2},
  57. "fixed_steps": {"type": "integer", "const": 450},
  58. "execution": {"type": "string", "const": "serial"},
  59. "order": {"type": "array", "const": ["inlet", "outlet"]},
  60. "step_rate_hz": {"type": "integer", "const": 1000},
  61. "step_half_cycles": {"type": "integer", "const": 12500},
  62. "dir_setup_cycles": {"type": "integer", "const": 25000},
  63. "direction_values": {"type": "array", "const": [0, 1]},
  64. "direction_meaning": {"type": "object"},
  65. "limits": {"type": "string", "const": "none"},
  66. "mapping": {"type": "object"},
  67. "enable_n": {"type": "object"}
  68. },
  69. "additionalProperties": false
  70. },
  71. "temperature": {"type": "object"},
  72. "pins": {"type": "object"},
  73. "resources": {"type": "object"},
  74. "protocol": {"type": "object"},
  75. "timeouts": {"type": "object"}
  76. },
  77. "additionalProperties": false
  78. }