Reference

Normative

The shared type system, compiler abstraction, and services every Chiisai HAL driver builds on. A conformant driver MUST provide and use these definitions (see Requirements, CHI-GEN-MUST-09 and CHI-GEN-MUST-10). Keywords per Requirement Keywords.

Shared components at a glance

        flowchart LR
    subgraph types["Types"]
        StdTypes["Std_Types.h"]
        Plat["Platform_Types.h"]
        Com["ComStack_Types.h"]
    end
    subgraph compiler["Compiler abstraction"]
        CompH["Compiler.h"]
        CompCfg["Compiler_Cfg.h"]
    end
    subgraph services["Services & utilities"]
        Log["LogM.h"]
        Sch["SchM_<Mip>.h"]
        OsH["Os.h"]
        StdLib["Std_Lib.h"]
    end
    subgraph memmap["Memory mapping"]
        MemMap["<Mip>_MemMap.h"]
    end

    StdLib --> StdTypes
    Log --> StdTypes
    Sch --> StdTypes
    StdTypes --> CompH
    CompH --> CompCfg
    StdTypes --> Plat
    

Shared foundation headers and how they include one another (arrows mean “includes / depends on”). ComStack_Types.h, Os.h, and the memory-mapping header are used directly by a driver.

The diagram at a glance — one line per header, in the same order as the groups above:

Group

Header

What it provides

Types

Std_Types.h

The standard API return type and constants: Std_ReturnType, E_OK / E_NOT_OK, STD_ON / STD_OFF.

Types

Platform_Types.h

Fixed-width integer and float types plus the CPU architecture-description macros (CPU_TYPE, bit / byte order, TRUE / FALSE).

Types

ComStack_Types.h

Communication-stack PDU types (PduIdType, PduLengthType, PduInfoType); included directly by the communication drivers.

Compiler abstraction

Compiler.h

Portability basics and the declaration macros — NULL_PTR, INLINE, VAR / CONST / P2VAR / FUNC … — plus the AUTOMATIC / TYPEDEF memory classes.

Compiler abstraction

Compiler_Cfg.h

The module-specific memory-class definitions (<MIP>_CODE / _CONST / _VAR_*, REGSPACE); one is delivered per module and the integrator merges them.

Services & utilities

LogM.h

Log Manager: the log levels (LogM_LogLevel) and LogM_Report, through which drivers report development, runtime, and informational events.

Services & utilities

SchM_<Mip>.h

Critical-section brackets <Mip>_EnterCriticalSection / ExitCriticalSection (the integrator supplies the implementation).

Services & utilities

Os.h

The ISR() macro that defines interrupt service routines portably; included directly by a driver.

Services & utilities

Std_Lib.h

Shared buffer helpers Std_MemCpy / Std_MemClr / Std_MemSet / Std_MemCmp / Std_MemCheck.

Memory mapping

<Mip>_MemMap.h

The memory-mapping header; included once per section (START / STOP symbols) to place code, variables, and constants into memory sections. Module-specific, included directly by a driver.

Types and constants at a glance

Group

Header

Contents

Standard types

Std_Types.h

Std_ReturnType, E_OK / E_NOT_OK, STD_ON / STD_OFF

Platform types

Platform_Types.h

integer / float types, CPU_TYPE / bit / byte order, TRUE / FALSE

Communication-stack types

ComStack_Types.h

PduIdType, PduInfoType, PduLengthType

Module identifiers

the 16-bit module ids used in error reporting

Compiler abstraction at a glance

Group

Header

Contents

Basics

Compiler.h

NULL_PTR, INLINE, LOCAL_INLINE

Memory class macros

Compiler.h / Compiler_Cfg.h

AUTOMATIC, TYPEDEF, <MIP>_CODE / _CONST / _VAR_*, …

Declaration macros

Compiler.h

VAR / CONST / P2VAR / P2CONST / FUNC / …

Services and utilities at a glance

Group

Header

Contents

Logging

LogM.h

LogM_LogLevel, LogM_Report

Critical sections

SchM_<Mip>.h

<Mip>_EnterCriticalSection / ExitCriticalSection

Interrupt definition

Os.h

the ISR() macro

Standard memory utilities

Std_Lib.h

Std_MemCpy / Clr / Set / Cmp / Check