# hms-networks/abcc-example-raspberrypi architecture

> Architecture diagram of the GitHub repository hms-networks/abcc-example-raspberrypi, 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/hms-networks/abcc-example-raspberrypi
- Repository: https://github.com/hms-networks/abcc-example-raspberrypi

## Overview

This repository is a Raspberry Pi evaluation application for an Anybus CompactCom module. Its runtime is driven by a main loop that services the ABCC Driver API, while the application supplies example network data and callbacks and the platform adaptation provides hardware access. The README documents SPI and serial evaluation; configuration and the hardware abstraction show those interfaces and GPIO/timer support. The driver API implementation is in a submodule not sampled here, so its internal stages are not expanded; links to it are documented or indicated as unverified where appropriate.

Main entry points: [`src/main.c`](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/main.c) (Runtime loop), [`lib/abcc-driver-api`](https://github.com/hms-networks/abcc-example-raspberrypi/tree/main/lib/abcc-driver-api) (ABCC Driver API), [`src/abcc_adaptation/abcc_software_port.h`](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_software_port.h) (Software port), [`src/abcc_adaptation/abcc_hardware_abstraction.c`](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_hardware_abstraction.c) (Hardware abstraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Example application"]
  node_main["Runtime loop<br/>[main.c]"]
  node_driver["ABCC Driver API"]
  node_network_data["Network data"]
  node_callbacks["Object callbacks"]
end

subgraph group_adapt["Raspberry Pi adaptation"]
  node_config["Driver configuration"]
  node_hardware["Hardware abstraction"]
  node_port["Software port"]
  node_types["Platform types<br/>[abcc_types.h]"]
  node_hal_aux["HAL interfaces"]
end

subgraph group_support["Runtime support"]
  node_logger["Logging<br/>[logprint.c]"]
  node_log_streams["Console and log file"]
end

node_user(("Operator"))
node_module["CompactCom module"]
node_raspberry_pi["Raspberry Pi"]

node_user -->|"runs"| node_main
node_main -->|"drives"| node_driver
node_main -.->|"initializes and shuts down"| node_hardware
node_main -.->|"uses callbacks"| node_network_data
node_main -->|"logs through"| node_logger
node_driver -->|"reads and updates"| node_network_data
node_driver -->|"dispatches"| node_callbacks
node_config -->|"configures"| node_driver
node_driver -->|"uses port macros"| node_port
node_port -->|"routes logging"| node_logger
node_port -->|"uses timer locks"| node_hal_aux
node_hardware -->|"accesses GPIO and interfaces"| node_raspberry_pi
node_module -->|"communicates over SPI or serial"| node_hardware
node_logger -->|"writes"| node_log_streams
node_main -.->|"accepts console input"| node_user

click node_main "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/main.c"
click node_driver "https://github.com/hms-networks/abcc-example-raspberrypi/tree/main/lib/abcc-driver-api"
click node_network_data "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/abcc_network_data_parameters.c"
click node_callbacks "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/implemented_callback_functions.c"
click node_config "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_driver_config.h"
click node_hardware "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_hardware_abstraction.c"
click node_port "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_software_port.h"
click node_types "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_types.h"
click node_hal_aux "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_hardware_abstraction_aux.h"
click node_logger "https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/Logprint/logprint.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_main,node_driver,node_network_data,node_callbacks toneBlue
class node_config,node_hardware,node_port,node_types,node_hal_aux toneAmber
class node_logger,node_log_streams toneMint
class node_user,node_module,node_raspberry_pi toneIndigo
```

## Components

### Example application

- [Runtime loop](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/main.c): `src/main.c`
- [ABCC Driver API](https://github.com/hms-networks/abcc-example-raspberrypi/tree/main/lib/abcc-driver-api): `lib/abcc-driver-api`
- [Network data](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/abcc_network_data_parameters.c): `src/example_application/abcc_network_data_parameters.c`
- [Object callbacks](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/implemented_callback_functions.c): `src/example_application/implemented_callback_functions.c`

### Raspberry Pi adaptation

- [Driver configuration](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_driver_config.h): `src/abcc_adaptation/abcc_driver_config.h`
- [Hardware abstraction](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_hardware_abstraction.c): `src/abcc_adaptation/abcc_hardware_abstraction.c`
- [Software port](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_software_port.h): `src/abcc_adaptation/abcc_software_port.h`
- [Platform types](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_types.h): `src/abcc_adaptation/abcc_types.h`
- [HAL interfaces](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/abcc_adaptation/abcc_hardware_abstraction_aux.h): `src/abcc_adaptation/abcc_hardware_abstraction_aux.h`

### Runtime support

- [Logging](https://github.com/hms-networks/abcc-example-raspberrypi/blob/main/src/example_application/Logprint/logprint.c): `src/example_application/Logprint/logprint.c`
- **Console and log file**

### Other components

- **Operator**
- **CompactCom module**
- **Raspberry Pi**

## Connections

- Operator → Runtime loop: runs (evidence: `README.md`)
- Runtime loop → ABCC Driver API: drives (evidence: `src/main.c`)
- Runtime loop → Hardware abstraction: initializes and shuts down
- Runtime loop → Network data: uses callbacks
- Runtime loop → Logging: logs through (evidence: `src/main.c`)
- ABCC Driver API → Network data: reads and updates (evidence: `src/example_application/abcc_network_data_parameters.c`)
- ABCC Driver API → Object callbacks: dispatches (evidence: `src/example_application/implemented_callback_functions.c`)
- Driver configuration → ABCC Driver API: configures (evidence: `src/abcc_adaptation/abcc_driver_config.h`)
- ABCC Driver API → Software port: uses port macros (evidence: `src/abcc_adaptation/abcc_software_port.h`)
- Software port → Logging: routes logging (evidence: `src/abcc_adaptation/abcc_software_port.h`)
- Software port → HAL interfaces: uses timer locks (evidence: `src/abcc_adaptation/abcc_software_port.h`)
- Hardware abstraction → Raspberry Pi: accesses GPIO and interfaces (evidence: `README.md`)
- CompactCom module → Hardware abstraction: communicates over SPI or serial (evidence: `README.md`)
- Logging → Console and log file: writes (evidence: `src/example_application/Logprint/logprint.c`)
- Runtime loop → Operator: accepts console input
