refactor: de-ALM Ntag5Boost, seed NTA5332 ALM config defaults

Document ALM as analog-only with no command surface, and seed config blocks 0x40-0x44 with the NTA5332 datasheet Rev 3.4 Table 76 defaults (ALM_CONF/ALM_LUT) so a client reading config memory sees the same bytes a real NTA5332 returns.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
michael
2026-07-03 11:30:12 -07:00
parent 4be8100cb6
commit 8f0da9640c

View File

@@ -1,23 +1,43 @@
"""NTAG 5 Boost (NTA5332) — compact I2C bridge with ALM and AES. """NTAG 5 Boost (NTA5332) — compact I2C bridge, AES always enabled.
NTAG 5 Link + Active Load Modulation + AES always enabled. NXP NTA5332: same NFC Type 5 / ISO 15693 protocol, memory layout, and
Same memory layout and I2C interface as Link NTP5332. I2C interface as NTAG 5 Link NTP5332, but with AES permanently enabled.
512 user blocks (2048 bytes) + 256-byte SRAM + config memory. 512 user blocks (2048 bytes) + 256-byte SRAM + config memory.
ALM (Active Load Modulation) is an RF modulation technique that At the command layer it is indistinguishable from a Link NTP5332 with AES
reduces antenna size without compromising read range. It has no on — there are no ALM-specific commands. The physical NTA5332 adds Active
protocol-level impact — the sim model is identical to Link NTP5332. Load Modulation (an analog TX technique for smaller antennas) configured
purely through config-memory blocks 0x40-0x44 (ALM_CONF/ALM_LUT). ALM has
no protocol impact and nothing to simulate, but we seed those blocks with
the datasheet default content so a client reading config memory sees the
same bytes a real NTA5332 returns.
""" """
from __future__ import annotations from __future__ import annotations
from .ntag5_link import Ntag5LinkTag from .ntag5_link import Ntag5LinkTag
# ALM config-memory defaults (NTA5332 datasheet Rev 3.4, Table 76).
# Analog driver tuning only (field-detect threshold, phase offset, ALM LUT)
# with no protocol behavior — present so a config dump of the sim matches a
# real NTA5332. block -> 4 bytes.
_ALM_CONFIG_DEFAULTS = {
0x40: bytes((0x81, 0xFC, 0x5E, 0xCF)), # ALM_CONF_00..03
0x41: bytes((0x1F, 0x1F, 0x17, 0x14)), # ALM_LUT_00..03
0x42: bytes((0x13, 0x13, 0x12, 0x12)), # ALM_LUT_04..07
0x43: bytes((0x10, 0x10, 0xF0, 0xF0)), # ALM_LUT_08..11
0x44: bytes((0xF0, 0xF0, 0xF0, 0xF0)), # ALM_LUT_12..15
}
class Ntag5BoostTag(Ntag5LinkTag): class Ntag5BoostTag(Ntag5LinkTag):
"""NTAG 5 Boost transponder (NTA5332). """NTAG 5 Boost (NTA5332) = Link NTP5332 with AES always enabled.
= NTAG 5 Link NTP5332 + ALM. AES always enabled. ALM is analog-only and has no command surface; the ALM config blocks
(0x40-0x44) are seeded with datasheet defaults so a config dump of the
sim matches a real NTA5332 for client-application testing.
""" """
def __init__(self, uid: bytes | str | None = None, **kwargs): def __init__(self, uid: bytes | str | None = None, **kwargs):
super().__init__(uid=uid, aes_capable=True, **kwargs) super().__init__(uid=uid, aes_capable=True, **kwargs)
for block, data in _ALM_CONFIG_DEFAULTS.items():
self._config_memory[block * 4 : block * 4 + 4] = data