# sysplay/bbb architecture

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

- Interactive diagram: https://gitdiagram.com/sysplay/bbb
- Repository: https://github.com/sysplay/bbb

## Overview

This repository is a BeagleBone Black learning collection, not one application: its main workflow is experimenting with Linux drivers through small user-space apps, alongside bootloader and bare-metal exercises. The graph preserves the documented boot, kernel-driver, USB-gadget, app, and firmware areas, plus representative I2C, GPIO, and interrupt modules. The README supports the broad Apps-to-Drivers relationship; other edges are limited to relationships shown in excerpts or the source index, so unsampled subsystems have no guessed call paths.

Main entry points: [`EmbC/interrupt.c`](https://github.com/sysplay/bbb/blob/master/EmbC/interrupt.c) (Interrupt Handling), [`Drivers/USBGadgetDrivers/f_mass_storage.c`](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/f_mass_storage.c) (Storage Function), [`Bootloaders/XloaderMod/board.c`](https://github.com/sysplay/bbb/blob/master/Bootloaders/XloaderMod/board.c) (Board Setup), [`Drivers/USBGadgetDrivers/g_mass_storage.c`](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/g_mass_storage.c) (Mass Storage Gadget)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Bootloaders"]
  node_xloader_board["Board Setup<br/>[board.c]"]
  node_xloader_mux["Pin Mux<br/>[mux.c]"]
  node_uboot_board["Board Identity<br/>[board.h]"]
end

subgraph group_drivers["Linux Drivers"]
  node_led_ioctl["GPIO LED ioctl<br/>[led_ioctl.c]"]
  node_i2c_char["I2C Character Driver<br/>[i2c_char_client.c]"]
  node_i2c_defs["I2C Definitions<br/>[i2c_char.h]"]
  node_gpio_interrupt["GPIO Debounce<br/>[gpio_debounce.c]"]
  node_gpio_select["GPIO Select<br/>[gpio_select.c]"]
  node_tty_serial["TTY Serial<br/>[s3.c]"]
end

subgraph group_usb["USB Gadget"]
  node_usb_gadget["Mass Storage Gadget<br/>[g_mass_storage.c]"]
  node_usb_function["Storage Function<br/>[f_mass_storage.c]"]
  node_usb_storage_common["Storage Common<br/>[storage_common.c]"]
  node_gadget_chips["Gadget Quirks<br/>[gadget_chips.h]"]
end

subgraph group_apps["User Apps"]
  node_gpio_app["GPIO Apps<br/>[select_gpio.c]"]
  node_i2c_app["I2C Apps<br/>[i2c_client_app.c]"]
  node_spi_app["SPI ADC App<br/>[spi_adc.c]"]
end

subgraph group_firmware["Bare Metal"]
  node_embc_regs["Peripheral Registers<br/>[bbb.h]"]
  node_embc_common["Firmware Types<br/>[common.h]"]
  node_embc_interrupt["Interrupt Handling<br/>[interrupt.c]"]
end

node_learner(("Workshop Learner"))
node_bbb["BeagleBone Black"]

node_learner -->|"experiments with"| node_gpio_app
node_learner -->|"experiments with"| node_i2c_app
node_gpio_app -->|"plays with drivers"| node_led_ioctl
node_i2c_app -->|"plays with drivers"| node_i2c_char
node_usb_gadget -->|"configures"| node_usb_function
node_usb_function -->|"uses definitions"| node_usb_storage_common
node_usb_function -->|"checks quirks"| node_gadget_chips
node_i2c_char -->|"includes"| node_i2c_defs
node_embc_interrupt -->|"accesses registers"| node_embc_regs
node_embc_interrupt -->|"uses types"| node_embc_common
node_xloader_board -->|"uses board identity"| node_uboot_board
node_xloader_board -.->|"initializes"| node_bbb
node_xloader_mux -.->|"configures pins"| node_bbb
node_led_ioctl -.->|"controls GPIO"| node_bbb
node_gpio_interrupt -.->|"handles GPIO events"| node_bbb
node_usb_gadget -.->|"exposes storage"| node_bbb
node_embc_interrupt -.->|"handles interrupts"| node_bbb

click node_xloader_board "https://github.com/sysplay/bbb/blob/master/Bootloaders/XloaderMod/board.c"
click node_xloader_mux "https://github.com/sysplay/bbb/blob/master/Bootloaders/XloaderMod/mux.c"
click node_uboot_board "https://github.com/sysplay/bbb/blob/master/Bootloaders/u-boot/board/ti/am335x/board.h"
click node_led_ioctl "https://github.com/sysplay/bbb/blob/master/Drivers/CharDrivers/led_ioctl.c"
click node_i2c_char "https://github.com/sysplay/bbb/blob/master/Drivers/I2CDrivers/i2c_char_client.c"
click node_i2c_defs "https://github.com/sysplay/bbb/blob/master/Drivers/I2CDrivers/i2c_char.h"
click node_gpio_interrupt "https://github.com/sysplay/bbb/blob/master/Drivers/Interrupts/gpio_debounce.c"
click node_gpio_select "https://github.com/sysplay/bbb/blob/master/Drivers/Select/gpio_select.c"
click node_tty_serial "https://github.com/sysplay/bbb/blob/master/Drivers/TTYDrivers/s3.c"
click node_usb_gadget "https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/g_mass_storage.c"
click node_usb_function "https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/f_mass_storage.c"
click node_usb_storage_common "https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/storage_common.c"
click node_gadget_chips "https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/gadget_chips.h"
click node_gpio_app "https://github.com/sysplay/bbb/blob/master/Apps/select_gpio.c"
click node_i2c_app "https://github.com/sysplay/bbb/blob/master/Apps/i2c_client_app.c"
click node_spi_app "https://github.com/sysplay/bbb/blob/master/Apps/spi_adc.c"
click node_embc_regs "https://github.com/sysplay/bbb/blob/master/EmbC/bbb.h"
click node_embc_common "https://github.com/sysplay/bbb/blob/master/EmbC/common.h"
click node_embc_interrupt "https://github.com/sysplay/bbb/blob/master/EmbC/interrupt.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_xloader_board,node_xloader_mux,node_uboot_board toneBlue
class node_led_ioctl,node_i2c_char,node_i2c_defs,node_gpio_interrupt,node_gpio_select,node_tty_serial toneAmber
class node_usb_gadget,node_usb_function,node_usb_storage_common,node_gadget_chips toneMint
class node_gpio_app,node_i2c_app,node_spi_app toneRose
class node_embc_regs,node_embc_common,node_embc_interrupt,node_learner,node_bbb toneIndigo
```

## Components

### Bootloaders

- [Board Setup](https://github.com/sysplay/bbb/blob/master/Bootloaders/XloaderMod/board.c): `Bootloaders/XloaderMod/board.c`
- [Pin Mux](https://github.com/sysplay/bbb/blob/master/Bootloaders/XloaderMod/mux.c): `Bootloaders/XloaderMod/mux.c`
- [Board Identity](https://github.com/sysplay/bbb/blob/master/Bootloaders/u-boot/board/ti/am335x/board.h): `Bootloaders/u-boot/board/ti/am335x/board.h`

### Linux Drivers

- [GPIO LED ioctl](https://github.com/sysplay/bbb/blob/master/Drivers/CharDrivers/led_ioctl.c): `Drivers/CharDrivers/led_ioctl.c`
- [I2C Character Driver](https://github.com/sysplay/bbb/blob/master/Drivers/I2CDrivers/i2c_char_client.c): `Drivers/I2CDrivers/i2c_char_client.c`
- [I2C Definitions](https://github.com/sysplay/bbb/blob/master/Drivers/I2CDrivers/i2c_char.h): `Drivers/I2CDrivers/i2c_char.h`
- [GPIO Debounce](https://github.com/sysplay/bbb/blob/master/Drivers/Interrupts/gpio_debounce.c): `Drivers/Interrupts/gpio_debounce.c`
- [GPIO Select](https://github.com/sysplay/bbb/blob/master/Drivers/Select/gpio_select.c): `Drivers/Select/gpio_select.c`
- [TTY Serial](https://github.com/sysplay/bbb/blob/master/Drivers/TTYDrivers/s3.c): `Drivers/TTYDrivers/s3.c`

### USB Gadget

- [Mass Storage Gadget](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/g_mass_storage.c): `Drivers/USBGadgetDrivers/g_mass_storage.c`
- [Storage Function](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/f_mass_storage.c): `Drivers/USBGadgetDrivers/f_mass_storage.c`
- [Storage Common](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/storage_common.c): `Drivers/USBGadgetDrivers/storage_common.c`
- [Gadget Quirks](https://github.com/sysplay/bbb/blob/master/Drivers/USBGadgetDrivers/gadget_chips.h): `Drivers/USBGadgetDrivers/gadget_chips.h`

### User Apps

- [GPIO Apps](https://github.com/sysplay/bbb/blob/master/Apps/select_gpio.c): `Apps/select_gpio.c`
- [I2C Apps](https://github.com/sysplay/bbb/blob/master/Apps/i2c_client_app.c): `Apps/i2c_client_app.c`
- [SPI ADC App](https://github.com/sysplay/bbb/blob/master/Apps/spi_adc.c): `Apps/spi_adc.c`

### Bare Metal

- [Peripheral Registers](https://github.com/sysplay/bbb/blob/master/EmbC/bbb.h): `EmbC/bbb.h`
- [Firmware Types](https://github.com/sysplay/bbb/blob/master/EmbC/common.h): `EmbC/common.h`
- [Interrupt Handling](https://github.com/sysplay/bbb/blob/master/EmbC/interrupt.c): `EmbC/interrupt.c`

### Other components

- **Workshop Learner**
- **BeagleBone Black**

## Connections

- Workshop Learner → GPIO Apps: experiments with
- Workshop Learner → I2C Apps: experiments with
- GPIO Apps → GPIO LED ioctl: plays with drivers
- I2C Apps → I2C Character Driver: plays with drivers
- Mass Storage Gadget → Storage Function: configures (evidence: `Drivers/USBGadgetDrivers/g_mass_storage.c`)
- Storage Function → Storage Common: uses definitions (evidence: `Drivers/USBGadgetDrivers/f_mass_storage.c`)
- Storage Function → Gadget Quirks: checks quirks (evidence: `Drivers/USBGadgetDrivers/f_mass_storage.c`)
- I2C Character Driver → I2C Definitions: includes (evidence: `Drivers/I2CDrivers/i2c_char_client.c`)
- Interrupt Handling → Peripheral Registers: accesses registers (evidence: `EmbC/interrupt.c`)
- Interrupt Handling → Firmware Types: uses types (evidence: `EmbC/interrupt.c`)
- Board Setup → Board Identity: uses board identity (evidence: `Bootloaders/XloaderMod/board.c`)
- Board Setup → BeagleBone Black: initializes
- Pin Mux → BeagleBone Black: configures pins
- GPIO LED ioctl → BeagleBone Black: controls GPIO
- GPIO Debounce → BeagleBone Black: handles GPIO events
- Mass Storage Gadget → BeagleBone Black: exposes storage
- Interrupt Handling → BeagleBone Black: handles interrupts
