@typecad/cuttlefish 1.0.0-alpha.3 → 1.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +4 -4
  2. package/dist/api/shared/display-adapter.d.ts +2 -1
  3. package/dist/api/shared/display-adapter.js +8 -1
  4. package/dist/api/shared/display-adapters/sdl.js +9 -2
  5. package/dist/api/shared/display-profile.d.ts +20 -3
  6. package/dist/api/shared/display-profile.js +21 -6
  7. package/dist/api/shared/framework-manifest-registry.d.ts +9 -0
  8. package/dist/api/shared/framework-manifest-registry.js +25 -0
  9. package/dist/api/shared/framework-manifest.d.ts +462 -0
  10. package/dist/api/shared/framework-manifest.js +149 -0
  11. package/dist/api/shared/glcdfont.d.ts +12 -0
  12. package/dist/api/shared/glcdfont.js +124 -0
  13. package/dist/api/shared/graphics-strategy.d.ts +28 -0
  14. package/dist/api/shared/hal-op-ir.d.ts +427 -1
  15. package/dist/api/shared/hal-op-ir.js +95 -1
  16. package/dist/api/shared/index.d.ts +11 -1
  17. package/dist/api/shared/index.js +14 -0
  18. package/dist/api/shared/native-display-op-resolver.d.ts +10 -0
  19. package/dist/api/shared/native-display-op-resolver.js +64 -0
  20. package/dist/api/shared/platform-strategy.d.ts +9 -0
  21. package/dist/api/shared/promise-runtime.js +78 -0
  22. package/dist/api/shared/types.d.ts +8 -0
  23. package/dist/api/shared/validate-framework-manifest.d.ts +28 -0
  24. package/dist/api/shared/validate-framework-manifest.js +417 -0
  25. package/dist/cli-utils.d.ts +1 -0
  26. package/dist/cli-utils.js +3 -1
  27. package/dist/cli.js +175 -4
  28. package/dist/config-loader.js +20 -1
  29. package/dist/config-schema.d.ts +36 -36
  30. package/dist/create/board-spec.d.ts +4 -4
  31. package/dist/create/index.d.ts +1 -1
  32. package/dist/create/index.js +1 -1
  33. package/dist/create/init-scaffold.d.ts +3 -0
  34. package/dist/create/init-scaffold.js +74 -2
  35. package/dist/create/init-templates.d.ts +4 -0
  36. package/dist/create/init-templates.js +217 -17
  37. package/dist/create/init-wizard.js +20 -1
  38. package/dist/emit/cpp-emitter.js +4 -3
  39. package/dist/emit/emitters/emitter-context.d.ts +5 -0
  40. package/dist/emit/emitters/function-emitter-impl.js +69 -59
  41. package/dist/emit/emitters/output-finalizer.d.ts +6 -0
  42. package/dist/emit/emitters/output-finalizer.js +21 -11
  43. package/dist/emit/emitters/setup.js +155 -0
  44. package/dist/emit/emitters/top-level-prep.js +2 -0
  45. package/dist/emit/emitters/ui-emitter.js +23 -8
  46. package/dist/emit/expression-renderer.js +10 -1
  47. package/dist/emit/snprintf-helpers.js +8 -0
  48. package/dist/emit/statement-renderer.js +13 -0
  49. package/dist/emit/utils/async-state-machine.js +185 -116
  50. package/dist/emit/utils/hal-op-cpp-type.d.ts +6 -0
  51. package/dist/emit/utils/hal-op-cpp-type.js +40 -0
  52. package/dist/ir/adc-range-validation.js +26 -25
  53. package/dist/ir/build-ir.js +5 -1
  54. package/dist/ir/expression-to-ir.js +57 -6
  55. package/dist/ir/feature-registry.js +7 -25
  56. package/dist/ir/hal/hal-emitter.d.ts +5 -2
  57. package/dist/ir/hal/hal-emitter.js +40 -12
  58. package/dist/ir/hal/hal-parser.d.ts +6 -0
  59. package/dist/ir/hal/hal-parser.js +74 -0
  60. package/dist/ir/hal/hal-plugins.js +571 -0
  61. package/dist/ir/identifier-collector.js +18 -0
  62. package/dist/ir/interrupt-analysis.js +8 -3
  63. package/dist/ir/memory-budget-validation.js +1 -0
  64. package/dist/ir/network-validation.d.ts +4 -0
  65. package/dist/ir/network-validation.js +184 -0
  66. package/dist/ir/ownership-analysis.js +33 -1
  67. package/dist/ir/peripheral-ownership.js +5 -0
  68. package/dist/ir/peripheral-validation.d.ts +1 -1
  69. package/dist/ir/peripheral-validation.js +6 -3
  70. package/dist/ir/pin-alias-conflict.d.ts +1 -1
  71. package/dist/ir/pin-alias-conflict.js +2 -1
  72. package/dist/ir/pin-capability-validation.js +34 -32
  73. package/dist/ir/pin-mode-validation.js +5 -0
  74. package/dist/ir/pin-safety.d.ts +1 -1
  75. package/dist/ir/pin-safety.js +2 -1
  76. package/dist/ir/program-analysis.d.ts +39 -0
  77. package/dist/ir/program-analysis.js +192 -0
  78. package/dist/ir/pulldown-validation.d.ts +1 -1
  79. package/dist/ir/pulldown-validation.js +2 -1
  80. package/dist/ir/pwm-timer-sharing.d.ts +1 -1
  81. package/dist/ir/pwm-timer-sharing.js +2 -1
  82. package/dist/ir/resource-analysis.js +2 -0
  83. package/dist/ir/timer0-pwm-timing-conflict.d.ts +1 -1
  84. package/dist/ir/timer0-pwm-timing-conflict.js +2 -1
  85. package/dist/ir/timing-validation.d.ts +6 -1
  86. package/dist/ir/timing-validation.js +51 -12
  87. package/dist/ir/transformers/expressions.js +58 -0
  88. package/dist/ir/transformers/hal-emit-helpers.js +1 -1
  89. package/dist/ir/transformers/variables.js +86 -19
  90. package/dist/ir/try-catch-validation.js +2 -0
  91. package/dist/ir/type-resolution.js +2 -2
  92. package/dist/ir/unit-suspicion-validation.js +9 -7
  93. package/dist/ir/validation-orchestrator.js +9 -7
  94. package/dist/libdef/c-to-decl.d.ts +27 -0
  95. package/dist/libdef/c-to-decl.js +397 -0
  96. package/dist/libdef/component-decls.d.ts +2 -0
  97. package/dist/libdef/component-decls.js +6 -0
  98. package/dist/libdef/component-discovery.d.ts +43 -0
  99. package/dist/libdef/component-discovery.js +83 -0
  100. package/dist/libdef/cpp-to-decl.d.ts +9 -0
  101. package/dist/libdef/cpp-to-decl.js +72 -0
  102. package/dist/libdef/idf-discovery.d.ts +7 -0
  103. package/dist/libdef/idf-discovery.js +59 -0
  104. package/dist/libdef/registry.js +5 -2
  105. package/dist/licenses.d.ts +185 -0
  106. package/dist/licenses.js +963 -0
  107. package/dist/lint-cache.d.ts +59 -0
  108. package/dist/lint-cache.js +257 -0
  109. package/dist/orchestrator/graph-builder.js +6 -2
  110. package/dist/stores/display-profile-store.d.ts +1 -0
  111. package/dist/stores/display-profile-store.js +1 -0
  112. package/dist/testing.d.ts +4 -2
  113. package/dist/testing.js +4 -2
  114. package/dist/transpile.d.ts +3 -0
  115. package/dist/transpile.js +78 -32
  116. package/dist/types.d.ts +5 -1
  117. package/dist/ui-hook.d.ts +17 -1
  118. package/dist/utils/cli.js +71 -1
  119. package/dist/utils/fs.d.ts +13 -0
  120. package/dist/utils/fs.js +50 -0
  121. package/package.json +9 -4
  122. package/dist/ir/heap-array-validation.d.ts +0 -24
  123. package/dist/ir/heap-array-validation.js +0 -29
@@ -42,6 +42,77 @@ export interface PwmGetResolutionOp {
42
42
  port?: string;
43
43
  pin: number;
44
44
  }
45
+ export interface RmtTxInitOp {
46
+ operation: "rmt.tx_init";
47
+ port?: string;
48
+ pin: number;
49
+ resolutionHz: number | string;
50
+ bit0Hi: number | string;
51
+ bit0Lo: number | string;
52
+ bit1Hi: number | string;
53
+ bit1Lo: number | string;
54
+ msbFirst?: boolean | string;
55
+ queueDepth?: number | string;
56
+ }
57
+ export interface RmtTxWriteBytesOp {
58
+ operation: "rmt.tx_write_bytes";
59
+ port?: string;
60
+ pin: number;
61
+ /** Pre-rendered C array initializer body, e.g. "1, 2, 3" (positional; bytes arg is array-literal-rendered). */
62
+ bytes: string;
63
+ }
64
+ export interface RmtTxWriteSymbolsOp {
65
+ operation: "rmt.tx_write_symbols";
66
+ port?: string;
67
+ pin: number;
68
+ /** Rendered rmt_symbol_word_t array body, one row per symbol. */
69
+ symbols: string;
70
+ }
71
+ export interface RmtTxWaitDoneOp {
72
+ operation: "rmt.tx_wait_done";
73
+ port?: string;
74
+ pin: number;
75
+ timeoutMs?: number | string;
76
+ }
77
+ export interface RmtTxDeinitOp {
78
+ operation: "rmt.tx_deinit";
79
+ port?: string;
80
+ pin: number;
81
+ }
82
+ export interface RmtRxInitOp {
83
+ operation: "rmt.rx_init";
84
+ port?: string;
85
+ pin: number;
86
+ resolutionHz: number | string;
87
+ }
88
+ export interface RmtRxOnReceivedOp {
89
+ operation: "rmt.rx_on_received";
90
+ port?: string;
91
+ pin: number;
92
+ /** User-declared C function name to call on receive. */
93
+ handler: string;
94
+ }
95
+ export interface RmtRxStartOp {
96
+ operation: "rmt.rx_start";
97
+ port?: string;
98
+ pin: number;
99
+ }
100
+ export interface RmtRxStopOp {
101
+ operation: "rmt.rx_stop";
102
+ port?: string;
103
+ pin: number;
104
+ }
105
+ export interface RmtRxReadOp {
106
+ operation: "rmt.rx_read";
107
+ port?: string;
108
+ pin: number;
109
+ maxCount: number | string;
110
+ }
111
+ export interface RmtRxDeinitOp {
112
+ operation: "rmt.rx_deinit";
113
+ port?: string;
114
+ pin: number;
115
+ }
45
116
  export interface AdcReadOp {
46
117
  operation: "adc.read";
47
118
  port?: string;
@@ -148,6 +219,11 @@ export interface PowerSetCpuFrequencyOp {
148
219
  operation: "power.set_cpu_frequency";
149
220
  mhz: number;
150
221
  }
222
+ export interface PowerDeepSleepPinOp {
223
+ operation: "power.deep_sleep_pin";
224
+ pin: number;
225
+ level: number;
226
+ }
151
227
  export interface I2cBeginOp {
152
228
  operation: "i2c.begin";
153
229
  bus: string;
@@ -267,6 +343,15 @@ export interface SpiCsHighOp {
267
343
  port?: string;
268
344
  pin: number;
269
345
  }
346
+ export interface SpiReadBufferOp {
347
+ operation: "spi.read_buffer";
348
+ bus: string;
349
+ /** Number of bytes — numeric or runtime expression string */
350
+ count: number | string;
351
+ /** Buffer variable name, "__HAL_READ_BUF__" placeholder (rewritten to the
352
+ * caller's variable by the variable-init transformer), or "__DISCARD__" */
353
+ buffer: string;
354
+ }
270
355
  export interface UartBeginOp {
271
356
  operation: "uart.begin";
272
357
  port: string;
@@ -375,6 +460,336 @@ export interface SnprintfEmitOp {
375
460
  /** Resolved C++ argument expressions */
376
461
  args: string[];
377
462
  }
463
+ export interface WifiConnectOp {
464
+ operation: "wifi.connect";
465
+ ssid: string;
466
+ password?: string;
467
+ timeoutMs: number | string;
468
+ blocking: boolean;
469
+ }
470
+ export interface WifiConnectStartOp {
471
+ operation: "wifi.connect_start";
472
+ ssid: string;
473
+ password?: string;
474
+ }
475
+ export interface WifiDisconnectOp {
476
+ operation: "wifi.disconnect";
477
+ }
478
+ export interface WifiStatusOp {
479
+ operation: "wifi.status";
480
+ }
481
+ export interface WifiIsConnectedOp {
482
+ operation: "wifi.is_connected";
483
+ }
484
+ export interface WifiLocalIpOp {
485
+ operation: "wifi.local_ip";
486
+ }
487
+ export interface WifiRssiOp {
488
+ operation: "wifi.rssi";
489
+ }
490
+ export interface WifiMacOp {
491
+ operation: "wifi.mac";
492
+ }
493
+ export interface WifiSetHostnameOp {
494
+ operation: "wifi.set_hostname";
495
+ name: string;
496
+ }
497
+ export interface WifiSetStaticIpOp {
498
+ operation: "wifi.set_static_ip";
499
+ ip: string;
500
+ gateway: string;
501
+ subnet: string;
502
+ dns?: string;
503
+ }
504
+ export interface WifiSetAutoReconnectOp {
505
+ operation: "wifi.set_auto_reconnect";
506
+ enabled: boolean | string;
507
+ }
508
+ export interface WifiSetPowerSaveOp {
509
+ operation: "wifi.set_power_save";
510
+ mode: string;
511
+ }
512
+ export interface WifiSetTxPowerOp {
513
+ operation: "wifi.set_tx_power";
514
+ dbm: number | string;
515
+ }
516
+ export interface WifiOnEventOp {
517
+ operation: "wifi.on_event";
518
+ event: "connect" | "disconnect" | "got_ip" | string;
519
+ handler: string;
520
+ }
521
+ export interface WifiApStartOp {
522
+ operation: "wifi.ap_start";
523
+ ssid: string;
524
+ password?: string;
525
+ channel?: number | string;
526
+ hidden?: boolean | string;
527
+ maxClients?: number | string;
528
+ }
529
+ export interface WifiApStopOp {
530
+ operation: "wifi.ap_stop";
531
+ }
532
+ export interface WifiApClientCountOp {
533
+ operation: "wifi.ap_client_count";
534
+ }
535
+ export interface WifiApIpOp {
536
+ operation: "wifi.ap_ip";
537
+ }
538
+ export interface WifiApSetChannelOp {
539
+ operation: "wifi.ap_set_channel";
540
+ channel: number | string;
541
+ }
542
+ export interface WifiApSetHiddenOp {
543
+ operation: "wifi.ap_set_hidden";
544
+ hidden: boolean | string;
545
+ }
546
+ export interface WifiApSetMaxClientsOp {
547
+ operation: "wifi.ap_set_max_clients";
548
+ maxClients: number | string;
549
+ }
550
+ export interface WifiScanOp {
551
+ operation: "wifi.scan";
552
+ }
553
+ export interface WifiScanStartOp {
554
+ operation: "wifi.scan_start";
555
+ }
556
+ /** Poll predicate paired with wifi.scan_start — true when scan results are ready. */
557
+ export interface WifiScanDoneOp {
558
+ operation: "wifi.scan_done";
559
+ }
560
+ export interface WifiScanCountOp {
561
+ operation: "wifi.scan_count";
562
+ }
563
+ export interface WifiScanSsidOp {
564
+ operation: "wifi.scan_ssid";
565
+ index: number | string;
566
+ }
567
+ export interface WifiScanRssiOp {
568
+ operation: "wifi.scan_rssi";
569
+ index: number | string;
570
+ }
571
+ export interface WifiScanEncryptionOp {
572
+ operation: "wifi.scan_encryption";
573
+ index: number | string;
574
+ }
575
+ export interface WifiScanChannelOp {
576
+ operation: "wifi.scan_channel";
577
+ index: number | string;
578
+ }
579
+ export interface WifiSaveCredentialsOp {
580
+ operation: "wifi.save_credentials";
581
+ ssid: string;
582
+ password: string;
583
+ }
584
+ export interface WifiConnectSavedOp {
585
+ operation: "wifi.connect_saved";
586
+ timeoutMs: number | string;
587
+ }
588
+ export interface WifiClearCredentialsOp {
589
+ operation: "wifi.clear_credentials";
590
+ }
591
+ export interface WifiWaitConnectedOp {
592
+ operation: "wifi.wait_connected";
593
+ timeoutMs: number | string;
594
+ }
595
+ export interface WifiWaitDisconnectedOp {
596
+ operation: "wifi.wait_disconnected";
597
+ }
598
+ export interface HttpBeginOp {
599
+ operation: "http.begin";
600
+ method: string;
601
+ url: string;
602
+ }
603
+ export interface HttpResetOp {
604
+ operation: "http.reset";
605
+ }
606
+ export interface HttpSetHeaderOp {
607
+ operation: "http.set_header";
608
+ name: string;
609
+ value: string;
610
+ }
611
+ export interface HttpSetTimeoutOp {
612
+ operation: "http.set_timeout";
613
+ ms: number | string;
614
+ }
615
+ export interface HttpSetMaxBodyOp {
616
+ operation: "http.set_max_body";
617
+ bytes: number | string;
618
+ }
619
+ export interface HttpSetBodyOp {
620
+ operation: "http.set_body";
621
+ data: string;
622
+ json?: boolean;
623
+ }
624
+ export interface HttpSetInsecureOp {
625
+ operation: "http.set_insecure";
626
+ }
627
+ export interface HttpSetCaCertOp {
628
+ operation: "http.set_ca_cert";
629
+ pem: string;
630
+ }
631
+ export interface HttpSendOp {
632
+ operation: "http.send";
633
+ blocking: boolean;
634
+ }
635
+ export interface HttpSendStartOp {
636
+ operation: "http.send_start";
637
+ }
638
+ /** Poll predicate paired with http.send_start — true when the response is in. */
639
+ export interface HttpDoneOp {
640
+ operation: "http.done";
641
+ }
642
+ export interface HttpStatusOp {
643
+ operation: "http.status";
644
+ }
645
+ export interface HttpOkOp {
646
+ operation: "http.ok";
647
+ }
648
+ export interface HttpBodyOp {
649
+ operation: "http.body";
650
+ }
651
+ export interface HttpContentLengthOp {
652
+ operation: "http.content_length";
653
+ }
654
+ export interface HttpResponseHeaderOp {
655
+ operation: "http.response_header";
656
+ name: string;
657
+ }
658
+ export interface BleServerBeginOp {
659
+ operation: "ble.server_begin";
660
+ name: string;
661
+ }
662
+ export interface BleAdvertiseStartOp {
663
+ operation: "ble.advertise_start";
664
+ }
665
+ export interface BleAdvertiseStopOp {
666
+ operation: "ble.advertise_stop";
667
+ }
668
+ export interface BleAddServiceOp {
669
+ operation: "ble.add_service";
670
+ uuid: string;
671
+ }
672
+ export interface BleAddCharOp {
673
+ operation: "ble.add_char";
674
+ index: number | string;
675
+ uuid: string;
676
+ type: string;
677
+ perms: number | string;
678
+ svcIndex?: number | string;
679
+ }
680
+ export interface BleOnReadOp {
681
+ operation: "ble.on_read";
682
+ index: number | string;
683
+ handler: string;
684
+ }
685
+ export interface BleOnWriteOp {
686
+ operation: "ble.on_write";
687
+ index: number | string;
688
+ handler: string;
689
+ }
690
+ export interface BleOnConnectOp {
691
+ operation: "ble.on_connect";
692
+ handler: string;
693
+ }
694
+ export interface BleOnDisconnectOp {
695
+ operation: "ble.on_disconnect";
696
+ handler: string;
697
+ }
698
+ export interface BleNotifyOp {
699
+ operation: "ble.notify";
700
+ index: number | string;
701
+ value: number | string;
702
+ }
703
+ export interface BleIsConnectedOp {
704
+ operation: "ble.is_connected";
705
+ }
706
+ export interface BleClientCountOp {
707
+ operation: "ble.client_count";
708
+ }
709
+ export interface BleSetNameOp {
710
+ operation: "ble.set_name";
711
+ name: string;
712
+ }
713
+ export interface BleUntilConnectedOp {
714
+ operation: "ble.until_connected";
715
+ timeoutMs: number | string;
716
+ blocking: boolean;
717
+ }
718
+ export interface BleUntilConnectedStartOp {
719
+ operation: "ble.until_connected_start";
720
+ }
721
+ export interface BleSetTxPowerOp {
722
+ operation: "ble.set_tx_power";
723
+ dbm: number | string;
724
+ }
725
+ export interface BleStatusOp {
726
+ operation: "ble.status";
727
+ }
728
+ export interface PreferencesBeginOp {
729
+ operation: "preferences.begin";
730
+ namespace: string;
731
+ readOnly: boolean;
732
+ }
733
+ export interface PreferencesEndOp {
734
+ operation: "preferences.end";
735
+ }
736
+ export interface PreferencesClearOp {
737
+ operation: "preferences.clear";
738
+ }
739
+ export interface PreferencesRemoveOp {
740
+ operation: "preferences.remove";
741
+ key: string;
742
+ }
743
+ export interface PreferencesPutIntOp {
744
+ operation: "preferences.put_int";
745
+ key: string;
746
+ value: number | string;
747
+ }
748
+ export interface PreferencesGetIntOp {
749
+ operation: "preferences.get_int";
750
+ key: string;
751
+ defaultValue: number | string;
752
+ }
753
+ export interface PreferencesPutUIntOp {
754
+ operation: "preferences.put_uint";
755
+ key: string;
756
+ value: number | string;
757
+ }
758
+ export interface PreferencesGetUIntOp {
759
+ operation: "preferences.get_uint";
760
+ key: string;
761
+ defaultValue: number | string;
762
+ }
763
+ export interface PreferencesPutBoolOp {
764
+ operation: "preferences.put_bool";
765
+ key: string;
766
+ value: boolean;
767
+ }
768
+ export interface PreferencesGetBoolOp {
769
+ operation: "preferences.get_bool";
770
+ key: string;
771
+ defaultValue: boolean;
772
+ }
773
+ export interface PreferencesPutFloatOp {
774
+ operation: "preferences.put_float";
775
+ key: string;
776
+ value: number | string;
777
+ }
778
+ export interface PreferencesGetFloatOp {
779
+ operation: "preferences.get_float";
780
+ key: string;
781
+ defaultValue: number | string;
782
+ }
783
+ export interface PreferencesPutStringOp {
784
+ operation: "preferences.put_string";
785
+ key: string;
786
+ value: string;
787
+ }
788
+ export interface PreferencesGetStringOp {
789
+ operation: "preferences.get_string";
790
+ key: string;
791
+ defaultValue: string;
792
+ }
378
793
  export interface RawCppOp {
379
794
  operation: "raw";
380
795
  /** Raw C++ code string (framework-agnostic, use sparingly) */
@@ -385,9 +800,20 @@ export interface RawCppOp {
385
800
  * operations. Each node carries a semantic `operation` tag and typed
386
801
  * arguments. Framework strategies translate these into concrete C++.
387
802
  */
388
- export type HALOpIR = GpioWriteOp | GpioReadOp | GpioToggleOp | GpioSetModeOp | PwmWriteOp | PwmGetFrequencyOp | PwmGetResolutionOp | AdcReadOp | AdcGetResolutionOp | AdcSetReferenceOp | AdcGetReferenceOp | AdcReadVoltageOp | DacWriteOp | InterruptAttachOp | InterruptDetachOp | TonePlayOp | ToneStopOp | TimingDelayOp | TimingDelayMicrosecondsOp | TimingMillisOp | TimingMicrosOp | TimingFreeHeapOp | TimingSetIntervalOp | TimingSetTimeoutOp | TimingClearIntervalOp | TimingClearTimeoutOp | PowerDeepSleepOp | PowerLightSleepOp | PowerSetCpuFrequencyOp | I2cBeginOp | I2cEndOp | I2cSetClockOp | I2cBeginTransmissionOp | I2cWriteOp | I2cWriteBytesOp | I2cWriteBufferOp | I2cReadBufferOp | I2cEndTransmissionOp | I2cRequestFromOp | I2cAvailableOp | I2cReadOp | I2cRecoverOp | SpiBeginOp | SpiEndOp | SpiTransferOp | SpibeginTransactionOp | SpiEndTransactionOp | SpiSetModeOp | SpiSetBitOrderOp | SpiCsLowOp | SpiCsHighOp | UartBeginOp | UartEndOp | UartPrintOp | UartPrintlnOp | UartPrintfOp | UartWriteOp | UartReadOp | UartPeekOp | UartAvailableOp | UartFlushOp | PulseInOp | PulseInLongOp | ShiftOutOp | ShiftInOp | BoardResolveOp | WdtEnableOp | WdtResetOp | WdtDisableOp | SnprintfEmitOp | RawCppOp | DisplayHALOp;
803
+ export type HALOpIR = GpioWriteOp | GpioReadOp | GpioToggleOp | GpioSetModeOp | PwmWriteOp | PwmGetFrequencyOp | PwmGetResolutionOp | RmtTxInitOp | RmtTxWriteBytesOp | RmtTxWriteSymbolsOp | RmtTxWaitDoneOp | RmtTxDeinitOp | RmtRxInitOp | RmtRxOnReceivedOp | RmtRxStartOp | RmtRxStopOp | RmtRxReadOp | RmtRxDeinitOp | AdcReadOp | AdcGetResolutionOp | AdcSetReferenceOp | AdcGetReferenceOp | AdcReadVoltageOp | DacWriteOp | InterruptAttachOp | InterruptDetachOp | TonePlayOp | ToneStopOp | TimingDelayOp | TimingDelayMicrosecondsOp | TimingMillisOp | TimingMicrosOp | TimingFreeHeapOp | TimingSetIntervalOp | TimingSetTimeoutOp | TimingClearIntervalOp | TimingClearTimeoutOp | PowerDeepSleepOp | PowerLightSleepOp | PowerSetCpuFrequencyOp | PowerDeepSleepPinOp | I2cBeginOp | I2cEndOp | I2cSetClockOp | I2cBeginTransmissionOp | I2cWriteOp | I2cWriteBytesOp | I2cWriteBufferOp | I2cReadBufferOp | I2cEndTransmissionOp | I2cRequestFromOp | I2cAvailableOp | I2cReadOp | I2cRecoverOp | SpiBeginOp | SpiEndOp | SpiTransferOp | SpibeginTransactionOp | SpiEndTransactionOp | SpiSetModeOp | SpiSetBitOrderOp | SpiCsLowOp | SpiCsHighOp | SpiReadBufferOp | UartBeginOp | UartEndOp | UartPrintOp | UartPrintlnOp | UartPrintfOp | UartWriteOp | UartReadOp | UartPeekOp | UartAvailableOp | UartFlushOp | PulseInOp | PulseInLongOp | ShiftOutOp | ShiftInOp | BoardResolveOp | WdtEnableOp | WdtResetOp | WdtDisableOp | SnprintfEmitOp | WifiConnectOp | WifiConnectStartOp | WifiDisconnectOp | WifiStatusOp | WifiIsConnectedOp | WifiLocalIpOp | WifiRssiOp | WifiMacOp | WifiSetHostnameOp | WifiSetStaticIpOp | WifiSetAutoReconnectOp | WifiSetPowerSaveOp | WifiSetTxPowerOp | WifiOnEventOp | WifiApStartOp | WifiApStopOp | WifiApClientCountOp | WifiApIpOp | WifiApSetChannelOp | WifiApSetHiddenOp | WifiApSetMaxClientsOp | WifiScanOp | WifiScanStartOp | WifiScanDoneOp | WifiScanCountOp | WifiScanSsidOp | WifiScanRssiOp | WifiScanEncryptionOp | WifiScanChannelOp | WifiSaveCredentialsOp | WifiConnectSavedOp | WifiClearCredentialsOp | WifiWaitConnectedOp | WifiWaitDisconnectedOp | HttpBeginOp | HttpResetOp | HttpSetHeaderOp | HttpSetTimeoutOp | HttpSetMaxBodyOp | HttpSetBodyOp | HttpSetInsecureOp | HttpSetCaCertOp | HttpSendOp | HttpSendStartOp | HttpDoneOp | HttpStatusOp | HttpOkOp | HttpBodyOp | HttpContentLengthOp | HttpResponseHeaderOp | BleServerBeginOp | BleAdvertiseStartOp | BleAdvertiseStopOp | BleAddServiceOp | BleAddCharOp | BleOnReadOp | BleOnWriteOp | BleOnConnectOp | BleOnDisconnectOp | BleNotifyOp | BleIsConnectedOp | BleClientCountOp | BleSetNameOp | BleUntilConnectedOp | BleUntilConnectedStartOp | BleSetTxPowerOp | BleStatusOp | PreferencesBeginOp | PreferencesEndOp | PreferencesClearOp | PreferencesRemoveOp | PreferencesPutIntOp | PreferencesGetIntOp | PreferencesPutUIntOp | PreferencesGetUIntOp | PreferencesPutBoolOp | PreferencesGetBoolOp | PreferencesPutFloatOp | PreferencesGetFloatOp | PreferencesPutStringOp | PreferencesGetStringOp | RawCppOp | DisplayHALOp;
389
804
  /**
390
805
  * Helper type: extracts the operation string from a HALOpIR variant.
391
806
  * Useful for type-safe switch statements in framework strategies.
392
807
  */
393
808
  export type HALOperationKind = HALOpIR["operation"];
809
+ /**
810
+ * Runtime registry of every HAL operation discriminator, parallel to
811
+ * {@link DISPLAY_OPERATION_KINDS}. Lets tests and the manifest validator
812
+ * enumerate HAL op kinds without parsing types (which are erased at runtime).
813
+ * Keep in sync with {@link HALOpIR} above.
814
+ *
815
+ * Note: `display.*` ops are NOT listed here — they live in
816
+ * {@link DISPLAY_OPERATION_KINDS} in `display-op-ir.ts`. The manifest
817
+ * validator imports both and unions them when probing display ops.
818
+ */
819
+ export declare const HAL_OPERATION_KINDS: readonly ["gpio.write", "gpio.read", "gpio.toggle", "gpio.set_mode", "pwm.write", "pwm.get_frequency", "pwm.get_resolution", "rmt.tx_init", "rmt.tx_write_bytes", "rmt.tx_write_symbols", "rmt.tx_wait_done", "rmt.tx_deinit", "rmt.rx_init", "rmt.rx_on_received", "rmt.rx_start", "rmt.rx_stop", "rmt.rx_read", "rmt.rx_deinit", "adc.read", "adc.get_resolution", "adc.set_reference", "adc.get_reference", "adc.read_voltage", "dac.write", "interrupt.attach", "interrupt.detach", "tone.play", "tone.stop", "timing.delay", "timing.delay_microseconds", "timing.millis", "timing.micros", "timing.free_heap", "timing.set_interval", "timing.set_timeout", "timing.clear_interval", "timing.clear_timeout", "power.deep_sleep", "power.light_sleep", "power.set_cpu_frequency", "power.deep_sleep_pin", "i2c.begin", "i2c.end", "i2c.set_clock", "i2c.begin_transmission", "i2c.write", "i2c.write_bytes", "i2c.write_buffer", "i2c.read_buffer", "i2c.end_transmission", "i2c.request_from", "i2c.available", "i2c.read", "i2c.recover", "spi.begin", "spi.end", "spi.transfer", "spi.begin_transaction", "spi.end_transaction", "spi.set_mode", "spi.set_bit_order", "spi.cs_low", "spi.cs_high", "spi.read_buffer", "uart.begin", "uart.end", "uart.print", "uart.println", "uart.printf", "uart.write", "uart.read", "uart.peek", "uart.available", "uart.flush", "pulse.in", "pulse.in_long", "shift.out", "shift.in", "board.resolve", "wdt.enable", "wdt.reset", "wdt.disable", "snprintf.emit", "wifi.connect", "wifi.connect_start", "wifi.disconnect", "wifi.status", "wifi.is_connected", "wifi.local_ip", "wifi.rssi", "wifi.mac", "wifi.set_hostname", "wifi.set_static_ip", "wifi.set_auto_reconnect", "wifi.set_power_save", "wifi.set_tx_power", "wifi.on_event", "wifi.ap_start", "wifi.ap_stop", "wifi.ap_client_count", "wifi.ap_ip", "wifi.ap_set_channel", "wifi.ap_set_hidden", "wifi.ap_set_max_clients", "wifi.scan", "wifi.scan_start", "wifi.scan_done", "wifi.scan_count", "wifi.scan_ssid", "wifi.scan_rssi", "wifi.scan_encryption", "wifi.scan_channel", "wifi.save_credentials", "wifi.connect_saved", "wifi.clear_credentials", "wifi.wait_connected", "wifi.wait_disconnected", "http.begin", "http.reset", "http.set_header", "http.set_timeout", "http.set_max_body", "http.set_body", "http.set_insecure", "http.set_ca_cert", "http.send", "http.send_start", "http.done", "http.status", "http.ok", "http.body", "http.content_length", "http.response_header", "ble.server_begin", "ble.advertise_start", "ble.advertise_stop", "ble.add_service", "ble.add_char", "ble.on_read", "ble.on_write", "ble.on_connect", "ble.on_disconnect", "ble.notify", "ble.is_connected", "ble.client_count", "ble.set_name", "ble.until_connected", "ble.until_connected_start", "ble.set_tx_power", "ble.status", "preferences.begin", "preferences.end", "preferences.clear", "preferences.remove", "preferences.put_int", "preferences.get_int", "preferences.put_uint", "preferences.get_uint", "preferences.put_bool", "preferences.get_bool", "preferences.put_float", "preferences.get_float", "preferences.put_string", "preferences.get_string", "raw"];
@@ -15,4 +15,98 @@
15
15
  // the MCU package's pin mapping. The `pin` field provides backward
16
16
  // compatibility as a legacy framework pin number.
17
17
  // ---------------------------------------------------------------------------
18
- export {};
18
+ /**
19
+ * Runtime registry of every HAL operation discriminator, parallel to
20
+ * {@link DISPLAY_OPERATION_KINDS}. Lets tests and the manifest validator
21
+ * enumerate HAL op kinds without parsing types (which are erased at runtime).
22
+ * Keep in sync with {@link HALOpIR} above.
23
+ *
24
+ * Note: `display.*` ops are NOT listed here — they live in
25
+ * {@link DISPLAY_OPERATION_KINDS} in `display-op-ir.ts`. The manifest
26
+ * validator imports both and unions them when probing display ops.
27
+ */
28
+ export const HAL_OPERATION_KINDS = [
29
+ // GPIO
30
+ 'gpio.write', 'gpio.read', 'gpio.toggle', 'gpio.set_mode',
31
+ // PWM
32
+ 'pwm.write', 'pwm.get_frequency', 'pwm.get_resolution',
33
+ // RMT
34
+ 'rmt.tx_init', 'rmt.tx_write_bytes', 'rmt.tx_write_symbols',
35
+ 'rmt.tx_wait_done', 'rmt.tx_deinit',
36
+ 'rmt.rx_init', 'rmt.rx_on_received', 'rmt.rx_start',
37
+ 'rmt.rx_stop', 'rmt.rx_read', 'rmt.rx_deinit',
38
+ // ADC
39
+ 'adc.read', 'adc.get_resolution', 'adc.set_reference',
40
+ 'adc.get_reference', 'adc.read_voltage',
41
+ // DAC
42
+ 'dac.write',
43
+ // Interrupts
44
+ 'interrupt.attach', 'interrupt.detach',
45
+ // Tone
46
+ 'tone.play', 'tone.stop',
47
+ // Timing
48
+ 'timing.delay', 'timing.delay_microseconds', 'timing.millis',
49
+ 'timing.micros', 'timing.free_heap', 'timing.set_interval',
50
+ 'timing.set_timeout', 'timing.clear_interval', 'timing.clear_timeout',
51
+ // Power
52
+ 'power.deep_sleep', 'power.light_sleep', 'power.set_cpu_frequency', 'power.deep_sleep_pin',
53
+ // I2C
54
+ 'i2c.begin', 'i2c.end', 'i2c.set_clock', 'i2c.begin_transmission',
55
+ 'i2c.write', 'i2c.write_bytes', 'i2c.write_buffer', 'i2c.read_buffer',
56
+ 'i2c.end_transmission', 'i2c.request_from', 'i2c.available', 'i2c.read',
57
+ 'i2c.recover',
58
+ // SPI
59
+ 'spi.begin', 'spi.end', 'spi.transfer', 'spi.begin_transaction',
60
+ 'spi.end_transaction', 'spi.set_mode', 'spi.set_bit_order',
61
+ 'spi.cs_low', 'spi.cs_high', 'spi.read_buffer',
62
+ // UART
63
+ 'uart.begin', 'uart.end', 'uart.print', 'uart.println', 'uart.printf',
64
+ 'uart.write', 'uart.read', 'uart.peek', 'uart.available', 'uart.flush',
65
+ // Pulse
66
+ 'pulse.in', 'pulse.in_long',
67
+ // Shift
68
+ 'shift.out', 'shift.in',
69
+ // Board
70
+ 'board.resolve',
71
+ // Watchdog timer
72
+ 'wdt.enable', 'wdt.reset', 'wdt.disable',
73
+ // Snprintf
74
+ 'snprintf.emit',
75
+ // WiFi
76
+ 'wifi.connect', 'wifi.connect_start', 'wifi.disconnect', 'wifi.status',
77
+ 'wifi.is_connected', 'wifi.local_ip', 'wifi.rssi', 'wifi.mac',
78
+ 'wifi.set_hostname', 'wifi.set_static_ip', 'wifi.set_auto_reconnect',
79
+ 'wifi.set_power_save', 'wifi.set_tx_power', 'wifi.on_event',
80
+ 'wifi.ap_start', 'wifi.ap_stop', 'wifi.ap_client_count', 'wifi.ap_ip',
81
+ 'wifi.ap_set_channel', 'wifi.ap_set_hidden', 'wifi.ap_set_max_clients',
82
+ 'wifi.scan', 'wifi.scan_start', 'wifi.scan_done', 'wifi.scan_count',
83
+ 'wifi.scan_ssid', 'wifi.scan_rssi', 'wifi.scan_encryption',
84
+ 'wifi.scan_channel', 'wifi.save_credentials', 'wifi.connect_saved',
85
+ 'wifi.clear_credentials', 'wifi.wait_connected', 'wifi.wait_disconnected',
86
+ // HTTP
87
+ 'http.begin', 'http.reset', 'http.set_header', 'http.set_timeout',
88
+ 'http.set_max_body', 'http.set_body', 'http.set_insecure',
89
+ 'http.set_ca_cert', 'http.send', 'http.send_start', 'http.done',
90
+ 'http.status', 'http.ok', 'http.body', 'http.content_length',
91
+ 'http.response_header',
92
+ // BLE (NimBLE GATT peripheral)
93
+ 'ble.server_begin', 'ble.advertise_start', 'ble.advertise_stop',
94
+ 'ble.add_service', 'ble.add_char',
95
+ 'ble.on_read', 'ble.on_write', 'ble.on_connect', 'ble.on_disconnect', 'ble.notify',
96
+ 'ble.is_connected', 'ble.client_count', 'ble.set_name',
97
+ 'ble.until_connected', 'ble.until_connected_start',
98
+ 'ble.set_tx_power', 'ble.status',
99
+ // Preferences (NVS)
100
+ 'preferences.begin', 'preferences.end', 'preferences.clear', 'preferences.remove',
101
+ 'preferences.put_int', 'preferences.get_int',
102
+ 'preferences.put_uint', 'preferences.get_uint',
103
+ 'preferences.put_bool', 'preferences.get_bool',
104
+ 'preferences.put_float', 'preferences.get_float',
105
+ 'preferences.put_string', 'preferences.get_string',
106
+ // Raw passthrough
107
+ 'raw',
108
+ ];
109
+ // Compile-time exhaustiveness check: every HAL_OPERATION_KINDS entry must
110
+ // be a valid HALOpIR["operation"]. If you add an op to the const but not the
111
+ // union (or vice versa), this assignment fails to type-check.
112
+ const _halOpKindsExhaustive = [...HAL_OPERATION_KINDS];
@@ -3,11 +3,15 @@ export type { CppTypeIR, CppTypeKind, CppPrimitiveName, CppFormatKind, } from '.
3
3
  export { parseCppType, renderCppType, splitTemplateArgs, isPointer, isReference, isContainer, isVector, isMap, isSet, isTuple, isVariant, isStdFunction, isStaticArray, isCArray, isStringLike, isPrimitive, bareType, elementOf, formatKindOf, CppTypeIR as cppTypeIRBuilder, parsedIsPointer, parsedIsStringLike, parsedIsPrimitive, parsedIsContainer, parsedIsVector, parsedIsMap, parsedIsSet, parsedIsTuple, parsedIsVariant, parsedIsStaticArray, parsedIsStdString, parsedElementOf, parsedElementString, parsedBareString, parsedBareType, collectNamedTypes, parsedCollectNamedTypes, needsCStrForStringLike, parsedIsPlainStructType, } from './cpp-type-ir.js';
4
4
  export type { ExpressionIR, StatementIR, ProgramIR, ImportIR, ReExportIR, CallExpressionIR, SuperCallIR, VariableDeclarationIR, AssignmentIR, UpdateIR, ReturnIR, WhileIR, IfIR, ForIR, ForOfIR, ForInIR, BreakIR, ContinueIR, DoWhileIR, SwitchIR, CaseIR, TryIR, ThrowIR, LabeledIR, BlockIR, HALOpStatementIR, FunctionIR, StructDefIR, EnumIR, ClassFieldIR, ClassConstructorIR, ClassMethodIR, ClassGetterIR, ClassSetterIR, ClassIR, InterfaceIR, TypeAliasIR, NamespaceIR, PeripheralUsageIR, RegisterBitFieldIR, RegisterClassIR, ParameterIR, CppType, } from './ir.js';
5
5
  export type { HALOpIR, HALOperationKind, } from './hal-op-ir.js';
6
+ export { HAL_OPERATION_KINDS } from './hal-op-ir.js';
6
7
  export type { DisplayInitOp, DisplayFillRectOp, DisplayDrawTextOp, DisplayDrawRectOp, DisplayFlushOp, DisplayHALOp, } from './display-op-ir.js';
7
8
  export { DISPLAY_OPERATION_KINDS } from './display-op-ir.js';
8
9
  export type { PlatformGraphicsStrategy, GraphicsCapacity } from './graphics-strategy.js';
9
- export type { DisplayProfile, DisplayConfig, DisplaySize, TouchProfile, TouchLibrary, ResolvedDisplay } from './display-profile.js';
10
+ export type { DisplayProfile, DisplayConfig, DisplaySize, TouchProfile, TouchLibrary, TouchAdapterCodegen, ResolvedDisplay } from './display-profile.js';
10
11
  export { effectiveDisplaySize, normalizeDisplayRotation, resolveDisplayProfile, resolveScrollConfig, DEFAULT_SCROLL_CANVAS_BUDGET_BYTES } from './display-profile.js';
12
+ export { GLCDFONT_BYTES, renderGlcdfontArray } from './glcdfont.js';
13
+ export type { DisplayAdapterCode, DisplayAdapterGenerator } from './display-adapter.js';
14
+ export { resolveNativeDisplayOp } from './native-display-op-resolver.js';
11
15
  export type { DisplayCapabilities, DisplayFeatureFlags, NativeFormat, RefreshModel, PartialRefreshScope, } from './display-capabilities.js';
12
16
  export { defaultTftCapabilities, deriveCapabilities } from './display-capabilities.js';
13
17
  export type { BoardConstants } from './board-resolver.js';
@@ -24,3 +28,9 @@ export { isStringEnum } from './ir-declarations.js';
24
28
  export type { AsyncRuntimeConfig } from './async-types.js';
25
29
  export { generatePromiseRuntime } from './promise-runtime.js';
26
30
  export { generateStaticAsyncRuntime } from './async-runtime-static.js';
31
+ export { FrameworkManifestSchema, defineFrameworkManifest, HAL_CATEGORIES, POLYFILL_BACKED_OPS, } from './framework-manifest.js';
32
+ export type { FrameworkManifest, HalCategory, } from './framework-manifest.js';
33
+ export { KNOWN_FRAMEWORK_PACKAGES, loadFrameworkManifest, } from './framework-manifest-registry.js';
34
+ export type { KnownFrameworkPackage } from './framework-manifest-registry.js';
35
+ export { validateFrameworkManifest } from './validate-framework-manifest.js';
36
+ export type { ManifestValidationContext, ManifestValidationResult, ManifestValidationError, ManifestValidationWarning, } from './validate-framework-manifest.js';
@@ -4,8 +4,16 @@
4
4
  // Re-exports all shared types for use by CLI and framework packages.
5
5
  // ---------------------------------------------------------------------------
6
6
  export { parseCppType, renderCppType, splitTemplateArgs, isPointer, isReference, isContainer, isVector, isMap, isSet, isTuple, isVariant, isStdFunction, isStaticArray, isCArray, isStringLike, isPrimitive, bareType, elementOf, formatKindOf, CppTypeIR as cppTypeIRBuilder, parsedIsPointer, parsedIsStringLike, parsedIsPrimitive, parsedIsContainer, parsedIsVector, parsedIsMap, parsedIsSet, parsedIsTuple, parsedIsVariant, parsedIsStaticArray, parsedIsStdString, parsedElementOf, parsedElementString, parsedBareString, parsedBareType, collectNamedTypes, parsedCollectNamedTypes, needsCStrForStringLike, parsedIsPlainStructType, } from './cpp-type-ir.js';
7
+ export { HAL_OPERATION_KINDS } from './hal-op-ir.js';
7
8
  export { DISPLAY_OPERATION_KINDS } from './display-op-ir.js';
8
9
  export { effectiveDisplaySize, normalizeDisplayRotation, resolveDisplayProfile, resolveScrollConfig, DEFAULT_SCROLL_CANVAS_BUDGET_BYTES } from './display-profile.js';
10
+ // Shared 5x7 glcdfont table (Adafruit public-domain source). Consumed by
11
+ // the SDL preview adapter and the native CuttlefishGFX runtime-header slice.
12
+ export { GLCDFONT_BYTES, renderGlcdfontArray } from './glcdfont.js';
13
+ // Native display-op resolver — lowers display.* HAL ops into calls against
14
+ // the adapter surface (display_init / display_targetFillRect / etc.). Used
15
+ // by NativeAVRStrategy and Esp32Strategy's resolveDisplayOp overrides.
16
+ export { resolveNativeDisplayOp } from './native-display-op-resolver.js';
9
17
  export { defaultTftCapabilities, deriveCapabilities } from './display-capabilities.js';
10
18
  export { getStdLibSupport, DEFAULT_STDLIB_SUPPORT } from './polyfill-types.js';
11
19
  export { parseCompileErrors, collectCppFiles } from './toolchain-types.js';
@@ -19,3 +27,9 @@ export { isStringEnum } from './ir-declarations.js';
19
27
  export { generatePromiseRuntime } from './promise-runtime.js';
20
28
  // Heap-free static async runtime generator (AVR / megaavr / no-<vector> targets)
21
29
  export { generateStaticAsyncRuntime } from './async-runtime-static.js';
30
+ // Framework manifest schema + helper
31
+ export { FrameworkManifestSchema, defineFrameworkManifest, HAL_CATEGORIES, POLYFILL_BACKED_OPS, } from './framework-manifest.js';
32
+ // Framework manifest discovery
33
+ export { KNOWN_FRAMEWORK_PACKAGES, loadFrameworkManifest, } from './framework-manifest-registry.js';
34
+ // Framework manifest validator
35
+ export { validateFrameworkManifest } from './validate-framework-manifest.js';
@@ -0,0 +1,10 @@
1
+ import type { DisplayHALOp } from "./display-op-ir.js";
2
+ /**
3
+ * Resolve a display HAL op to a call into the native adapter surface
4
+ * (display_init / display_targetFillRect / etc.). Returns undefined for ops
5
+ * this resolver does not handle.
6
+ */
7
+ export declare function resolveNativeDisplayOp(op: DisplayHALOp): {
8
+ code?: string;
9
+ expression?: string;
10
+ } | undefined;