Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e8d5817
feat(ClockDomain)!: Implement ClockDomain
FoniksFox Jun 21, 2026
d9f3340
feat(ClockDomain): Replace HALconfig with ClockDomain
FoniksFox Jun 21, 2026
97eb2d5
feat(SPI): Implement ClockDomain integration for SPI peripheral confi…
FoniksFox Jun 21, 2026
752742b
feat(ADC): Implement ClockDomain integration for ADC peripheral confi…
FoniksFox Jun 21, 2026
cfc4e90
feat(Timer): Implement ClockDomain integration for TimerDomain
FoniksFox Jun 21, 2026
2043348
feat(SD): Implement ClockDomain integration for SDMMC peripheral
FoniksFox Jun 21, 2026
cee4db6
chore(CI): Fix tests to work with new clock tree
FoniksFox Jun 21, 2026
7b95f82
chore(CI): Add ClockDomain tests
FoniksFox Jun 21, 2026
36cef8b
docs(ClockDomain): Add ClockDomain documentation and update contract
FoniksFox Jun 21, 2026
020b2d4
style: Run pre-commit
FoniksFox Jun 21, 2026
94af50b
chore: Add changeset
FoniksFox Jun 21, 2026
d53e2c8
chore(CI): Fix tests
FoniksFox Jun 21, 2026
ebf72c9
chore(CI): Fix tests, again
FoniksFox Jun 21, 2026
0f9ad81
feat(ClockDomain): Add global accessors for ClockDomain frequencies
FoniksFox Jun 21, 2026
3b576f5
Use global ClockDomain instance in timers
victor-Lopez25 Jun 21, 2026
82772b1
Fix/hardfaulttrace warning symbols (#663)
FoniksFox Jun 21, 2026
f868613
style: Run pre-commit
FoniksFox Jun 21, 2026
04f9d1b
chore: Fix tests
FoniksFox Jun 21, 2026
d3153ec
Merge branch 'development' into feat/ClockDomain
FoniksFox Jun 21, 2026
02a0d56
fix: I hate arm-none-eabi-gcc
FoniksFox Jun 21, 2026
e146928
style: Pre-commit
FoniksFox Jun 21, 2026
20a97d2
fix: Add none Clock source
FoniksFox Jun 21, 2026
38a7742
fix: Actually copy the global clock tree
FoniksFox Jun 21, 2026
50d0c23
style: Pre-commit
FoniksFox Jun 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changesets/clock-redesign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
release: major
summary: Add ClockDomain, a centralised clock validator and applicator

Clock configuration is a precomputed `ClockTree` (from a host tool or hand-written). The firmware validates it at compile time and applies it at runtime. No solver runs in the firmware.

- `ClockTree` stores only decisions (M/N/P/Q/R, prescalers, source enums); all frequencies are derived via accessors (`sysclk(t)`, `source_frequency(t, src)`, etc.)
- `Board<>` takes a mandatory `ClockTree` as the second template parameter
- Peripherals register clock requirements via `ClockDomain::Device` with typed models: `SPIClockModel<Group, MaxBaud, MinBaud>`, `ADCClockModel<MaxADCCLK>`, `SDClockModel<MaxFreq, MinFreq>`
- `ClockDomain::build()` validates PLL ranges, bus consistency, and peripheral requirements at compile time - refuses to compile on failure
- `ClockDomain::Init::init(tree)` applies the validated tree to HAL registers
- ADC prescaler computed from kernel clock at init (no longer user-specified)
- SPI/SD use mandatory frequency ranges
- Removed `HALconfig`
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ set(HALAL_C_NO_ETH
set(HALAL_CPP_NO_ETH
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/HALAL.cpp
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/Models/DMA/DMA.cpp
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/Models/HALconfig/Halconfig.cpp
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/Models/LowPowerTimer/LowPowerTimer.cpp
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/Models/MDMA/MDMA.cpp
${CMAKE_CURRENT_LIST_DIR}/Src/HALAL/Models/MPUManager/MPUManager.cpp
Expand Down
3 changes: 2 additions & 1 deletion Inc/HALAL/HALAL.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once

#include "HALAL/Models/Clocks/ClockDomain.hpp"

#include "HALAL/Models/GPIO.hpp"
#include "HALAL/Models/Pin.hpp"

#include "HALAL/Models/DMA/DMA2.hpp"
#include "HALAL/Models/HALconfig/HALconfig.hpp"

#include "HALAL/Services/DigitalInputService/DigitalInputService.hpp"
#include "HALAL/Services/DigitalOutputService/DigitalOutputService.hpp"
Expand Down
Loading
Loading