# infineon/mtb-dsl-psc3m8 architecture

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

- Interactive diagram: https://gitdiagram.com/infineon/mtb-dsl-psc3m8
- Repository: https://github.com/infineon/mtb-dsl-psc3m8

## Overview

This is the ModusToolbox PSC3M8 Device Support Library: device-specific support for firmware development. Applications use HAL APIs for portable peripheral, system, and power-management operations; HAL wraps lower-level PDL APIs, which configure and operate the device hardware. Device utilities provide predefined SysPm callbacks for peripherals needing special DeepSleep handling. The README documents these layers and capabilities; sampled source confirms selected HAL-to-PDL and callback dependencies, but does not expose every driver call path.

Main entry points: [`pdl/drivers`](https://github.com/infineon/mtb-dsl-psc3m8/tree/master/pdl/drivers) (PDL drivers), [`hal/include/mtb_hal_utils.h`](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_utils.h) (HAL utilities), [`device-utils/syspm`](https://github.com/infineon/mtb-dsl-psc3m8/tree/master/device-utils/syspm) (SysPm callbacks), [`pdl/devices/include/cy_pdl.h`](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/devices/include/cy_pdl.h) (PDL include interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hal["Hardware Abstraction"]
  node_hal_peripherals["Peripheral HAL"]
  node_hal_system["System and clocks<br/>[mtb_hal_system.h]"]
  node_hal_syspm["HAL power management<br/>[mtb_hal_syspm.c]"]
  node_hal_hw_types["HAL hardware types<br/>[mtb_hal_hw_types.h]"]
  node_hal_utils["HAL utilities<br/>[mtb_hal_utils.h]"]
  node_hal_i2c["I2C HAL<br/>[mtb_hal_i2c.c]"]
  node_hal_uart["UART HAL<br/>[mtb_hal_uart.c]"]
  node_hal_spi["SPI HAL<br/>[mtb_hal_spi.c]"]
end

subgraph group_pdl["Peripheral Drivers"]
  node_pdl_drivers["PDL drivers"]
  node_pdl_sysclk["Clock driver<br/>[cy_sysclk_v2.c]"]
  node_pdl_syslib["System library<br/>[cy_syslib.h]"]
  node_pdl_syspm["PDL power management<br/>[cy_syspm.h]"]
end

subgraph group_device["Device Support"]
  node_device_headers["Device definitions<br/>[cy_device.h]"]
  node_pdl_entry["PDL include interface<br/>[cy_pdl.h]"]
end

subgraph group_utilities["Power Utilities"]
  node_syspm_callbacks["SysPm callbacks"]
  node_callback_resources["Callback resources"]
end

node_developer(("Firmware application"))

node_developer -->|"uses APIs"| node_hal_peripherals
node_developer -->|"uses APIs"| node_hal_system
node_hal_peripherals -->|"wraps drivers"| node_pdl_drivers
node_hal_hw_types -->|"maps resources"| node_pdl_drivers
node_pdl_entry -->|"includes definitions"| node_device_headers
node_pdl_entry -->|"includes APIs"| node_pdl_drivers
node_hal_system -.->|"wraps clocks"| node_pdl_sysclk
node_hal_syspm -->|"uses power APIs"| node_pdl_syspm
node_pdl_sysclk -->|"uses library"| node_pdl_syslib
node_hal_i2c -->|"uses utilities"| node_hal_utils
node_hal_spi -->|"uses utilities"| node_hal_utils
node_hal_uart -->|"uses utilities"| node_hal_utils
node_hal_i2c -->|"wraps drivers"| node_pdl_drivers
node_hal_spi -->|"wraps drivers"| node_pdl_drivers
node_hal_uart -->|"wraps drivers"| node_pdl_drivers
node_syspm_callbacks -->|"uses PDL"| node_pdl_entry
node_syspm_callbacks -->|"uses resources"| node_callback_resources
node_syspm_callbacks -.->|"handles power transitions"| node_pdl_syspm
node_hal_syspm -->|"uses utilities"| node_hal_utils

click node_hal_peripherals "https://github.com/infineon/mtb-dsl-psc3m8/tree/master/hal"
click node_hal_system "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_system.h"
click node_hal_syspm "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_syspm.c"
click node_hal_hw_types "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_hw_types.h"
click node_hal_utils "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_utils.h"
click node_pdl_drivers "https://github.com/infineon/mtb-dsl-psc3m8/tree/master/pdl/drivers"
click node_pdl_sysclk "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/source/cy_sysclk_v2.c"
click node_pdl_syslib "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/include/cy_syslib.h"
click node_pdl_syspm "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/include/cy_syspm.h"
click node_device_headers "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/devices/include/cy_device.h"
click node_pdl_entry "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/devices/include/cy_pdl.h"
click node_hal_i2c "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_i2c.c"
click node_hal_uart "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_uart.c"
click node_hal_spi "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_spi.c"
click node_syspm_callbacks "https://github.com/infineon/mtb-dsl-psc3m8/tree/master/device-utils/syspm"
click node_callback_resources "https://github.com/infineon/mtb-dsl-psc3m8/blob/master/device-utils/syspm/include/mtb_syspm_callbacks_hw_resources.h"

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_hal_peripherals,node_hal_system,node_hal_syspm,node_hal_hw_types,node_hal_utils,node_hal_i2c,node_hal_uart,node_hal_spi toneBlue
class node_pdl_drivers,node_pdl_sysclk,node_pdl_syslib,node_pdl_syspm toneAmber
class node_device_headers,node_pdl_entry toneMint
class node_syspm_callbacks,node_callback_resources toneRose
class node_developer toneIndigo
```

## Components

### Hardware Abstraction

- [Peripheral HAL](https://github.com/infineon/mtb-dsl-psc3m8/tree/master/hal): `hal`
- [System and clocks](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_system.h): `hal/include/mtb_hal_system.h`
- [HAL power management](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_syspm.c): `hal/source/mtb_hal_syspm.c`
- [HAL hardware types](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_hw_types.h): `hal/include/mtb_hal_hw_types.h`
- [HAL utilities](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/include/mtb_hal_utils.h): `hal/include/mtb_hal_utils.h`
- [I2C HAL](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_i2c.c): `hal/source/mtb_hal_i2c.c`
- [UART HAL](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_uart.c): `hal/source/mtb_hal_uart.c`
- [SPI HAL](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/hal/source/mtb_hal_spi.c): `hal/source/mtb_hal_spi.c`

### Peripheral Drivers

- [PDL drivers](https://github.com/infineon/mtb-dsl-psc3m8/tree/master/pdl/drivers): `pdl/drivers`
- [Clock driver](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/source/cy_sysclk_v2.c): `pdl/drivers/source/cy_sysclk_v2.c`
- [System library](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/include/cy_syslib.h): `pdl/drivers/include/cy_syslib.h`
- [PDL power management](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/drivers/include/cy_syspm.h): `pdl/drivers/include/cy_syspm.h`

### Device Support

- [Device definitions](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/devices/include/cy_device.h): `pdl/devices/include/cy_device.h`
- [PDL include interface](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/pdl/devices/include/cy_pdl.h): `pdl/devices/include/cy_pdl.h`

### Power Utilities

- [SysPm callbacks](https://github.com/infineon/mtb-dsl-psc3m8/tree/master/device-utils/syspm): `device-utils/syspm`
- [Callback resources](https://github.com/infineon/mtb-dsl-psc3m8/blob/master/device-utils/syspm/include/mtb_syspm_callbacks_hw_resources.h): `device-utils/syspm/include/mtb_syspm_callbacks_hw_resources.h`

### Other components

- **Firmware application**

## Connections

- Firmware application → Peripheral HAL: uses APIs
- Firmware application → System and clocks: uses APIs
- Peripheral HAL → PDL drivers: wraps drivers (evidence: `hal/source/mtb_hal_syspm.c`)
- HAL hardware types → PDL drivers: maps resources (evidence: `hal/include/mtb_hal_hw_types.h`)
- PDL include interface → Device definitions: includes definitions (evidence: `pdl/devices/include/cy_pdl.h`)
- PDL include interface → PDL drivers: includes APIs (evidence: `pdl/devices/include/cy_pdl.h`)
- System and clocks → Clock driver: wraps clocks
- HAL power management → PDL power management: uses power APIs (evidence: `hal/source/mtb_hal_syspm.c`)
- Clock driver → System library: uses library (evidence: `pdl/drivers/source/cy_sysclk_v2.c`)
- I2C HAL → HAL utilities: uses utilities (evidence: `hal/source/mtb_hal_i2c.c`)
- SPI HAL → HAL utilities: uses utilities (evidence: `hal/source/mtb_hal_spi.c`)
- UART HAL → HAL utilities: uses utilities (evidence: `hal/source/mtb_hal_uart.c`)
- I2C HAL → PDL drivers: wraps drivers
- SPI HAL → PDL drivers: wraps drivers
- UART HAL → PDL drivers: wraps drivers
- SysPm callbacks → PDL include interface: uses PDL (evidence: `device-utils/syspm/source/mtb_syspm_callbacks_dma.c`)
- SysPm callbacks → Callback resources: uses resources (evidence: `device-utils/syspm/include/mtb_syspm_callbacks_dma.h`)
- SysPm callbacks → PDL power management: handles power transitions
- HAL power management → HAL utilities: uses utilities (evidence: `hal/source/mtb_hal_syspm.c`)
