Hello Nobby,
The example was not part of a bigger code block.
Data is interchanged with NFC by writing to and reading from a RAM-like buffer. Words written to this buffer will show up in NFC page reads, NFC page writes update the value in the buffer, which can be read by the ARM.
To write to the NFC memory at the lowest level (so NOT using NDEF messages), you need to:
1) enable the RAM overlay by writing 0 to the NFC CFG register: NSS_NFC->CFG = 0x0;
In this mode an uint32_t buffer, accessible via NSS_NFC->BUF, is mapped to NFC engine..
There is an offset of 4, for instance page 4 at the NFC side corresponds to location 0 in the buffer at the ARM side.
2) write the uint32_t value you want to make accessible via NFC to the overlay buffer: for instance after executing NSS_NFC->BUF[0] = 42; the value 42 will appear when doing an NFC page read of page 4.
3) you can also write a page via NFC, for instance at address P. The data can then be retrieved by the ARM by reading v = NSS_NFC->BUF[P-4];
For multi-page data you probably need some handshake protocol to tell the NFC host when the ARM was written all the data so it can retrieve the message as a whole. When using the NDEF code, this is done by writing an empty block header, then writing all the data behind it, then updating the header with the correct length. The NFC reader only starts reading the full message after the length becomes bigger than 0.
Kind regards,
Patrick