How andrea-cpu96/bare-metal-code works
This repository is a collection of independent STM32 firmware examples, not one integrated application. Its principal workflows are separate: sensor sampling, serial-to-ESP AT-command bridging, button debouncing, serial-command car control, and blocking UART echo. The excerpts show the main-loop calls for these examples; several implementations are unsampled, so their internal links are omitted rather than inferred.
Main entry points: Src/main.c AT command bridge · Src/main.c Command and motor control · Src/main.c UART echo loop · Src/main.c Sample loop
Components 24
Sensor example
- Sample loop
AM2302-DHT22/Src/main.c - AM2302 reader
AM2302-DHT22/Src/am2302.c - Timekeeping
AM2302-DHT22/Src/systemfunctions.c - System setup
AM2302-DHT22/Src/projectconf.c
ESP serial bridge
- AT command bridge
ESP01/Src/main.c - UART driver
ESP01/Src/uart.c - System setup
ESP01/Src/projectconf.c
Button example
- Debounce state machine
Ex_NonBlockingButton/Src/main.c - GPIO access
Ex_NonBlockingButton/Src/ports.c - Timekeeping
Ex_NonBlockingButton/Src/systemfunctions.c - System setup
Ex_NonBlockingButton/Src/projectconf.c
Web car controller
- Command and motor control
Remote_Controlled_Car/ESP01_WebCarController/Src/main.c - UART driver
Remote_Controlled_Car/ESP01_WebCarController/Src/uart.c - System setup
Remote_Controlled_Car/ESP01_WebCarController/Src/projectconf.c
UART example
- UART echo loop
uartInterface/Src/main.c - UART driver
uartInterface/Src/uart.c - System setup
uartInterface/Src/projectconf.c
Other components
- DHT22 sensor
- Serial terminal
- ESP-01 module
- Button and LED
- Web car controller
- Motor GPIO
- Serial terminal
Connections 22
- Sample loop → System setup: initializes
AM2302-DHT22/Src/main.c - Sample loop → Timekeeping: checks interval
AM2302-DHT22/Src/main.c - Sample loop → AM2302 reader: reads sensor
AM2302-DHT22/Src/main.c - AM2302 reader → DHT22 sensor: reads data
- AT command bridge → System setup: initializes
ESP01/Src/main.c - AT command bridge → UART driver: configures UART
ESP01/Src/main.c - Serial terminal → AT command bridge: enters commands
- AT command bridge → ESP-01 module: forwards commands
ESP01/Src/main.c - ESP-01 module → AT command bridge: returns response
ESP01/Src/main.c - AT command bridge → Serial terminal: displays response
ESP01/Src/main.c - Debounce state machine → System setup: initializes
Ex_NonBlockingButton/Src/main.c - Debounce state machine → GPIO access: checks and toggles
Ex_NonBlockingButton/Src/main.c - Debounce state machine → Timekeeping: checks debounce
Ex_NonBlockingButton/Src/main.c - GPIO access → Button and LED: accesses GPIO
- Command and motor control → System setup: initializes
Remote_Controlled_Car/ESP01_WebCarController/Src/main.c - Command and motor control → UART driver: configures UART
Remote_Controlled_Car/ESP01_WebCarController/Src/main.c - Web car controller → Command and motor control: sends commands
- Command and motor control → Motor GPIO: sets motor outputs
Remote_Controlled_Car/ESP01_WebCarController/Src/main.c - UART echo loop → System setup: initializes system
uartInterface/Src/main.c - UART echo loop → UART driver: uses UART
uartInterface/Src/main.c - Serial terminal → UART echo loop: sends input
- UART echo loop → Serial terminal: echoes input
uartInterface/Src/main.c