# arm-software/cmsis-driver architecture

> Architecture diagram of the GitHub repository arm-software/cmsis-driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arm-software/cmsis-driver
- Repository: https://github.com/arm-software/cmsis-driver

## Overview

##### Main Components
- CMSIS-Driver Core API: At the center of the architecture, visually emphasize that every driver implements the CMSIS-Driver API. This is your “contract” for the implementations.
- Driver Modules: Group the driver implementations by function. Create separate components for:
- Ethernet Drivers (MAC and PHY) – Represent each of the submodules (e.g., ETH_KSZ8851SNL, ETH_LAN91C111, ETH_LAN9220) and the PHY drivers (e.g., PHY_DP83848, PHY_KSZ8061RNB, etc.).
- Flash Drivers – List the different flash implementations (AM29x800BB, AT45DB641E, and so on).
- I2C – The I2C_MultiSlave driver which wraps underlying implementations.
- NAND – The NAND_MemBus driver.
- SPI – The SPI_MultiSlave driver.
- WiFi Drivers – Cover the various WiFi driver modules (DA16200, ISM43362, ESP32, ESP8266, WizFi360) along with their firmware handling.
- Shield Layers – Modules that are specific to Arduino Uno WiFi shield implementations (such as Inventek ISMART43362-E, Sparkfun DA16200, Sparkfun ESP8266, and WizNet WizFi360-EVB).

##### Relationships and Interactions
- If desired, show an outer "integration layer" where these drivers can be used by other application layers (or middleware) on an MCU. Though the pack is hardware abstraction, it might be useful to note that external software (or drivers in the CMSIS pack) will consume these modules.

##### Architectural Patterns & Design Principles
- Abstraction via the CMSIS-Driver API: Emphasize that these separate modules abstract the hardware routines.
- Reusability: The provision of “template files” and configuration directories (such as those in the Config folder) hint at a design which encourages reusability and easy adaptation for different MCU targets.

##### Relevant Technologies and Framework Details
- Configuration Files: Include a separate element representing configuration (e.g., the Config folder with I2C_MultiSlave_Config.h, NAND_MemBus_Config.h, and SPI_MultiSlave_Config.h). This indicates that drivers can be tailored per target hardware.
- Version Control/CI Aspects: Although they are peripheral to the architecture, you might include “CI/CD Workflows” (from the .github folder) as external support systems if a high-level overview is desired.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Driver Modules Subgraph
    subgraph "Driver Modules"
        ETHERNET["Ethernet Drivers: KSZ8851SNL, LAN91C111, LAN9220"]:::driver
        PHY["Ethernet PHY Drivers: DP83848C, KSZ8061RNB, etc."]:::driver
        FLASH["Flash Drivers: AM29x800BB, AT45DB641E, etc."]:::driver
        I2C["I2C Driver: I2C_MultiSlave"]:::driver
        NAND["NAND Driver: NAND_MemBus"]:::driver
        SPI_SRC["SPI Driver: SPI_MultiSlave.c"]:::driver
        SPI_HDR["SPI Header: SPI_MultiSlave.h"]:::driver
        WIFI["WiFi Drivers: DA16200, ESP32, ESP8266, ISM43362, WizFi360"]:::driver
        SHIELD["Shield Layers: Arduino Uno WiFi shields"]:::driver
    end

    %% Support Components Subgraph
    subgraph "Support Components"
        CONFIG["Configuration Files"]:::config
        DOCS["Documentation & API References"]:::doc
        CICD["CI/CD Workflows"]:::ci
    end

    %% Central CMSIS-Driver API Component
    CORE["CMSIS-Driver Core API"]:::core

    %% Relationships: All modules depend on the CMSIS-Driver API
    ETHERNET -->|"depends"| CORE
    PHY -->|"depends"| CORE
    FLASH -->|"depends"| CORE
    I2C -->|"depends"| CORE
    NAND -->|"depends"| CORE
    SPI_SRC -->|"depends"| CORE
    SPI_HDR -->|"depends"| CORE
    WIFI -->|"depends"| CORE
    SHIELD -->|"depends"| CORE
    CONFIG -->|"configures"| CORE
    DOCS -->|"documents"| CORE
    CICD -->|"supports"| CORE

    %% Click Events
    click CORE "https://github.com/arm-software/cmsis-driver/blob/main/ARM.CMSIS-Driver.pdsc"
    click ETHERNET "https://github.com/arm-software/cmsis-driver/tree/main/Ethernet/"
    click PHY "https://github.com/arm-software/cmsis-driver/tree/main/Ethernet_PHY/"
    click FLASH "https://github.com/arm-software/cmsis-driver/tree/main/Flash/"
    click I2C "https://github.com/arm-software/cmsis-driver/blob/main/I2C/I2C_MultiSlave.c"
    click NAND "https://github.com/arm-software/cmsis-driver/blob/main/NAND/NAND_MemBus.c"
    click SPI_SRC "https://github.com/arm-software/cmsis-driver/blob/main/SPI/SPI_MultiSlave.c"
    click SPI_HDR "https://github.com/arm-software/cmsis-driver/blob/main/SPI/SPI_MultiSlave.h"
    click WIFI "https://github.com/arm-software/cmsis-driver/tree/main/WiFi/"
    click SHIELD "https://github.com/arm-software/cmsis-driver/tree/main/Shield/WiFi/"
    click CONFIG "https://github.com/arm-software/cmsis-driver/tree/main/Config/"
    click DOCS "https://github.com/arm-software/cmsis-driver/tree/main/Documentation/"
    click CICD "https://github.com/arm-software/cmsis-driver/tree/main/.github/"

    %% Style Definitions
    classDef driver fill:#90be6d,stroke:#333,stroke-width:2px
    classDef core fill:#f9c74f,stroke:#333,stroke-width:2px
    classDef config fill:#f9844a,stroke:#333,stroke-width:2px
    classDef doc fill:#577590,stroke:#333,stroke-width:2px
    classDef ci fill:#277da1,stroke:#333,stroke-width:2px
```
