Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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