# infineon/lin architecture

> Architecture diagram of the GitHub repository infineon/lin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/infineon/lin
- Repository: https://github.com/infineon/lin

## Overview

This repository is Infineon’s embedded LIN middleware library: an application configures and initializes a LIN slave, exchanges LIN frames with a bus master, and uses signal and transport APIs to interact with application data. The documented product also includes node-configuration services, diagnostics, baud synchronization, inactivity detection, and error handling. Source excerpts show individual API and implementation responsibilities, but do not expose the full runtime call graph; uncertain internal links are therefore omitted.

Main entry points: [`mtb_lin_types.h`](https://github.com/infineon/lin/blob/master/mtb_lin_types.h) (Config and context), [`mtb_lin.c`](https://github.com/infineon/lin/blob/master/mtb_lin.c) (Common API), [`mtb_lin_ifc.c`](https://github.com/infineon/lin/blob/master/mtb_lin_ifc.c) (Frame engine), [`mtb_lin_sig.c`](https://github.com/infineon/lin/blob/master/mtb_lin_sig.c) (Signal interaction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core and interface"]
  node_common["Common API<br/>[mtb_lin.c]"]
  node_types["Config and context<br/>[mtb_lin_types.h]"]
  node_interface["Interface management<br/>[mtb_lin_ifc.c]"]
end

subgraph group_frames["Frames and signals"]
  node_frame_engine["Frame engine<br/>[mtb_lin_ifc.c]"]
  node_signal_api["Signal interaction<br/>[mtb_lin_sig.c]"]
end

subgraph group_transport["Transport and diagnostics"]
  node_transport_api["Transport API<br/>[mtb_lin_ld.c]"]
  node_diagnostics["Diagnostic services<br/>[mtb_lin_ncs.c]"]
end

subgraph group_config["Node configuration"]
  node_node_config["Node configuration<br/>[mtb_lin_ld.c]"]
end

node_application(("LIN application"))
node_bus(("LIN bus master"))

node_application -->|"initializes"| node_common
node_application -->|"manages interface"| node_interface
node_application -->|"reads and writes"| node_signal_api
node_application -->|"uses transport"| node_transport_api
node_bus -.->|"exchanges frames"| node_frame_engine
node_common -->|"uses config"| node_types
node_frame_engine -->|"uses context"| node_types
node_signal_api -->|"accesses signals"| node_types
node_transport_api -->|"uses context"| node_types
node_diagnostics -->|"uses context"| node_types
node_application -->|"configures node"| node_node_config

click node_common "https://github.com/infineon/lin/blob/master/mtb_lin.c"
click node_types "https://github.com/infineon/lin/blob/master/mtb_lin_types.h"
click node_interface "https://github.com/infineon/lin/blob/master/mtb_lin_ifc.c"
click node_frame_engine "https://github.com/infineon/lin/blob/master/mtb_lin_ifc.c"
click node_signal_api "https://github.com/infineon/lin/blob/master/mtb_lin_sig.c"
click node_transport_api "https://github.com/infineon/lin/blob/master/mtb_lin_ld.c"
click node_diagnostics "https://github.com/infineon/lin/blob/master/mtb_lin_ncs.c"
click node_node_config "https://github.com/infineon/lin/blob/master/mtb_lin_ld.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_common,node_types,node_interface toneBlue
class node_frame_engine,node_signal_api toneAmber
class node_transport_api,node_diagnostics toneMint
class node_node_config toneRose
class node_application,node_bus toneIndigo
```

## Components

### Core and interface

- [Common API](https://github.com/infineon/lin/blob/master/mtb_lin.c): `mtb_lin.c`
- [Config and context](https://github.com/infineon/lin/blob/master/mtb_lin_types.h): `mtb_lin_types.h`
- [Interface management](https://github.com/infineon/lin/blob/master/mtb_lin_ifc.c): `mtb_lin_ifc.c`

### Frames and signals

- [Frame engine](https://github.com/infineon/lin/blob/master/mtb_lin_ifc.c): `mtb_lin_ifc.c`
- [Signal interaction](https://github.com/infineon/lin/blob/master/mtb_lin_sig.c): `mtb_lin_sig.c`

### Transport and diagnostics

- [Transport API](https://github.com/infineon/lin/blob/master/mtb_lin_ld.c): `mtb_lin_ld.c`
- [Diagnostic services](https://github.com/infineon/lin/blob/master/mtb_lin_ncs.c): `mtb_lin_ncs.c`

### Node configuration

- [Node configuration](https://github.com/infineon/lin/blob/master/mtb_lin_ld.c): `mtb_lin_ld.c`

### Other components

- **LIN application**
- **LIN bus master**

## Connections

- LIN application → Common API: initializes (evidence: `mtb_lin.c`)
- LIN application → Interface management: manages interface
- LIN application → Signal interaction: reads and writes
- LIN application → Transport API: uses transport
- LIN bus master → Frame engine: exchanges frames (evidence: `README.md`)
- Common API → Config and context: uses config (evidence: `mtb_lin.c`)
- Frame engine → Config and context: uses context (evidence: `mtb_lin_ifc.c`)
- Signal interaction → Config and context: accesses signals (evidence: `mtb_lin_sig.c`)
- Transport API → Config and context: uses context (evidence: `mtb_lin_ld.c`)
- Diagnostic services → Config and context: uses context (evidence: `mtb_lin_ncs.c`)
- LIN application → Node configuration: configures node
