# dotnet/iot architecture

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

- Interactive diagram: https://gitdiagram.com/dotnet/iot
- Repository: https://github.com/dotnet/iot

## Overview

This repository provides .NET IoT libraries: a hardware-independent GPIO API with platform drivers, plus community device bindings for sensors, displays, boards, and protocols. A typical application uses a binding or GPIO API to interact with hardware and obtain device readings or control outputs. The tree and README establish the breadth of the bindings; sampled GPIO source shows controller-to-driver calls, while the source index provides some additional module references. Many binding-to-bus and protocol-runtime links are not shown, so those connections are omitted.

Main entry points: [`src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioController.cs) (GPIO controller), [`src/devices/Nmea0183/TalkerSentence.cs`](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/TalkerSentence.cs) (NMEA sentence parsing), [`src/devices/Arduino/ArduinoGpioControllerDriver.cs`](https://github.com/dotnet/iot/blob/main/src/devices/Arduino/ArduinoGpioControllerDriver.cs) (Arduino GPIO driver), [`src/devices/Nmea0183/Sentences/EngineRevolutions.cs`](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/Sentences/EngineRevolutions.cs) (Engine data sentence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gpio["GPIO API"]
  node_controller["GPIO controller<br/>[GpioController.cs]"]
  node_pin["GPIO pin<br/>[GpioPin.cs]"]
  node_gpio_types["Pin types and events<br/>[PinValue.cs]"]
  node_driver_api["Driver contract<br/>[GpioDriver.cs]"]
  node_i2c["I2C API<br/>[I2cDevice.cs]"]
  node_spi["SPI API<br/>[SpiDevice.cs]"]
  node_pwm["PWM API<br/>[PwmChannel.cs]"]
end

subgraph group_platform["Platform Drivers"]
  node_unix_driver["Unix drivers<br/>[UnixDriver.cs]"]
  node_gpiod_v1["libgpiod v1<br/>[LibGpiodDriver.cs]"]
  node_gpiod_v2["libgpiod v2"]
  node_raspi_driver["Raspberry Pi drivers"]
  node_sysfs_driver["SysFs drivers<br/>[SysFsDriver.cs]"]
end

subgraph group_bindings["Device Bindings"]
  node_device_bindings["Component bindings"]
  node_board["Board support<br/>[Board.cs]"]
  node_arduino["Arduino support<br/>[ArduinoBoard.cs]"]
  node_arduino_gpio["Arduino GPIO driver"]
end

subgraph group_marine["Marine Protocols"]
  node_nmea_manager["AIS manager<br/>[AisManager.cs]"]
  node_nmea_sentence["NMEA sentence parsing<br/>[TalkerSentence.cs]"]
  node_sentence_id["Sentence identifiers<br/>[SentenceId.cs]"]
  node_engine_sentence["Engine data sentence"]
  node_seasmart["SeaSmart engine data"]
end

node_app(("IoT application"))

node_app -.->|"uses GPIO"| node_controller
node_controller -->|"calls driver"| node_driver_api
node_controller -->|"creates pin"| node_pin
node_controller -->|"uses pin types"| node_gpio_types
node_controller -->|"selects driver"| node_unix_driver
node_controller -->|"selects driver"| node_gpiod_v1
node_controller -->|"selects driver"| node_gpiod_v2
node_controller -->|"selects driver"| node_raspi_driver
node_app -.->|"uses bindings"| node_device_bindings
node_app -.->|"uses bus API"| node_i2c
node_app -.->|"uses bus API"| node_spi
node_app -.->|"uses PWM API"| node_pwm
node_app -.->|"uses board support"| node_board
node_app -.->|"uses Arduino support"| node_arduino
node_arduino_gpio -->|"implements contract"| node_driver_api
node_arduino_gpio -->|"uses Firmata device"| node_arduino
node_nmea_manager -->|"uses sentences"| node_nmea_sentence
node_engine_sentence -->|"uses sentence types"| node_nmea_sentence
node_engine_sentence -->|"uses identifier"| node_sentence_id
node_seasmart -->|"uses sentence types"| node_nmea_sentence

click node_controller "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioController.cs"
click node_pin "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioPin.cs"
click node_gpio_types "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/PinValue.cs"
click node_driver_api "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioDriver.cs"
click node_unix_driver "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/UnixDriver.cs"
click node_gpiod_v1 "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodDriver.cs"
click node_gpiod_v2 "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodV2Driver.cs"
click node_raspi_driver "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3Driver.cs"
click node_sysfs_driver "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/SysFsDriver.cs"
click node_i2c "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/I2c/I2cDevice.cs"
click node_spi "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Spi/SpiDevice.cs"
click node_pwm "https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Pwm/PwmChannel.cs"
click node_device_bindings "https://github.com/dotnet/iot/tree/main/src/devices"
click node_board "https://github.com/dotnet/iot/blob/main/src/devices/Board/Board.cs"
click node_arduino "https://github.com/dotnet/iot/blob/main/src/devices/Arduino/ArduinoBoard.cs"
click node_arduino_gpio "https://github.com/dotnet/iot/blob/main/src/devices/Arduino/ArduinoGpioControllerDriver.cs"
click node_nmea_manager "https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/AisManager.cs"
click node_nmea_sentence "https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/TalkerSentence.cs"
click node_sentence_id "https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/SentenceId.cs"
click node_engine_sentence "https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/Sentences/EngineRevolutions.cs"
click node_seasmart "https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/Sentences/SeaSmartEngineDetail.cs"

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_controller,node_pin,node_gpio_types,node_driver_api,node_i2c,node_spi,node_pwm toneBlue
class node_unix_driver,node_gpiod_v1,node_gpiod_v2,node_raspi_driver,node_sysfs_driver toneAmber
class node_device_bindings,node_board,node_arduino,node_arduino_gpio toneMint
class node_nmea_manager,node_nmea_sentence,node_sentence_id,node_engine_sentence,node_seasmart toneRose
class node_app toneIndigo
```

## Components

### GPIO API

- [GPIO controller](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioController.cs): `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`
- [GPIO pin](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioPin.cs): `src/System.Device.Gpio/System/Device/Gpio/GpioPin.cs`
- [Pin types and events](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/PinValue.cs): `src/System.Device.Gpio/System/Device/Gpio/PinValue.cs`
- [Driver contract](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/GpioDriver.cs): `src/System.Device.Gpio/System/Device/Gpio/GpioDriver.cs`
- [I2C API](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/I2c/I2cDevice.cs): `src/System.Device.Gpio/System/Device/I2c/I2cDevice.cs`
- [SPI API](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Spi/SpiDevice.cs): `src/System.Device.Gpio/System/Device/Spi/SpiDevice.cs`
- [PWM API](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Pwm/PwmChannel.cs): `src/System.Device.Gpio/System/Device/Pwm/PwmChannel.cs`

### Platform Drivers

- [Unix drivers](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/UnixDriver.cs): `src/System.Device.Gpio/System/Device/Gpio/Drivers/UnixDriver.cs`
- [libgpiod v1](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodDriver.cs): `src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodDriver.cs`
- [libgpiod v2](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodV2Driver.cs): `src/System.Device.Gpio/System/Device/Gpio/Drivers/LibGpiodV2Driver.cs`
- [Raspberry Pi drivers](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3Driver.cs): `src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3Driver.cs`
- [SysFs drivers](https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/SysFsDriver.cs): `src/System.Device.Gpio/System/Device/Gpio/Drivers/SysFsDriver.cs`

### Device Bindings

- [Component bindings](https://github.com/dotnet/iot/tree/main/src/devices): `src/devices`
- [Board support](https://github.com/dotnet/iot/blob/main/src/devices/Board/Board.cs): `src/devices/Board/Board.cs`
- [Arduino support](https://github.com/dotnet/iot/blob/main/src/devices/Arduino/ArduinoBoard.cs): `src/devices/Arduino/ArduinoBoard.cs`
- [Arduino GPIO driver](https://github.com/dotnet/iot/blob/main/src/devices/Arduino/ArduinoGpioControllerDriver.cs): `src/devices/Arduino/ArduinoGpioControllerDriver.cs`

### Marine Protocols

- [AIS manager](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/AisManager.cs): `src/devices/Nmea0183/AisManager.cs`
- [NMEA sentence parsing](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/TalkerSentence.cs): `src/devices/Nmea0183/TalkerSentence.cs`
- [Sentence identifiers](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/SentenceId.cs): `src/devices/Nmea0183/SentenceId.cs`
- [Engine data sentence](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/Sentences/EngineRevolutions.cs): `src/devices/Nmea0183/Sentences/EngineRevolutions.cs`
- [SeaSmart engine data](https://github.com/dotnet/iot/blob/main/src/devices/Nmea0183/Sentences/SeaSmartEngineDetail.cs): `src/devices/Nmea0183/Sentences/SeaSmartEngineDetail.cs`

### Other components

- **IoT application**

## Connections

- IoT application → GPIO controller: uses GPIO (evidence: `README.md`)
- GPIO controller → Driver contract: calls driver (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → GPIO pin: creates pin (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → Pin types and events: uses pin types (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → Unix drivers: selects driver (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → libgpiod v1: selects driver (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → libgpiod v2: selects driver (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- GPIO controller → Raspberry Pi drivers: selects driver (evidence: `src/System.Device.Gpio/System/Device/Gpio/GpioController.cs`)
- IoT application → Component bindings: uses bindings (evidence: `README.md`)
- IoT application → I2C API: uses bus API (evidence: `README.md`)
- IoT application → SPI API: uses bus API (evidence: `README.md`)
- IoT application → PWM API: uses PWM API (evidence: `README.md`)
- IoT application → Board support: uses board support (evidence: `README.md`)
- IoT application → Arduino support: uses Arduino support (evidence: `README.md`)
- Arduino GPIO driver → Driver contract: implements contract (evidence: `src/devices/Arduino/ArduinoGpioControllerDriver.cs`)
- Arduino GPIO driver → Arduino support: uses Firmata device (evidence: `src/devices/Arduino/ArduinoGpioControllerDriver.cs`)
- AIS manager → NMEA sentence parsing: uses sentences (evidence: `src/devices/Nmea0183/AisManager.cs`)
- Engine data sentence → NMEA sentence parsing: uses sentence types (evidence: `src/devices/Nmea0183/Sentences/EngineRevolutions.cs`)
- Engine data sentence → Sentence identifiers: uses identifier (evidence: `src/devices/Nmea0183/Sentences/EngineRevolutions.cs`)
- SeaSmart engine data → NMEA sentence parsing: uses sentence types (evidence: `src/devices/Nmea0183/Sentences/SeaSmartEngineDetail.cs`)
