services/external_link_protocol.* owns the versioned transport-neutral wire
codec. services/external_link_service.* dispatches it over external UART1 or
I2C0 without touching the UART3 debug console. services/vision_result_service.*
is the shared producer/consumer boundary for fixed BLOCK/ARROW results. Physical
pin and peripheral operations stay in board/HAL. See
docs/EXTERNAL_LINK_PROTOCOL.md for the public wire contract.
Default enabled apps: TERMINAL, CAMERA, QR-CAMERA, FACE DETECT, APRILTAG, OBJECT DETECT, FILES, BUTTONS, PONG, SETTINGS, SLEEP.
Compile-time app flags are generated into hk_config.h by tools/build_firmware.py. The app registry lives in apps/app_registry.c. Every --disable-app <name> omits the corresponding complete apps/<feature>/ directory. Disabling QR-CAMERA also omits quirc; disabling APRILTAG omits its vendored detector core, TAG36H11 table, and core-1 executor. Shared camera sources are retained only while at least one camera consumer is enabled; the shared planar AI input requires FACE or OBJECT.
Key public interfaces:
core/ai_model_types.handservices/ai_model_runtime.hfor model metadata and the instance-based load/run/stop/unload API.storage/ai_model_storage.handhal/hal_kpu.hare implementation boundaries used by the runtime, not feature APIs. Seedocs/AI_MODELS.mdfor the SD manifest and conversion lab.core/hk_app.h,core/hk_app_registry.h, andcore/hk_screen.hfor app metadata, stable autostart IDs, lookup, and screen model. Registry enumeration is the only source of enabled autostart choices; SETTINGS and SLEEP have no autostart ID.apps/camera/camera_app.h,apps/qr_camera/qr_camera_app.h,apps/files/files_app.h,apps/buttons/buttons_app.h,apps/settings/settings_app.h, andapps/sleep/sleep_app.hare the sole public contracts for the newly isolated modules. Their private controllers, adapters, decoders, views, and configuration are not shared APIs.controllers/settings_menu_controller.hfor reusable instance-based settings menus. Owners supply item descriptors and callbacks; the component owns navigation, edit/cycle interaction, static or dynamic choices, partial redraw, repeat, and commit notification but never persistence or application lifecycle. CAMERA, QR, APRILTAG, OBJECT DETECT, and system SETTINGS are current consumers.core/pixel_source.hfor a neutral pixel-reader contract.runtime/hk_main.handruntime/firmware_startup.hfor the platform loop and startup composition.services/settings_persistence.handservices/settings_lights.hfor settings load and application.services/debug_console_service.hfor narrow debug UART read/write access.services/debug_screenshot_stream.handservices/screenshot_source.hfor screenshot UART transport and LCD shadow sourcing.drivers/camera_stream.hfor the IRQ-driven two-slot camera stream and its explicit frame-lease contract; SDK interrupt details remain private tohal/hal_dvp.c.apps/face_detect/face_detect_app.his the sole public FACE DETECT interface; its private YOLO decoder, controller, DVP adapter, view, configuration, and types remain inside the module. The KPU model is read from/hackylens.kmodels/detect.kmodelthrough the shared AI runtime.apps/apriltag/apriltag_app.his the sole public APRILTAG interface. The module detects TAG36H11 markers on a core-1 worker, reports native IDs0..586, and owns its hold-OK settings lifecycle and descriptor adapter, central selection crosshair, persistent selected-ID bitmap, andALL/SELECTEDpublication filter. Unselected blocks are green and selected IDs are yellow; the numeric ID stays inside each block.apps/object_detect/object_detect_app.his the sole public OBJECT DETECT interface. The module owns VOC20 decoding, class labels, overlays, settings, persistence, and diagnostics. Its SD package is/hackylens.kmodels/object20/.services/camera_ai_input.howns the single aligned planar DVP/KPU input and exact frame-boundary handoff shared by FACE and OBJECT.services/core1_executor.howns APRILTAG's reusable core-1 job slot.services/camera_session_preferences.hsupplies optional per-session FPS and LED/RGB overrides. APRILTAG and OBJECT use independent values; CAMERA and QR continue to read their normal persisted profile after the override is cleared.- Settings storage v4 keeps APRILTAG's original 80-byte app block, appends eight OBJECT bytes, and retains the autostart ID. The loader accepts v1/v2/v3 and preserves all previous settings.
drivers/hk_lcd.hfor the synchronous full-frame RGB565-BE surface lease; UI composes into the existing LCD shadow before a single driver-owned SPI present.storage/screenshot_bmp.hfor BMP encoding,storage/screenshot_writer.hfor persistence, and focused FAT32/file headers for storage operations.storage/file_mount.handstorage/file_dir_scan.hfor neutral FAT mount and directory queries. Browser lists and image viewing are private FILES APIs.apps/files/image_viewer.his private to FILES and supports BMP/PNG/PPM/RAW plus streaming animated GIF87a/GIF89a. GIF playback supports palettes, transparency, interlace, disposal, pause/resume, bulk sub-block reads, and a 1600x1200 logical-canvas limit without loading the complete file into RAM. FILES decodes FAT long names from UTF-16 to UTF-8, renders Russian Cyrillic, and sorts entries by FAT modification time with newest entries first.ui/hk_ui.hand per-screen view headers for UI rendering.
Private headers are allowed only within their subsystem boundary; they are not compatibility facades or new global contracts.