How fh-stece2023-org/fh-stece2023 works
This repository implements a GPIO-controlled door system: inputs and analog sensing inform a door state machine, which selects motor behavior. The tree and excerpts also show hardware and mock implementations, event-loop utilities, and I2C sensor support. The main executable’s wiring was not shown, so links from it to runtime components are left unverified; unsampled subsystems are included only where their paths and roles are supported by the tree or README.
Main entry points: analog-sensor.h Analog sensor interface · motor.h Motor interface · door.cpp Door state machine · run-door.cpp Door executable
Components 25
Door control
- Door state machine
src/door/statemachine/door.cpp - Input collection
src/door/statemachine/inputs.cpp - Control event types
src/door/statemachine/structs.h
Inputs and sensing
- Input switch
src/door/input_output_switch/input/input-switch.h - GPIO input
src/door/input_output_switch/input/input-switch-gpio-sysfs.cpp - GPIO edge events
src/door/input_output_switch/input/input-edge-event.cpp - Analog event generator
src/door/analog_stuff/sensor/analog-sensor-event-generator.cpp - Analog sensor interface
src/door/analog_stuff/sensor/analog-sensor.h - ADS1115 converter
src/door/analog_stuff/adc/adc-ads1115.cpp - BMP280 pressure sensor
src/door/analog_stuff/sensor/pressure-sensor-bmp280.cpp - Input mock
src/door/input_output_switch/input/input-switch-mock.cpp - Analog sensor mock
src/door/analog_stuff/sensor/analog-sensor-mock.cpp
Hardware interfaces
- Motor interface
src/door/motor/motor.h - Stepper motor
src/door/motor/motor-stepper.cpp - Motor LED
src/door/motor/motorLED.cpp - Output switch
src/door/input_output_switch/output/output-switch.h - GPIO output
src/door/input_output_switch/output/output-switch-gpio-sysfs.cpp - Output mock
src/door/input_output_switch/output/output-switch-mock.cpp - Motor mock
src/door/motor/motor-mock.cpp
Runtime utilities
- I2C access
src/door/utilities/i2c.cpp - Event loop
src/door/utilities/eventloop.cpp - One-shot timer
src/door/utilities/one-shot-timer.cpp - Sysfs file access
src/door/utilities/small_file_handling.cpp
Other components
- Door user
- Door executable
bin/run-door.cpp
Connections 25
- Door user → Door executable: uses
- Door executable → Door state machine: starts
- Input collection → Input switch: reads
- Input collection → Analog event generator: collects events
- Door state machine → Motor interface: selects direction
src/door/statemachine/door.cpp - Door state machine → Control event types: uses events
src/door/statemachine/door.cpp - GPIO input → Input switch: implements
- GPIO edge events → Event loop: registers with
src/door/input_output_switch/input/input-edge-event.cpp - GPIO edge events → Sysfs file access: configures GPIO
src/door/input_output_switch/input/input-edge-event.cpp - Analog event generator → Analog sensor interface: reads
- ADS1115 converter → Analog sensor interface: implements
- ADS1115 converter → I2C access: reads conversion
src/door/analog_stuff/adc/adc-ads1115.cpp - BMP280 pressure sensor → I2C access: reads pressure
src/door/analog_stuff/sensor/pressure-sensor-bmp280.cpp - BMP280 pressure sensor → Analog sensor interface: implements
- Stepper motor → Motor interface: implements
- Stepper motor → Output switch: sets GPIO
src/door/motor/motor-stepper.cpp - Motor LED → Motor interface: uses interface
- GPIO output → Output switch: implements
- GPIO output → Sysfs file access: writes GPIO
src/door/input_output_switch/output/output-switch-gpio-sysfs.cpp - One-shot timer → Event loop: uses
- One-shot timer → Door executable: scheduling role
- Input mock → Input switch: implements
- Output mock → Output switch: implements
- Motor mock → Motor interface: implements
src/door/motor/motor-mock.cpp - Analog sensor mock → Analog sensor interface: implements