# vouch-opensource/zephyr-nfc08a1 architecture

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

- Interactive diagram: https://gitdiagram.com/vouch-opensource/zephyr-nfc08a1
- Repository: https://github.com/vouch-opensource/zephyr-nfc08a1

## Overview

This is Zephyr firmware for the X-NUCLEO-NFC08A1. Its main workflow initializes the NFC demo, repeatedly runs its discovery cycle, and demonstrates interactions with detected NFC devices; the README says SPI is the default, with I2C available through hardware and software reconfiguration. The code also includes card-emulation handlers and a chip register configuration table. The excerpts show the main loop and protocol examples, but not every dispatch or the configuration table’s runtime use, so those links are omitted or marked unverified.

Main entry points: [`apps/nfc08a1/src/demo_polling.c`](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_polling.c) (Discovery and polling), [`apps/nfc08a1/src/main.c`](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/main.c) (Main loop), [`apps/nfc08a1/src/demo_ce.c`](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_ce.c) (Card emulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Firmware runtime"]
  node_firmware["Main loop<br/>[main.c]"]
end

subgraph group_nfc["NFC capabilities"]
  node_polling["Discovery and polling<br/>[demo_polling.c]"]
  node_tagdemo["Tag protocol demos<br/>[demo_polling.c]"]
  node_cardem["Card emulation<br/>[demo_ce.c]"]
end

subgraph group_chip["Chip configuration"]
  node_analog["RF register table"]
end

node_nfcdevice(("NFC tags/readers"))
node_board["NFC08A1 hardware"]

node_firmware -->|"initializes and cycles"| node_polling
node_polling -->|"discovers devices"| node_nfcdevice
node_tagdemo -->|"exchanges protocols"| node_nfcdevice
node_cardem -.->|"emulates card"| node_nfcdevice
node_board -.->|"supports SPI default"| node_polling

click node_firmware "https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/main.c"
click node_polling "https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_polling.c"
click node_tagdemo "https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_polling.c"
click node_cardem "https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_ce.c"
click node_analog "https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/analogConfigTbl_NFC08A1.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_firmware toneBlue
class node_polling,node_tagdemo,node_cardem toneAmber
class node_analog toneMint
class node_nfcdevice,node_board toneIndigo
```

## Components

### Firmware runtime

- [Main loop](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/main.c): `apps/nfc08a1/src/main.c`

### NFC capabilities

- [Discovery and polling](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_polling.c): `apps/nfc08a1/src/demo_polling.c`
- [Tag protocol demos](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_polling.c): `apps/nfc08a1/src/demo_polling.c`
- [Card emulation](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/demo_ce.c): `apps/nfc08a1/src/demo_ce.c`

### Chip configuration

- [RF register table](https://github.com/vouch-opensource/zephyr-nfc08a1/blob/main/apps/nfc08a1/src/analogConfigTbl_NFC08A1.c): `apps/nfc08a1/src/analogConfigTbl_NFC08A1.c`

### Other components

- **NFC tags/readers**
- **NFC08A1 hardware**

## Connections

- Main loop → Discovery and polling: initializes and cycles (evidence: `apps/nfc08a1/src/main.c`)
- Discovery and polling → NFC tags/readers: discovers devices (evidence: `apps/nfc08a1/src/demo_polling.c`)
- Tag protocol demos → NFC tags/readers: exchanges protocols (evidence: `apps/nfc08a1/src/demo_polling.c`)
- Card emulation → NFC tags/readers: emulates card
- NFC08A1 hardware → Discovery and polling: supports SPI default (evidence: `README.md`)
