UNA Watch Documentation
Welcome to the official UNA Watch SDK documentation hub. This platform enables developers to create high-performance applications for the UNA Watch ecosystem.
The UNA Watch architecture is unique: apps run as pure machine code directly in the MCU memory, leveraging position-independent code (PIC) and a shared libc library for maximum efficiency and abstraction from the kernel.
🚀 Getting Started
🧩 Tutorials
- HelloWorld - Introduction to UNA App Architecture
- Buttons - Handling User Input and Navigation
- ScrollMenu - Creating Scrollable Lists and Menus
- Images - Working with Graphics and Assets
- Sensors - Integrating Hardware Sensors
- Files - Data Persistence and File Operations
- FitFiles - FIT File Creation and Sensor Logging Tutorial
📱 Example Apps
- Running - Fitness Tracking
- Alarm - Alarm Clock
- Cycling - Cycling Activity Tracking
- Hiking - Hiking Activity Tracking
- HRMonitor - Heart Rate Monitor
- GlanceHR - Heart Rate Glance
- GlanceSteps - Step Counter Glance
- GlanceStrain - Daily Strain Logger
🏗️ Architecture
- SDK Overview
- Key Components
- SDK Setup and Build Reference
- SDK Project Structure
- SDK Interfaces
- Simulator Environment
- Third-Party Libraries & Standard Library
- Development Best Practices
- SDK Version Compatibility
- Sensor Layer
- Overview
- Sensor Types
- Connection API
- Data Reception & Processing
- Sensors
- ACCELEROMETER (0x10)
- ACCELEROMETER_RAW (0x11)
- HEART_RATE (0x41)
- HEART_RATE_METRICS (0x42)
- STEP_DETECTOR (0x50)
- STEP_COUNTER (0x51)
- FLOOR_COUNTER (0x60)
- AMBIENT_TEMPERATURE (0x70)
- PRESSURE (0x80)
- ALTIMETER (0x90)
- WRIST_MOTION (0xA0)
- MOTION_DETECT (0xB0)
- ACTIVITY_RECOGNITION (0xC0)
- ACTIVITY (0xE0)
- GPS_LOCATION (0x110)
- GPS_SPEED (0x111)
- GPS_DISTANCE (0x112)
- BATTERY_LEVEL (0x120)
- BATTERY_CHARGING (0x121)
- BATTERY_METRICS (0x122)
- TOUCH_DETECT (0x140)
- Workflow Diagram
- Example: Multi-Sensor Service
- Additional Messages
- Full Example
- Platform Architecture
- Core Concepts
- Technical Architecture Details
- Detailed Implementation Analysis
- 1. Backend Core Implementation (Backend.cpp)
- Backend Event Processing Flow
- Backend Interface Architecture
- Backend State Management
- Backend Communication Patterns
- 3. Component Factory Implementation (ComponentFactory.cpp)
- Hardware Component Detection Flow
- Component Factory Interface Architecture
- Component Lifecycle and Error Recovery
- I2C Bus Probing and Component Identification
- 4. Sensor Layer Implementation (SensorManager.cpp)
- Sensor Resource Arbitration Architecture
- Sensor Data Pipeline and Processing Flow
- Sensor Error Handling and Recovery Mechanisms
- Sensor Performance Monitoring and Optimization
- 5. Settings Management Implementation (SettingsManager.cpp)
- Settings Persistence and Recovery Flow
- Settings Configuration State Machine
- Settings Access Patterns and Concurrency
- Settings Migration and Version Compatibility
- 6. File System Implementation (FileSystem.cpp)
- Multi-Volume File System Architecture
- File System Operations Flow
- Thread-Safe File Access State Machine
- File System Error Recovery and Factory Reset Flow
- Time Zone and DST Handling Architecture
- System Initialization Sequence
- System Initialization from Multiple Perspectives
- 1. Thread Perspective: RTOS Task Initialization
- 2. Component Dependency Perspective: Initialization Order
- 3. Timing Perspective: Initialization Timeline
- 4. Memory Perspective: Allocation During Initialization
- 5. Error Handling Perspective: Fault Recovery During Init
- 6. Power Management Perspective: Energy During Initialization
- 7. Data Flow Perspective: Information Movement During Init
- Memory Management Patterns
- Error Handling & Robustness
- Core System Architecture
- System Initialization Sequence
- Key Design Patterns
- Static Component Architecture
- Detailed Implementation Analysis
- Development Workflow
- Scripts
- Script Usage Overview
- Script: Utilities/Scripts/app_merging/app_merging.py {#script-utilities-scripts-app_merging-app_merging-py}
- Script: Utilities/Scripts/app_packer/app_packer.py {#script-utilities-scripts-app_packer-app_packer-py}
- Script: Utilities/Scripts/png2abgr2222/png2abgr2222.py {#script-utilities-scripts-png2abgr2222-png2abgr2222-py}
- Script: Utilities/Scripts/export-stm32-tools.ps1 {#script-utilities-scripts-export-stm32-tools-ps1}
- Script: Utilities/Scripts/build-cube/una-version.sh {#script-utilities-scripts-build-cube-una-version-sh}
- Script: Utilities/Scripts/build-cube/find-cube.sh {#script-utilities-scripts-build-cube-find-cube-sh}
- Script: Utilities/Scripts/build-cube/build-cube.sh {#script-utilities-scripts-build-cube-build-cube-sh}
- Script: Utilities/Scripts/build-cube/setup-environment.sh {#script-utilities-scripts-build-cube-setup-environment-sh}
- Script: .github/scripts/generate-tutorials-app-list.py {#script-github-scripts-generate-tutorials-app-list-py}
- Script: Examples/.github/scripts/generate-app-list.py {#script-examples-github-scripts-generate-app-list-py}
- TouchGFX Port Architecture
- Table of Contents
- Overview
- Definitions and Terminology
- Structural Architecture
- API Structure
- Behavioral Architecture
- Error Handling and Debugging
- Extensibility and Customization Guide
- UNA-Specific System Integration Points
- Application Architecture Guidelines
- Custom Message Communication
- Project Structure and Build Integration
- TouchGFX Widgets
- BatteryBig
- HrBar
- Menu
- MenuItemNotSelected
- MenuItemSelected
- SideBarBig
- SideBarSmall
- Title
- TitleInfo
- Toggle
- TrackFace1
- TrackFace2
- TrackFace3
- TrackSummary
- TrackSummaryHR
- UnaButtons
- FIT Files Structure
- How to Read This Document
- 🚀 Getting Started: Where to Find ActivityWriter
- Table of Contents
- Introduction to FIT
- FIT File Format Basics
- ActivityWriter Class Overview
- FitHelper Component Deep Dive
- Step-by-Step FIT File Creation
- Message Types and Fields in Detail
- Message Types and Fields
- Activity-Specific Variations
- Developer Fields Implementation
- Visual Representations and Diagrams
- Code Usage Examples and Walkthroughs
- Advanced Topics and Best Practices
- Troubleshooting Common Issues
- Extending ActivityWriter for New Activities
- FIT File Parsing and Validation
- References and Resources
🎋 Apps Sharing
📚 API Reference
- API Reference
- Core SDK Interfaces
- Application Communication (IPC)
- Sensor Layer
- UI Framework
- Utilities
🤝 Community & Support