# elfbobo/hs-fbb architecture

> Architecture diagram of the GitHub repository elfbobo/hs-fbb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elfbobo/hs-fbb
- Repository: https://github.com/elfbobo/hs-fbb

## Overview

HiDiTing is an embedded SDK and reference platform for lightweight smart terminals, including wearable devices. A typical product workflow starts with an application or user interaction, uses application and middleware services, then reaches operating-system, driver, and hardware capabilities. The tree and README establish these layers and major features, but most implementation excerpts are absent; edges therefore show only broad relationships explicitly documented by the README, not inferred call chains.

Main entry points: [`src/application/3322/3322_app_standard/main.c`](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/application/3322/3322_app_standard/main.c) (Standard app), [`src/application/wearable`](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/wearable) (Wearable apps), [`src/ohos`](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/ohos) (OpenHarmony layer), [`src/kernel`](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/kernel) (LiteOS kernels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Applications"]
  node_wearable_app["Wearable apps"]
  node_standard_app["Standard app<br/>[main.c]"]
  node_ai_features["On-device AI"]
  node_audio_samples["Audio features"]
  node_input_features["Wearable input"]
end

subgraph group_services["Platform services"]
  node_gui["Graphics engine"]
  node_connectivity["Device connectivity"]
  node_media_services["Media services"]
end

subgraph group_system["System software"]
  node_bootloader["Bootloader<br/>[main.c]"]
  node_kernel["LiteOS kernels"]
  node_openharmony["OpenHarmony layer"]
  node_protocols["Communication protocols"]
  node_usb_storage["USB mass storage"]
end

subgraph group_hardware["Hardware access"]
  node_drivers["Peripheral drivers"]
  node_audio_hw["Audio hardware"]
  node_chip_registers["Chip registers"]
end

subgraph group_security["Security and updates"]
  node_storage_api["Protected storage API"]
  node_psa_dispatch["PSA storage dispatch"]
  node_secure_store[("Secure storage<br/>[sec_storage.h]")]
  node_key_storage[("Key storage")]
  node_nv_storage[("NV storage<br/>[nv_storage.h]")]
  node_upgrade_storage[("Upgrade storage<br/>[upg_storage.c]")]
end

node_developer(("Device user"))

node_developer -->|"uses"| node_wearable_app
node_developer -->|"uses"| node_standard_app
node_wearable_app -->|"runs on"| node_openharmony
node_standard_app -->|"runs on"| node_openharmony
node_wearable_app -.->|"uses graphics"| node_gui
node_wearable_app -.->|"uses connectivity"| node_connectivity
node_standard_app -.->|"offers AI"| node_ai_features
node_standard_app -.->|"offers audio"| node_audio_samples
node_standard_app -.->|"handles input"| node_input_features
node_ai_features -.->|"uses voice services"| node_media_services
node_audio_samples -->|"targets audio"| node_audio_hw
node_connectivity -.->|"supports protocols"| node_protocols
node_openharmony -->|"uses kernel"| node_kernel
node_kernel -->|"uses drivers"| node_drivers
node_drivers -.->|"accesses registers"| node_chip_registers
node_bootloader -.->|"initializes hardware"| node_drivers
node_storage_api -.->|"dispatches requests"| node_psa_dispatch
node_psa_dispatch -->|"reads and writes"| node_secure_store
node_openharmony -.->|"provides key storage"| node_key_storage
node_standard_app -.->|"uses persistent settings"| node_nv_storage
node_standard_app -.->|"supports upgrades"| node_upgrade_storage
node_kernel -.->|"supports USB storage"| node_usb_storage

click node_wearable_app "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/wearable"
click node_standard_app "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/application/3322/3322_app_standard/main.c"
click node_ai_features "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/3322/3322_ai_engine"
click node_audio_samples "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/audio"
click node_input_features "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/3322/input_wear/input_feature"
click node_gui "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/services/gui/uikit/ui/frameworks/engines/gfx/gfx_engine_manager.cpp"
click node_connectivity "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/ohos/foundation/communication/dsoftbus/core/transmission/trans_channel/proxy/src/softbus_proxychannel_pipeline.c"
click node_media_services "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/middleware/services/media/foundation/service/intelligent_voice_service"
click node_bootloader "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/bootloader/flashboot_3322/main.c"
click node_kernel "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/kernel"
click node_openharmony "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/ohos"
click node_protocols "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/ux/activity/bg_activity"
click node_drivers "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/drivers"
click node_audio_hw "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/audio/arch"
click node_chip_registers "https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/drivers/chips/3322/include/shared"
click node_storage_api "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/include/middleware/utils/psa/protected_storage.h"
click node_psa_dispatch "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/kernel/seliteos/kernel/service/psa/storage/dispatch_psa_storage.c"
click node_secure_store "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/kernel/seliteos/kernel/base/sec_storage/include/sec_storage.h"
click node_key_storage "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/ohos/base/security/huks/services/huks_standard/huks_service/main/core/src/hks_storage_manager.c"
click node_nv_storage "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/utils/nv/nv_storage_app/nv_storage.h"
click node_upgrade_storage "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/utils/update/storage/upg_storage.c"
click node_usb_storage "https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/open_source/freebsd/sys/dev/usb/f_mass_storage_open.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_wearable_app,node_standard_app,node_ai_features,node_audio_samples,node_input_features,node_developer toneBlue
class node_gui,node_connectivity,node_media_services toneAmber
class node_bootloader,node_kernel,node_openharmony,node_protocols,node_usb_storage toneMint
class node_drivers,node_audio_hw,node_chip_registers toneRose
class node_storage_api,node_psa_dispatch,node_secure_store,node_key_storage,node_nv_storage,node_upgrade_storage toneIndigo
```

## Components

### Applications

- [Wearable apps](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/wearable): `src/application/wearable`
- [Standard app](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/application/3322/3322_app_standard/main.c): `src/application/3322/3322_app_standard/main.c`
- [On-device AI](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/3322/3322_ai_engine): `src/application/3322/3322_ai_engine`
- [Audio features](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/audio): `src/application/audio`
- [Wearable input](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/3322/input_wear/input_feature): `src/application/3322/input_wear/input_feature`

### Platform services

- [Graphics engine](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/services/gui/uikit/ui/frameworks/engines/gfx/gfx_engine_manager.cpp): `src/middleware/services/gui/uikit/ui/frameworks/engines/gfx/gfx_engine_manager.cpp`
- [Device connectivity](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/ohos/foundation/communication/dsoftbus/core/transmission/trans_channel/proxy/src/softbus_proxychannel_pipeline.c): `src/ohos/foundation/communication/dsoftbus/core/transmission/trans_channel/proxy/src/softbus_proxychannel_pipeline.c`
- [Media services](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/middleware/services/media/foundation/service/intelligent_voice_service): `src/middleware/services/media/foundation/service/intelligent_voice_service`

### System software

- [Bootloader](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/bootloader/flashboot_3322/main.c): `src/bootloader/flashboot_3322/main.c`
- [LiteOS kernels](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/kernel): `src/kernel`
- [OpenHarmony layer](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/ohos): `src/ohos`
- [Communication protocols](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/ux/activity/bg_activity): `src/application/ux/activity/bg_activity`
- [USB mass storage](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/open_source/freebsd/sys/dev/usb/f_mass_storage_open.c): `src/open_source/freebsd/sys/dev/usb/f_mass_storage_open.c`

### Hardware access

- [Peripheral drivers](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/drivers): `src/drivers`
- [Audio hardware](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/application/audio/arch): `src/application/audio/arch`
- [Chip registers](https://github.com/elfbobo/hs-fbb/tree/test/issue-46-gitcode-submit/src/drivers/chips/3322/include/shared): `src/drivers/chips/3322/include/shared`

### Security and updates

- [Protected storage API](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/include/middleware/utils/psa/protected_storage.h): `src/include/middleware/utils/psa/protected_storage.h`
- [PSA storage dispatch](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/kernel/seliteos/kernel/service/psa/storage/dispatch_psa_storage.c): `src/kernel/seliteos/kernel/service/psa/storage/dispatch_psa_storage.c`
- [Secure storage](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/kernel/seliteos/kernel/base/sec_storage/include/sec_storage.h): `src/kernel/seliteos/kernel/base/sec_storage/include/sec_storage.h`
- [Key storage](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/ohos/base/security/huks/services/huks_standard/huks_service/main/core/src/hks_storage_manager.c): `src/ohos/base/security/huks/services/huks_standard/huks_service/main/core/src/hks_storage_manager.c`
- [NV storage](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/utils/nv/nv_storage_app/nv_storage.h): `src/middleware/utils/nv/nv_storage_app/nv_storage.h`
- [Upgrade storage](https://github.com/elfbobo/hs-fbb/blob/test/issue-46-gitcode-submit/src/middleware/utils/update/storage/upg_storage.c): `src/middleware/utils/update/storage/upg_storage.c`

### Other components

- **Device user**

## Connections

- Device user → Wearable apps: uses (evidence: `README.md`)
- Device user → Standard app: uses (evidence: `README.md`)
- Wearable apps → OpenHarmony layer: runs on (evidence: `README.md`)
- Standard app → OpenHarmony layer: runs on (evidence: `README.md`)
- Wearable apps → Graphics engine: uses graphics
- Wearable apps → Device connectivity: uses connectivity
- Standard app → On-device AI: offers AI
- Standard app → Audio features: offers audio
- Standard app → Wearable input: handles input
- On-device AI → Media services: uses voice services
- Audio features → Audio hardware: targets audio (evidence: `README.md`)
- Device connectivity → Communication protocols: supports protocols
- OpenHarmony layer → LiteOS kernels: uses kernel (evidence: `README.md`)
- LiteOS kernels → Peripheral drivers: uses drivers (evidence: `README.md`)
- Peripheral drivers → Chip registers: accesses registers (evidence: `src/drivers/chips/3322/include/shared/clocks_ccrg.h`)
- Bootloader → Peripheral drivers: initializes hardware (evidence: `src/bootloader/flashboot_3322/main.c`)
- Protected storage API → PSA storage dispatch: dispatches requests
- PSA storage dispatch → Secure storage: reads and writes (evidence: `src/kernel/seliteos/kernel/service/psa/storage/dispatch_psa_storage.c`)
- OpenHarmony layer → Key storage: provides key storage (evidence: `src/ohos/base/security/huks/services/huks_standard/huks_service/main/core/src/hks_storage_manager.c`)
- Standard app → NV storage: uses persistent settings
- Standard app → Upgrade storage: supports upgrades
- LiteOS kernels → USB mass storage: supports USB storage (evidence: `src/open_source/freebsd/sys/dev/usb/f_mass_storage_open.c`)
