Requirements
Normative
The cross-module rules every conformant Chiisai HAL driver MUST satisfy, in addition to its own module requirements. Clustered by severity — expand a cluster below. Keywords per Requirement Keywords; conformance per Conformance. Requirements do not carry individual status — the set-level status applies to all of them. The naming scheme is illustrated in Naming Conventions; the shared types and services are catalogued in the Reference.
Mandatory (MUST) - 16 Requirements
The cross-module conformance contract — an implementation MUST satisfy every requirement here.
CHI-GEN-MUST-01 — Module implementation prefix
|
Every implementation-specific symbol MUST be built from a module implementation prefix
|
CHI-GEN-MUST-02 — Symbol naming
|
Driver symbols MUST follow the scheme in Naming Conventions: enumeration literals and
|
CHI-GEN-MUST-03 — File naming and include guards
|
File names MUST be case-sensitive and unambiguous (two names MUST differ by more than
letter case). Driver implementation files MUST be named |
CHI-GEN-MUST-04 — General types header
|
Each module MUST publish the types and definitions of its specification in a general types
header, and that header MUST contain only the types and definitions specified by the
respective driver specification. A module that is delivered with an upper-layer interface
stack MUST name this header |
CHI-GEN-MUST-05 — Include and export discipline
|
A driver MUST import only the headers required to realise its functionality and MUST export only the information other modules need to use it. A driver MUST include its own header so the toolchain checks declarations against definitions (consistency check). |
CHI-GEN-MUST-06 — Package folder structure
|
Each module package MUST follow the common directory structure ( |
CHI-GEN-MUST-07 — Memory mapping mechanism
|
Each driver file MUST include the memory-mapping header |
CHI-GEN-MUST-08 — Memory allocation keywords
|
Allocation keywords MUST follow these templates, where
|
CHI-GEN-MUST-09 — Standard type system and compiler abstraction
|
A driver MUST use the shared type system and compiler-abstraction set defined in the
Reference: |
CHI-GEN-MUST-10 — Error, logging, and system services
|
A driver MUST report errors through the shared services defined in the
Reference: development and runtime errors via
|
CHI-GEN-MUST-11 — Interrupt and scheduling handlers
|
Interrupt handlers MUST be named |
CHI-GEN-MUST-12 — Configuration model
|
Each driver MUST provide a configuration model file, a generator script, and code
templates. The model root MUST be |
CHI-GEN-MUST-13 — Module documentation
|
Each module MUST provide documentation covering: a cover sheet and change history; a navigable table of contents; a functional overview; the source-file list; deviations to the specification; used resources (interrupts, peripherals); API, integration, and configuration descriptions (parameter, description, unit, valid range, default, relations). Where the implementation depends on a microcontroller, it MUST also state the µC vendor / family / derivative / stepping, the toolchain name, version, and options, and the used register list. |
CHI-GEN-MUST-14 — Callout definitions
|
Where a module defines a callout to be implemented by the user, the toolchain MUST generate
a default implementation (marked as user-update code that the generator MUST NOT
overwrite), and the callout prototype MUST be available via the module public header
|
CHI-GEN-MUST-15 — Callout function naming
|
A callout is a function that the driver calls and the integrator implements. Every callout
MUST carry the
Where two modules signal the same kind of event, they MUST reuse the same This scheme applies to a module that has no upper-layer interface stack. A module that is
delivered with an upper-layer interface stack MUST instead name the functions it reports
through Because the infix is reserved, a function named |
CHI-GEN-MUST-16 — Callout stub file
|
The toolchain MUST emit the generated default callout implementations of a module into a
single file named
|
Recommended (SHOULD) - 3 Requirements
Strongly advised; an implementation that deviates should understand the implications.
CHI-GEN-SHOULD-01 — Multiple driver instances
|
If multiple instances of a driver are required (e.g. an internal and an external watchdog), each instance SHOULD use the optional vendor / API infixes of the naming convention to avoid symbol conflicts. External-hardware drivers in particular SHOULD use the infixes. |
CHI-GEN-SHOULD-02 — Vendor infixes
|
The vendor infix |
CHI-GEN-SHOULD-03 — Memory-mapping generation and imported software
|
The configurator SHOULD support generation of the memory-mapping file. If a driver imports other software (e.g. an existing library), that software SHOULD be able to address the same memory sections as the driver (via its own memory-mapping mechanism or a linker directive). |