# morsemicro/mm-iot-zephyr architecture

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

- Interactive diagram: https://gitdiagram.com/morsemicro/mm-iot-zephyr
- Repository: https://github.com/morsemicro/mm-iot-zephyr

## Overview

This alpha Zephyr module ports Morse Micro HaLow Wi-Fi onto Zephyr boards and shields. The main workflow is Zephyr Wi-Fi management requests entering the driver, which configures or controls the Morse Micro WLAN stack; packet traffic then crosses the selected SPI or SDIO transport to the radio. Separate driver layers adapt Zephyr networking, device power management, and Morse Micro HAL/OS APIs. The README also documents AP operation and a bandwidth shell command. Sample applications are described in the README but are not present in the supplied tree, so their internal flow is not mapped.

Main entry points: [`drivers/wifi/morsemicro/morsemicro_common.c`](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_common.c) (Device initialization), [`drivers/wifi/morsemicro/net_mgmt.c`](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/net_mgmt.c) (Driver management requests), [`drivers/wifi/morsemicro/shims/mmhal_wlan.c`](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_wlan.c) (WLAN HAL shim), [`drivers/wifi/morsemicro/wifi_mgmt.c`](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/wifi_mgmt.c) (Wi-Fi operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Wi-Fi management"]
  node_wifi_mgmt["Wi-Fi operations<br/>[wifi_mgmt.c]"]
  node_shell["AP shell command<br/>[morsemicro_shell.c]"]
end

subgraph group_network["Network adaptation"]
  node_mgmt_request["Driver management requests<br/>[net_mgmt.c]"]
end

subgraph group_platform["Platform and HAL"]
  node_common["Device initialization"]
  node_common_state["Shared driver state"]
  node_mm6108["MM6108 device<br/>[mm6108.c]"]
  node_mm8108["MM8108 device<br/>[mm8108.c]"]
  node_hal_wlan["WLAN HAL shim<br/>[mmhal_wlan.c]"]
  node_hal_core["Core HAL shim<br/>[mmhal_core.c]"]
  node_hal_os["OS HAL shim<br/>[mmhal_os.c]"]
  node_osal["OS abstraction<br/>[mmosal.c]"]
end

subgraph group_transport["Radio transport"]
  node_spi["SPI transport<br/>[morsemicro_spi.c]"]
  node_sdio["SDIO transport<br/>[morsemicro_sdio.c]"]
end

node_user(("Wi-Fi user"))
node_zephyr_mgmt["Zephyr Wi-Fi API"]
node_mmwlan["Morse Micro WLAN SDK"]
node_zephyr_net["Zephyr network stack"]
node_radio["HaLow radio hardware"]

node_user -->|"requests Wi-Fi"| node_zephyr_mgmt
node_zephyr_mgmt -->|"dispatches operations"| node_wifi_mgmt
node_wifi_mgmt -->|"controls WLAN"| node_mmwlan
node_shell -->|"sets bandwidth"| node_mgmt_request
node_mgmt_request -->|"receives packets"| node_zephyr_net
node_mgmt_request -->|"registers operations"| node_wifi_mgmt
node_mgmt_request -->|"registers callbacks"| node_mmwlan
node_common -->|"initializes state"| node_common_state
node_common -.->|"initializes bus"| node_spi
node_common -.->|"initializes bus"| node_sdio
node_mmwlan -.->|"uses HAL"| node_hal_wlan
node_hal_wlan -->|"reads configuration"| node_common_state
node_hal_wlan -->|"sleeps via"| node_osal
node_hal_core -->|"asserts via"| node_osal
node_osal -->|"resets via"| node_hal_os
node_spi -->|"transfers data"| node_radio
node_sdio -->|"transfers data"| node_radio
node_mm6108 -.->|"uses initialization"| node_common
node_mm8108 -.->|"uses initialization"| node_common

click node_wifi_mgmt "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/wifi_mgmt.c"
click node_shell "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_shell.c"
click node_mgmt_request "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/net_mgmt.c"
click node_common "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_common.c"
click node_common_state "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_common.h"
click node_mmwlan "https://github.com/morsemicro/mm-iot-zephyr/tree/main/components/morsemicro/libmorse"
click node_mm6108 "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/mm6108.c"
click node_mm8108 "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/mm8108.c"
click node_hal_wlan "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_wlan.c"
click node_hal_core "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_core.c"
click node_hal_os "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_os.c"
click node_osal "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmosal.c"
click node_spi "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_spi.c"
click node_sdio "https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_sdio.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_wifi_mgmt,node_shell,node_user toneBlue
class node_mgmt_request toneAmber
class node_common,node_common_state,node_mm6108,node_mm8108,node_hal_wlan,node_hal_core,node_hal_os,node_osal,node_zephyr_mgmt toneMint
class node_spi,node_sdio toneRose
class node_mmwlan toneTeal
class node_zephyr_net,node_radio toneIndigo
```

## Components

### Wi-Fi management

- [Wi-Fi operations](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/wifi_mgmt.c): `drivers/wifi/morsemicro/wifi_mgmt.c`
- [AP shell command](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_shell.c): `drivers/wifi/morsemicro/morsemicro_shell.c`

### Network adaptation

- [Driver management requests](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/net_mgmt.c): `drivers/wifi/morsemicro/net_mgmt.c`

### Platform and HAL

- [Device initialization](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_common.c): `drivers/wifi/morsemicro/morsemicro_common.c`
- [Shared driver state](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_common.h): `drivers/wifi/morsemicro/morsemicro_common.h`
- [MM6108 device](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/mm6108.c): `drivers/wifi/morsemicro/mm6108.c`
- [MM8108 device](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/mm8108.c): `drivers/wifi/morsemicro/mm8108.c`
- [WLAN HAL shim](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_wlan.c): `drivers/wifi/morsemicro/shims/mmhal_wlan.c`
- [Core HAL shim](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_core.c): `drivers/wifi/morsemicro/shims/mmhal_core.c`
- [OS HAL shim](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmhal_os.c): `drivers/wifi/morsemicro/shims/mmhal_os.c`
- [OS abstraction](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/shims/mmosal.c): `drivers/wifi/morsemicro/shims/mmosal.c`

### Radio transport

- [SPI transport](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_spi.c): `drivers/wifi/morsemicro/morsemicro_spi.c`
- [SDIO transport](https://github.com/morsemicro/mm-iot-zephyr/blob/main/drivers/wifi/morsemicro/morsemicro_sdio.c): `drivers/wifi/morsemicro/morsemicro_sdio.c`

### Other components

- **Wi-Fi user**
- **Zephyr Wi-Fi API**
- [Morse Micro WLAN SDK](https://github.com/morsemicro/mm-iot-zephyr/tree/main/components/morsemicro/libmorse): `components/morsemicro/libmorse`
- **Zephyr network stack**
- **HaLow radio hardware**

## Connections

- Wi-Fi user → Zephyr Wi-Fi API: requests Wi-Fi
- Zephyr Wi-Fi API → Wi-Fi operations: dispatches operations
- Wi-Fi operations → Morse Micro WLAN SDK: controls WLAN (evidence: `drivers/wifi/morsemicro/wifi_mgmt.c`)
- AP shell command → Driver management requests: sets bandwidth (evidence: `drivers/wifi/morsemicro/morsemicro_shell.c`)
- Driver management requests → Zephyr network stack: receives packets (evidence: `drivers/wifi/morsemicro/net_mgmt.c`)
- Driver management requests → Wi-Fi operations: registers operations (evidence: `drivers/wifi/morsemicro/net_mgmt.c`)
- Driver management requests → Morse Micro WLAN SDK: registers callbacks (evidence: `drivers/wifi/morsemicro/net_mgmt.c`)
- Device initialization → Shared driver state: initializes state (evidence: `drivers/wifi/morsemicro/morsemicro_common.c`)
- Device initialization → SPI transport: initializes bus
- Device initialization → SDIO transport: initializes bus
- Morse Micro WLAN SDK → WLAN HAL shim: uses HAL
- WLAN HAL shim → Shared driver state: reads configuration (evidence: `drivers/wifi/morsemicro/shims/mmhal_wlan.c`)
- WLAN HAL shim → OS abstraction: sleeps via (evidence: `drivers/wifi/morsemicro/shims/mmhal_wlan.c`)
- Core HAL shim → OS abstraction: asserts via (evidence: `drivers/wifi/morsemicro/shims/mmhal_core.c`)
- OS abstraction → OS HAL shim: resets via (evidence: `drivers/wifi/morsemicro/shims/mmosal.c`)
- SPI transport → HaLow radio hardware: transfers data (evidence: `drivers/wifi/morsemicro/morsemicro_spi.c`)
- SDIO transport → HaLow radio hardware: transfers data (evidence: `drivers/wifi/morsemicro/morsemicro_sdio.c`)
- MM6108 device → Device initialization: uses initialization
- MM8108 device → Device initialization: uses initialization
