# sumithdani/ancit_project_team_16 architecture

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

- Interactive diagram: https://gitdiagram.com/sumithdani/ancit_project_team_16
- Repository: https://github.com/sumithdani/ancit_project_team_16

## Overview

This is a small S32K144 embedded demo of CRC-checked configuration fallback, not a persistent NvM service: the configuration block and its saved CRC are simulated in RAM. At startup, the application initializes board peripherals, validates the block, selects either NvM data or compile-time defaults, sets a status flag, and reports the outcome through UART and LEDs. The README documents the main flow and board capabilities; application source was not sampled, so internal call details beyond that documented flow are not independently verified.

Main entry points: [`src/main.c`](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c) (Application flow), [`SDK/platform/drivers/src/lpuart/lpuart_driver.c`](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/lpuart/lpuart_driver.c) (LPUART driver), [`board/clock_config.c`](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/clock_config.c) (Clock setup), [`board/pin_mux.c`](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/pin_mux.c) (Pin setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Fallback application"]
  node_main["Application flow<br/>[main.c]"]
  node_config["Config data<br/>[main.c]"]
  node_crc_check["CRC validation<br/>[main.c]"]
  node_fallback["Fallback selection<br/>[main.c]"]
  node_result["Status and flag<br/>[main.c]"]
end

subgraph group_board["Board setup"]
  node_clock_config["Clock setup<br/>[clock_config.c]"]
  node_pin_config["Pin setup<br/>[pin_mux.c]"]
  node_crc_config["CRC setup"]
  node_uart_config["UART setup"]
end

subgraph group_sdk["Peripheral drivers"]
  node_clock_driver["Clock driver<br/>[clock_S32K1xx.c]"]
  node_pins_driver["Pins driver<br/>[pins_driver.c]"]
  node_crc_driver["CRC driver<br/>[crc_driver.c]"]
  node_uart_driver["LPUART driver<br/>[lpuart_driver.c]"]
  node_registers["Device registers<br/>[device_registers.h]"]
end

node_power(("Board startup"))
node_terminal(("PuTTY terminal"))
node_leds(("On-board LEDs"))

node_power -->|"starts"| node_main
node_main -->|"initializes clock"| node_clock_config
node_main -->|"initializes pins"| node_pin_config
node_main -->|"initializes CRC"| node_crc_config
node_main -->|"initializes UART"| node_uart_config
node_clock_config -.->|"configures"| node_clock_driver
node_pin_config -->|"configures"| node_pins_driver
node_crc_config -->|"configures"| node_crc_driver
node_uart_config -->|"configures"| node_uart_driver
node_main -->|"checks block"| node_config
node_main -->|"calculates CRC"| node_crc_check
node_crc_check -->|"uses CRC peripheral"| node_crc_driver
node_main -->|"selects data"| node_fallback
node_fallback -->|"loads NvM or defaults"| node_config
node_fallback -->|"sets flag and status"| node_result
node_main -->|"sends result"| node_uart_driver
node_uart_driver -->|"transmits"| node_terminal
node_main -->|"indicates result"| node_leds
node_clock_driver -->|"accesses hardware"| node_registers
node_pins_driver -->|"accesses hardware"| node_registers

click node_main "https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c"
click node_config "https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c"
click node_crc_check "https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c"
click node_fallback "https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c"
click node_result "https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c"
click node_clock_config "https://github.com/sumithdani/ancit_project_team_16/blob/main/board/clock_config.c"
click node_pin_config "https://github.com/sumithdani/ancit_project_team_16/blob/main/board/pin_mux.c"
click node_crc_config "https://github.com/sumithdani/ancit_project_team_16/blob/main/board/peripherals_crc_1.c"
click node_uart_config "https://github.com/sumithdani/ancit_project_team_16/blob/main/board/peripherals_lpuart_1.c"
click node_clock_driver "https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/clock/S32K1xx/clock_S32K1xx.c"
click node_pins_driver "https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/pins/pins_driver.c"
click node_crc_driver "https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/crc/crc_driver.c"
click node_uart_driver "https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/lpuart/lpuart_driver.c"
click node_registers "https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/devices/device_registers.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_main,node_config,node_crc_check,node_fallback,node_result toneBlue
class node_clock_config,node_pin_config,node_crc_config,node_uart_config toneAmber
class node_clock_driver,node_pins_driver,node_crc_driver,node_uart_driver,node_registers toneMint
class node_power,node_terminal,node_leds toneIndigo
```

## Components

### Fallback application

- [Application flow](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c): `src/main.c`
- [Config data](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c): `src/main.c`
- [CRC validation](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c): `src/main.c`
- [Fallback selection](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c): `src/main.c`
- [Status and flag](https://github.com/sumithdani/ancit_project_team_16/blob/main/src/main.c): `src/main.c`

### Board setup

- [Clock setup](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/clock_config.c): `board/clock_config.c`
- [Pin setup](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/pin_mux.c): `board/pin_mux.c`
- [CRC setup](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/peripherals_crc_1.c): `board/peripherals_crc_1.c`
- [UART setup](https://github.com/sumithdani/ancit_project_team_16/blob/main/board/peripherals_lpuart_1.c): `board/peripherals_lpuart_1.c`

### Peripheral drivers

- [Clock driver](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/clock/S32K1xx/clock_S32K1xx.c): `SDK/platform/drivers/src/clock/S32K1xx/clock_S32K1xx.c`
- [Pins driver](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/pins/pins_driver.c): `SDK/platform/drivers/src/pins/pins_driver.c`
- [CRC driver](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/crc/crc_driver.c): `SDK/platform/drivers/src/crc/crc_driver.c`
- [LPUART driver](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/drivers/src/lpuart/lpuart_driver.c): `SDK/platform/drivers/src/lpuart/lpuart_driver.c`
- [Device registers](https://github.com/sumithdani/ancit_project_team_16/blob/main/SDK/platform/devices/device_registers.h): `SDK/platform/devices/device_registers.h`

### Other components

- **Board startup**
- **PuTTY terminal**
- **On-board LEDs**

## Connections

- Board startup → Application flow: starts (evidence: `README.md`)
- Application flow → Clock setup: initializes clock (evidence: `README.md`)
- Application flow → Pin setup: initializes pins (evidence: `README.md`)
- Application flow → CRC setup: initializes CRC (evidence: `README.md`)
- Application flow → UART setup: initializes UART (evidence: `README.md`)
- Clock setup → Clock driver: configures
- Pin setup → Pins driver: configures (evidence: `board/pin_mux.c`)
- CRC setup → CRC driver: configures
- UART setup → LPUART driver: configures
- Application flow → Config data: checks block (evidence: `README.md`)
- Application flow → CRC validation: calculates CRC (evidence: `README.md`)
- CRC validation → CRC driver: uses CRC peripheral (evidence: `README.md`)
- Application flow → Fallback selection: selects data (evidence: `README.md`)
- Fallback selection → Config data: loads NvM or defaults (evidence: `README.md`)
- Fallback selection → Status and flag: sets flag and status (evidence: `README.md`)
- Application flow → LPUART driver: sends result (evidence: `README.md`)
- LPUART driver → PuTTY terminal: transmits (evidence: `README.md`)
- Application flow → On-board LEDs: indicates result (evidence: `README.md`)
- Clock driver → Device registers: accesses hardware (evidence: `SDK/platform/drivers/src/clock/S32K1xx/clock_S32K1xx.c`)
- Pins driver → Device registers: accesses hardware (evidence: `SDK/platform/drivers/src/pins/pins_driver.c`)
