Introduction
This is a mono repo for autonomy lab firmware team at The Cooper Union for the Advancement of Science and Art.
Repository Structure
AutonomyLab-Firmware/
├── drivers/ Hardware drivers
│ ├── rp2350/ RP2350 peripheral drivers
│ │ ├── include/ Register definitions & driver headers
│ │ └── *.c Driver implementations
│ └── devices/ External part drivers
├── lib/ Hardware-independent code
├── examples/ Small programs that test/demo a driver
├── cmake/ Shared CMake helpers (pico_sdk_import.cmake)
├── docs/ This doc
└── .github/workflows/ CI and docs deployment
drivers/
As the name suggests, put drivers here. Keep it baremetal.
rp2350/: the chip’s own peripherals (GPIO, PWM, UART, …)devices/: for external parts. One folder per part, named by its part number.- Name registers and fields as the datasheet does (this reduces confusion).
- Note datasheet section/page in comments where helpful.
lib/
Code that does not touch hardware. It should be able to compile on your machine (not pico) as well.
- If it needs registers -> drivers/
- Only used inside one specific driver -> keep it in that driver
- Shared between drivers or examples -> lib/
examples/
Small programs that show a driver is working, one folder each. Use them to test a driver and document example usage of your driver.
Contributing
Please do not directly commit to main.
- Pull
mainand create a branch. For example,git switch main && git pull git switch -c feature/pwm-driver - Commit your work to your branch.
- Open a pull request into
main. - Get someone else to review and approve.
- Then merge it.
Conventions
Some conventions has been specified to make potential future integration less painful. This was decided on October 16, 2026.
Branches
Use the following prefixes when creating a branch. Use-kebab-case-for-branch-names.
| Prefix | Use this for |
|---|---|
feat/ | New drivers or features |
fix/ | Bug fixes |
docs/ | Documentation only |
Code Style
- Format with
clang-formatusing the.clang-formaton the root. - Use fixed-width integer types.
- Yes typedef for all the structs
- we are using snake_case
Writing Docs
- Install mdbook.
- for Macos:
brew install mdbook - main documentation: https://rust-lang.github.io/mdBook/guide/installation.html
Sorry if you are using different OS, you can add some documentation for your OS here…
- for Macos:
- To add a page, create a
.mdfile indocs/src/and list it inSUMMARY.md. - Preview from the repo root
mdbook serve docs --open - Clean the build output:
mdbook clean docs