Overview
Informative
What the MCU driver is, its boundaries, and where it sits. Non-binding orientation; the normative contract is in Mcu — Requirements. The driver builds on the shared foundation (type system, error model, naming, memory mapping) in General.
In one sentence: the MCU driver (McuDrv) provides a thin, portable abstraction over the microcontroller’s core facilities — it initialises mode and reset-management registers, sets up the clock tree, reports the reset cause, and can issue a reset.
What it does
Brings the driver and the MCU’s core hardware up (
Mcu_Init): mode-relevant registers, reset management, and registers that affect multiple peripherals.Applies MCU-specific clock configurations by id (
Mcu_InitClock) without busy-waiting, and reports when the clock tree has stabilised and been distributed (Mcu_IsClockDistributed).Captures the reset reason at startup and reports it (
Mcu_GetResetRawValue); can issue a microcontroller reset (Mcu_PerformReset).Services time-based work — clock stabilisation, distribution, and supervision — from a periodic poll (
Mcu_PollFunction).
What it does not do
No low-power mode control — sleep / deep-sleep management is out of scope (not standardized).
No I/O pin configuration — port pins are the Port driver’s responsibility; the McuDrv only touches registers that affect multiple peripherals.
No channels or instances — the McuDrv is a single-instance driver; there is no de-init.
No system-resource orchestration — the order in which other drivers are brought up around the MCU is the integrator’s concern.
Where it sits
flowchart TB
IC["Integration / startup code"]
DRV["Chiisai MCU Driver"]
HW["MCU core hardware<br/>(mode, reset, clock tree)"]
IC -->|"Mcu_Init, Mcu_InitClock,<br/>Mcu_PerformReset, Mcu_PollFunction, ..."| DRV
DRV -->|"LogM_Report (runtime clock errors)"| IC
DRV --> HW
classDef driver fill:#FEDCD2,stroke:#c66,stroke-width:2px;
class DRV driver;
The McuDrv is typically driven by the startup / integration code very early in boot — before most other drivers — because it establishes the clock tree they depend on.
Dependencies
Depends on |
For |
|---|---|
Expected integration interfaces |
The services the driver calls back into (LogM_Report for errors, and optional critical-section services). See API Reference → Callouts the integrator provides. |
The shared foundation |
The common type system, compiler abstraction, error model, naming scheme, and memory mapping defined in General. |
References
No. |
Document |
|---|---|
[1] |
The Chiisai HAL General part — the shared contract this module builds on. |