# unosquare/raspberryio architecture

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

- Interactive diagram: https://gitdiagram.com/unosquare/raspberryio
- Repository: https://github.com/unosquare/raspberryio

## Overview

RaspberryIO is a .NET hardware-access library for Raspberry Pi, with an optional peripheral package. The principal workflow is to initialize `Pi` with a provider, then use its hardware APIs or peripheral drivers to interact with devices and retrieve results. The graph preserves the README’s advertised camera, board information, GPIO, SPI, I2C, timing/threading, and peripheral capabilities. Evidence is limited to the README, source index references, and sampled excerpts; unsampled implementation links are omitted where not established.

Main entry points: [`src/Unosquare.RaspberryIO/Pi.cs`](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Pi.cs) (Pi Access), [`src/Unosquare.RaspberryIO.Abstractions/IGpioPin.cs`](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/IGpioPin.cs) (GPIO Pins), [`src/Unosquare.RaspberryIO.Abstractions/II2CDevice.cs`](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/II2CDevice.cs) (I2C Devices), [`src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs`](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs) (LED Strip)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Pi Core"]
  node_pi["Pi Access<br/>[Pi.cs]"]
end

subgraph group_interfaces["Hardware Abstractions"]
  node_gpio["GPIO Pins<br/>[IGpioPin.cs]"]
  node_spi["SPI Channels<br/>[ISpiChannel.cs]"]
  node_i2c["I2C Devices<br/>[II2CDevice.cs]"]
  node_timing["Timing Threading<br/>[ITiming.cs]"]
end

subgraph group_devices["Peripheral Drivers"]
  node_adc["ADC Drivers<br/>[ADS1x15.cs]"]
  node_accelerometer["Accelerometer"]
  node_infrared["Infrared Sensor<br/>[InfraredSensor.cs]"]
  node_led["LED Strip<br/>[LedStripAPA102C.cs]"]
  node_rfid["RFID Controller"]
  node_oled["OLED Display"]
  node_temperature["Temperature Sensors<br/>[DhtSensor.cs]"]
  node_ultrasonic["Ultrasonic Sensor"]
  node_button["GPIO Button<br/>[Button.cs]"]
  node_bitmap["Bitmap Buffer<br/>[BitmapBuffer.cs]"]
end

subgraph group_system["System Features"]
  node_systeminfo["Board Information<br/>[SystemInfo.cs]"]
  node_camera["Camera Capture"]
  node_audio["Audio Settings<br/>[AudioSettings.cs]"]
  node_display["DSI Display<br/>[DsiDisplay.cs]"]
  node_bluetooth["Bluetooth<br/>[Bluetooth.cs]"]
end

node_developer(("Developer"))

node_developer -->|"initializes"| node_pi
node_developer -->|"uses"| node_pi
node_pi -->|"resolves"| node_gpio
node_pi -->|"resolves"| node_spi
node_pi -->|"resolves"| node_i2c
node_pi -->|"resolves"| node_timing
node_pi -->|"exposes"| node_systeminfo
node_pi -->|"exposes"| node_camera
node_pi -->|"exposes"| node_audio
node_pi -->|"exposes"| node_display
node_pi -->|"exposes"| node_bluetooth
node_adc -->|"uses"| node_i2c
node_accelerometer -->|"uses"| node_i2c
node_infrared -->|"reads"| node_gpio
node_led -->|"writes"| node_spi
node_led -->|"renders from"| node_bitmap
node_rfid -->|"uses"| node_spi
node_rfid -->|"uses"| node_gpio
node_oled -->|"writes"| node_i2c
node_temperature -->|"reads"| node_gpio
node_developer -.->|"uses"| node_adc
node_developer -.->|"uses"| node_accelerometer
node_developer -.->|"uses"| node_infrared
node_developer -.->|"uses"| node_led
node_developer -.->|"uses"| node_rfid
node_developer -.->|"uses"| node_oled
node_developer -.->|"uses"| node_temperature
node_developer -.->|"uses"| node_ultrasonic
node_developer -.->|"uses"| node_button

click node_pi "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Pi.cs"
click node_gpio "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/IGpioPin.cs"
click node_spi "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/ISpiChannel.cs"
click node_i2c "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/II2CDevice.cs"
click node_timing "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/ITiming.cs"
click node_systeminfo "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/SystemInfo.cs"
click node_camera "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Camera/CameraController.cs"
click node_audio "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/AudioSettings.cs"
click node_display "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/DsiDisplay.cs"
click node_bluetooth "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/Bluetooth.cs"
click node_adc "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/ADC/ADS1x15.cs"
click node_accelerometer "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Accelerometer/AccelerometerGY521.cs"
click node_infrared "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Infrared/InfraredSensor.cs"
click node_led "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs"
click node_rfid "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Rfid/RFIDControllerMfrc522.cs"
click node_oled "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/OledDisplaySSD1306.cs"
click node_temperature "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Temperature/DhtSensor.cs"
click node_ultrasonic "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/UltrasonicHcsr04.cs"
click node_button "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Button.cs"
click node_bitmap "https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/BitmapBuffer.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_pi toneBlue
class node_gpio,node_spi,node_i2c,node_timing toneAmber
class node_adc,node_accelerometer,node_infrared,node_led,node_rfid,node_oled,node_temperature,node_ultrasonic,node_button,node_bitmap toneMint
class node_systeminfo,node_camera,node_audio,node_display,node_bluetooth toneRose
class node_developer toneIndigo
```

## Components

### Pi Core

- [Pi Access](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Pi.cs): `src/Unosquare.RaspberryIO/Pi.cs`

### Hardware Abstractions

- [GPIO Pins](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/IGpioPin.cs): `src/Unosquare.RaspberryIO.Abstractions/IGpioPin.cs`
- [SPI Channels](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/ISpiChannel.cs): `src/Unosquare.RaspberryIO.Abstractions/ISpiChannel.cs`
- [I2C Devices](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/II2CDevice.cs): `src/Unosquare.RaspberryIO.Abstractions/II2CDevice.cs`
- [Timing Threading](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Abstractions/ITiming.cs): `src/Unosquare.RaspberryIO.Abstractions/ITiming.cs`

### Peripheral Drivers

- [ADC Drivers](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/ADC/ADS1x15.cs): `src/Unosquare.RaspberryIO.Peripherals/ADC/ADS1x15.cs`
- [Accelerometer](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Accelerometer/AccelerometerGY521.cs): `src/Unosquare.RaspberryIO.Peripherals/Accelerometer/AccelerometerGY521.cs`
- [Infrared Sensor](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Infrared/InfraredSensor.cs): `src/Unosquare.RaspberryIO.Peripherals/Infrared/InfraredSensor.cs`
- [LED Strip](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs): `src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs`
- [RFID Controller](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Rfid/RFIDControllerMfrc522.cs): `src/Unosquare.RaspberryIO.Peripherals/Rfid/RFIDControllerMfrc522.cs`
- [OLED Display](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/OledDisplaySSD1306.cs): `src/Unosquare.RaspberryIO.Peripherals/OledDisplaySSD1306.cs`
- [Temperature Sensors](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Temperature/DhtSensor.cs): `src/Unosquare.RaspberryIO.Peripherals/Temperature/DhtSensor.cs`
- [Ultrasonic Sensor](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/UltrasonicHcsr04.cs): `src/Unosquare.RaspberryIO.Peripherals/UltrasonicHcsr04.cs`
- [GPIO Button](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/Button.cs): `src/Unosquare.RaspberryIO.Peripherals/Button.cs`
- [Bitmap Buffer](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO.Peripherals/BitmapBuffer.cs): `src/Unosquare.RaspberryIO.Peripherals/BitmapBuffer.cs`

### System Features

- [Board Information](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/SystemInfo.cs): `src/Unosquare.RaspberryIO/Computer/SystemInfo.cs`
- [Camera Capture](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Camera/CameraController.cs): `src/Unosquare.RaspberryIO/Camera/CameraController.cs`
- [Audio Settings](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/AudioSettings.cs): `src/Unosquare.RaspberryIO/Computer/AudioSettings.cs`
- [DSI Display](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/DsiDisplay.cs): `src/Unosquare.RaspberryIO/Computer/DsiDisplay.cs`
- [Bluetooth](https://github.com/unosquare/raspberryio/blob/master/src/Unosquare.RaspberryIO/Computer/Bluetooth.cs): `src/Unosquare.RaspberryIO/Computer/Bluetooth.cs`

### Other components

- **Developer**

## Connections

- Developer → Pi Access: initializes (evidence: `README.md`)
- Developer → Pi Access: uses (evidence: `README.md`)
- Pi Access → GPIO Pins: resolves (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → SPI Channels: resolves (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → I2C Devices: resolves (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → Timing Threading: resolves (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → Board Information: exposes (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → Camera Capture: exposes (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → Audio Settings: exposes (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → DSI Display: exposes (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- Pi Access → Bluetooth: exposes (evidence: `src/Unosquare.RaspberryIO/Pi.cs`)
- ADC Drivers → I2C Devices: uses (evidence: `src/Unosquare.RaspberryIO.Peripherals/ADC/ADS1x15.cs`)
- Accelerometer → I2C Devices: uses (evidence: `src/Unosquare.RaspberryIO.Peripherals/Accelerometer/AccelerometerGY521.cs`)
- Infrared Sensor → GPIO Pins: reads (evidence: `src/Unosquare.RaspberryIO.Peripherals/Infrared/InfraredSensor.cs`)
- LED Strip → SPI Channels: writes (evidence: `src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs`)
- LED Strip → Bitmap Buffer: renders from (evidence: `src/Unosquare.RaspberryIO.Peripherals/LedStripAPA102C.cs`)
- RFID Controller → SPI Channels: uses (evidence: `src/Unosquare.RaspberryIO.Peripherals/Rfid/RFIDControllerMfrc522.cs`)
- RFID Controller → GPIO Pins: uses (evidence: `src/Unosquare.RaspberryIO.Peripherals/Rfid/RFIDControllerMfrc522.cs`)
- OLED Display → I2C Devices: writes (evidence: `src/Unosquare.RaspberryIO.Peripherals/OledDisplaySSD1306.cs`)
- Temperature Sensors → GPIO Pins: reads (evidence: `src/Unosquare.RaspberryIO.Peripherals/Temperature/DhtSensor.cs`)
- Developer → ADC Drivers: uses (evidence: `README.md`)
- Developer → Accelerometer: uses (evidence: `README.md`)
- Developer → Infrared Sensor: uses (evidence: `README.md`)
- Developer → LED Strip: uses (evidence: `README.md`)
- Developer → RFID Controller: uses (evidence: `README.md`)
- Developer → OLED Display: uses (evidence: `README.md`)
- Developer → Temperature Sensors: uses (evidence: `README.md`)
- Developer → Ultrasonic Sensor: uses (evidence: `README.md`)
- Developer → GPIO Button: uses (evidence: `README.md`)
