M5Unit-NFC 0.1.0 git rev:93745b5
Loading...
Searching...
No Matches
nfcf.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
10#ifndef M5_UNIT_UNIFIED_NFC_NFC_F_NFCF_HPP
11#define M5_UNIT_UNIFIED_NFC_NFC_F_NFCF_HPP
12
13#include "nfc/nfc.hpp"
14#include <cstdint>
15#include <string>
16#include <array>
17
18namespace m5 {
19namespace nfc {
24namespace f {
25
30enum class Type : uint8_t {
31 Unknown,
36 // FeliCaLink, //!< Link
37};
38
44inline m5::nfc::NFCForumTag get_nfc_forum_tag_type(const Type t)
45{
46 return (t != Type::Unknown) ? NFCForumTag::Type3 : NFCForumTag::None;
47}
48
51using Format = uint8_t;
52constexpr Format format_nfcip1{0x0001};
53constexpr Format format_lite{0x0002};
54constexpr Format format_private{0x0004};
55constexpr Format format_ndef{0x0008};
56constexpr Format format_shared{0x0010};
57constexpr Format format_secure{0x0020};
58constexpr Format format_felica_plug{0x0040};
60
65enum class CommandCode : uint8_t {
66 Polling,
67 RequestService = 0x02,
68 RequestResponse = 0x04,
69 ReadWithoutEncryption = 0x06,
70 WriteWithoutEncryption = 0x08,
71 RequestSystemCode = 0x0C,
72};
73
78enum class ResponseCode : uint8_t {
79 Polling = 0x01,
80 RequestService = 0x03,
81 RequestResponse = 0x05,
82 ReadWithoutEncryption = 0x07,
83 WriteWithoutEncryption = 0x09,
84 RequestSystemCode = 0x0D,
85};
86
89constexpr uint16_t system_code_wildcard{0xFFFF};
90constexpr uint16_t system_code_ndef{0x12FC};
91constexpr uint16_t system_code_felica_secure_id{0x957A};
92constexpr uint16_t system_code_shared{0xFE00};
93constexpr uint16_t system_code_lite{0x88B4};
94constexpr uint16_t system_code_felica_plug{0xFEE1};
96
101enum class RequestCode : uint8_t {
102 None,
103 SystemCode,
105};
106
111enum class TimeSlot : uint8_t { Slot1, Slot2, Slot4 = 0x03, Slot8 = 0x07, Slot16 = 0x0F };
112
118inline constexpr uint8_t timeslot_to_slot(const TimeSlot ts)
119{
120 return (ts == TimeSlot::Slot16) ? 16
121 : (ts == TimeSlot::Slot8) ? 8
122 : (ts == TimeSlot::Slot4) ? 4
123 : (ts == TimeSlot::Slot2) ? 2
124 : (ts == TimeSlot::Slot1) ? 1
125 : 0; // Illegal
126}
127
130// Random service
131constexpr uint16_t service_random_read_write_auth{0x0008};
132constexpr uint16_t service_random_read_write{0x0009};
133constexpr uint16_t service_random_read_auth{0x000A};
134constexpr uint16_t service_random_read{0x000B};
135// Cyclic service
136constexpr uint16_t service_cyclic_read_write_auth{0x000C};
137constexpr uint16_t service_cyclic_read_write{0x000D};
138constexpr uint16_t service_cyclic_read_auth{0x000E};
139constexpr uint16_t service_cyclic_read{0x000F};
140// Parse service
141constexpr uint16_t service_parse_direct_auth{0x0100};
142constexpr uint16_t service_parse_direct{0x0101};
143constexpr uint16_t service_parse_cacheback_auth{0x0102};
144constexpr uint16_t service_parse_cacheback{0x0103};
145constexpr uint16_t service_parse_decrement_auth{0x0104};
146constexpr uint16_t service_parse_decrement{0x0105};
147constexpr uint16_t service_parse_increment_auth{0x0106};
148constexpr uint16_t service_parse_increment{0x0107};
150
155struct block_t {
156 uint8_t pad{};
157 uint8_t header{};
158 uint16_t number{};
159
160 inline constexpr block_t() : block_t(0)
161 {
162 }
163
170 inline constexpr block_t(const uint16_t num, const uint8_t access = 0, const uint8_t order = 0)
171 : header{(uint8_t)(((num > 0xFF) ? 0x00 : 0x80) | ((access & 0x07) << 4) | (order & 0x0F))}, number{num}
172 {
173 }
174
180 static block_t from(const uint8_t v[3])
181 {
182 block_t b{0xFFFFu};
183 if (v) {
184 b.header = v[0];
185 b.number = v[1];
186 if (b.is_3byte()) {
187 b.number |= (uint16_t)v[2] << 8;
188 }
189 }
190 return b;
191 }
192
197 inline constexpr bool is_2byte() const
198 {
199 return (header & 0x80) != 0;
200 }
205 inline constexpr bool is_3byte() const
206 {
207 return (header & 0x80) == 0;
208 }
213 inline constexpr uint8_t access_mode() const
214 {
215 return (header >> 4) & 0x07;
216 }
221 inline constexpr uint8_t order() const
222 {
223 return (header & 0x0F);
224 }
229 inline constexpr uint16_t block() const
230 {
231 return number;
232 }
233
238 inline void block(const uint16_t num)
239 {
240 number = num;
241 header = (header & ~0x80) | (num > 0xFF ? 0x00 : 0x80);
242 }
247 inline void access_mode(const uint8_t a)
248 {
249 header = (header & ~(0x07 << 4)) | ((a & 0x07) << 4);
250 }
255 inline void order(const uint8_t o)
256 {
257 header = (header & ~0x0F) | (o & 0x0F);
258 }
259
264 inline operator uint16_t() const
265 {
266 return block();
267 }
268
274 uint8_t store(uint8_t buf[3]) const
275 {
276 uint8_t idx{};
277 buf[idx++] = header;
278 buf[idx++] = number & 0xFF;
279 if (is_3byte()) {
280 buf[idx++] = number >> 8;
281 }
282 return idx;
283 }
284};
285
290namespace standard {
295enum class Mode : uint8_t {
296 Mode0,
297 Mode1,
298 Mode2,
299 Mode3,
300
301};
302} // namespace standard
303
308namespace lite {
310
313constexpr block_t S_PAD0{0x00};
314constexpr block_t S_PAD1{0x01};
315constexpr block_t S_PAD2{0x02};
316constexpr block_t S_PAD3{0x03};
317constexpr block_t S_PAD4{0x04};
318constexpr block_t S_PAD5{0x05};
319constexpr block_t S_PAD6{0x06};
320constexpr block_t S_PAD7{0x07};
321constexpr block_t S_PAD8{0x08};
322constexpr block_t S_PAD9{0x09};
323constexpr block_t S_PAD10{0x0A};
324constexpr block_t S_PAD11{0x0B};
325constexpr block_t S_PAD12{0X0C};
326constexpr block_t S_PAD13{0x0D};
327constexpr block_t REG{0x0E};
328constexpr block_t RC{0x80};
329constexpr block_t MAC{0x81};
330constexpr block_t ID{0x082};
331constexpr block_t D_ID{0x83};
332constexpr block_t SER_C{0x84};
333constexpr block_t SYS_C{0x85};
334constexpr block_t CKV{0x86};
335constexpr block_t CK{0x87};
336constexpr block_t MC{0x88};
338
339} // namespace lite
340
345namespace lite_s {
346
351enum class Mode : uint8_t {
352 Mode00,
353 Mode01,
354 Mode10,
355 Mode11,
356};
357
360constexpr block_t S_PAD0{0x00}; // Same as Lite
361constexpr block_t S_PAD1{0x01}; // Same as Lite
362constexpr block_t S_PAD2{0x02}; // Same as Lite
363constexpr block_t S_PAD3{0x03}; // Same as Lite
364constexpr block_t S_PAD4{0x04}; // Same as Lite
365constexpr block_t S_PAD5{0x05}; // Same as Lite
366constexpr block_t S_PAD6{0x06}; // Same as Lite
367constexpr block_t S_PAD7{0x07}; // Same as Lite
368constexpr block_t S_PAD8{0x08}; // Same as Lite
369constexpr block_t S_PAD9{0x09}; // Same as Lite
370constexpr block_t S_PAD10{0x0A}; // Same as Lite
371constexpr block_t S_PAD11{0x0B}; // Same as Lite
372constexpr block_t S_PAD12{0X0C}; // Same as Lite
373constexpr block_t S_PAD13{0x0D}; // Same as Lite
374constexpr block_t REG{0x0E}; // Same as Lite
375constexpr block_t RC{0x80}; // Same as Lite
376constexpr block_t MAC{0x81}; // Same as Lite
377constexpr block_t ID{0x082}; // Same as Lite
378constexpr block_t D_ID{0x83}; // Same as Lite
379constexpr block_t SER_C{0x84}; // Same as Lite
380constexpr block_t SYS_C{0x85}; // Same as Lite
381constexpr block_t CKV{0x86}; // Same as Lite
382constexpr block_t CK{0x87}; // Same as Lite
383constexpr block_t MC{0x88}; // Same as Lite
384constexpr block_t WCNT{0x90};
385constexpr block_t MAC_A{0x91};
386constexpr block_t STATE{0x92};
387constexpr block_t CRC_CHECK{0xA0};
389
390} // namespace lite_s
391
397uint16_t get_maximum_block(const Type t);
403uint16_t get_number_of_user_blocks(const Type t);
409inline uint16_t get_user_area_size(const Type t)
410{
411 return 16 * get_number_of_user_blocks(t);
412}
418uint16_t get_first_user_block(const Type t);
424uint16_t get_last_user_block(const Type t);
431inline bool is_user_block(const Type t, const uint16_t block)
432{
433 return (block >= get_first_user_block(t)) && (block <= get_last_user_block(t));
434}
440uint8_t get_maximum_read_blocks(const Type t);
446uint8_t get_maximum_write_blocks(const Type t);
447
453bool is_read_only_lite(const block_t block);
459bool is_read_only_lite_s(const block_t block);
465bool can_read_lite(const block_t block);
471bool can_read_lite_s(const block_t block);
472
475constexpr uint16_t NODE_SYSTEM_KEY{0xFFFF};
476constexpr uint16_t KEY_VERSION_NONE{0xFFFF};
479
480constexpr uint8_t FELICA_ID_LENGTH{8};
481constexpr uint8_t FELICA_MAX_BLOCKS{8};
482constexpr uint16_t FELICA_MAX_PACKET_LENGTH_REQUEST_SERVICE{1 + 8 + 1 + 2 * 255};
483constexpr uint16_t FELICA_MAX_PACKET_LENGTH_REQUEST_RESPONSE{1 + 8 + 1};
484constexpr uint16_t FELICA_MAX_PACKET_LENGTH_REQUEST_SYSTEM_CODE{1 + 8 + 1 + 2 * 255};
485
490struct PICC {
491 union {
492 uint8_t m[16]{};
493 struct {
494 uint8_t idm[FELICA_ID_LENGTH];
495 uint8_t pmm[FELICA_ID_LENGTH];
496 };
497 };
498 uint16_t request_data{};
502 uint8_t _pad{}; // padding
503 uint16_t dfc_format{};
504 uint16_t emulation_sc{};
505
507 bool valid() const;
509 bool validEmulation() const;
510
515 inline uint16_t userAreaSize() const
516 {
517 return valid() ? get_user_area_size(type) : 0;
518 }
523 inline uint16_t firstUserBlock() const
524 {
525 return valid() ? get_first_user_block(type) : 0xFFFF;
526 }
531 inline uint16_t lastUserBlock() const
532 {
533 return valid() ? get_last_user_block(type) : 0xFFFF;
534 }
540 inline bool isUserBlock(const block_t block) const
541 {
542 return is_user_block(type, block);
543 }
544
549 inline uint8_t maximumReadBlocks() const
550 {
552 }
557 inline uint8_t maximumWriteBlocks() const
558 {
560 }
561
567 inline bool checkFormat(const Format f) const
568 {
569 return (format & f) != 0;
570 }
575 inline bool supportsNDEF() const
576 {
577 return checkFormat(format_ndef);
578 }
579
585 {
586 return get_nfc_forum_tag_type(type);
587 }
588
597 bool emulate(const Type t, const uint8_t idm[FELICA_ID_LENGTH], const uint8_t pmm[FELICA_ID_LENGTH],
598 const uint16_t sc = 0);
599
601 std::string idmAsString() const;
603 std::string pmmAsString() const;
605 std::string typeAsString() const;
606};
607
614bool operator==(const PICC& a, const PICC& b);
621inline bool operator!=(const PICC& a, const PICC& b)
622{
623 return !(a == b);
624}
625
628// constexpr uint32_t TIMEOUT_POLLING{3};
629constexpr uint32_t TIMEOUT_POLLING{5};
630constexpr uint32_t TIMEOUT_POLLING_PICC{2}; // 2 ms per PICC
631
636union REG {
637 uint8_t reg[16]{};
638 struct {
639 uint8_t reg_a[4]; // RegA (LE)
640 uint8_t reg_b[4]; // RegB (LE)
641 uint8_t reg_c[8]; // RegC (BE)
642 } __attribute__((packed));
643
644 REG()
645 {
646 }
647
649 inline uint32_t regA() const
650 {
651 return ((uint32_t)reg_a[3] << 24) | ((uint32_t)reg_a[2] << 16) | ((uint32_t)reg_a[1] << 8) |
652 ((uint32_t)reg_a[0]);
653 }
655 inline uint32_t regB() const
656 {
657 return ((uint32_t)reg_b[3] << 24) | ((uint32_t)reg_b[2] << 16) | ((uint32_t)reg_b[1] << 8) |
658 ((uint32_t)reg_b[0]);
659 }
661 inline uint64_t regC() const
662 {
663 return ((uint64_t)reg_c[0] << 56) | ((uint64_t)reg_c[1] << 48) | ((uint64_t)reg_c[2] << 40) |
664 ((uint64_t)reg_c[3] << 32) | ((uint64_t)reg_c[4] << 24) | ((uint64_t)reg_c[5] << 16) |
665 ((uint64_t)reg_c[6] << 8) | ((uint64_t)reg_c[7]);
666 }
668 void regA(const uint32_t v)
669 {
670 reg_a[0] = v & 0xFF;
671 reg_a[1] = v >> 8;
672 reg_a[2] = v >> 16;
673 reg_a[3] = v >> 24;
674 }
676 void regB(const uint32_t v)
677 {
678 reg_b[0] = v & 0xFF;
679 reg_b[1] = v >> 8;
680 reg_b[2] = v >> 16;
681 reg_b[3] = v >> 24;
682 }
684 void regC(const uint64_t v)
685 {
686 reg_c[7] = v & 0xFF;
687 reg_c[6] = v >> 8;
688 reg_c[5] = v >> 16;
689 reg_c[4] = v >> 24;
690 reg_c[3] = v >> 32;
691 reg_c[2] = v >> 40;
692 reg_c[1] = v >> 48;
693 reg_c[0] = v >> 56;
694 }
695
696 inline operator const uint8_t*() const
697 {
698 return reg;
699 }
700 inline operator uint8_t*()
701 {
702 return reg;
703 }
704} __attribute__((packed));
705
712inline bool can_write_reg(const REG& o, const REG& n)
713{
714 return (o.regA() >= n.regA()) && (o.regB() >= n.regB());
715}
716
719
726bool make_session_key(uint8_t sk[16], const uint8_t ck[16], const uint8_t rc[16]);
727
740bool generate_mac(uint8_t mac[8], const uint8_t* plain, uint32_t plain_len, const uint8_t* block_data,
741 uint32_t block_len, const uint8_t sk1[8], const uint8_t sk2[8], const uint8_t rc[16]);
742
750bool make_personalized_card_key_lite_s(uint8_t card_key[16], const uint8_t master_key[24], const uint8_t id_block[16]);
751
753
754} // namespace f
755} // namespace nfc
756} // namespace m5
757#endif
NFC-A definitions.
NFC-B definitions.
NFC-F definitions.
For FeliCa Lite-S.
For FeliCa Lite.
Top level namespace of M5Stack.
NFC related definitions.
For FeliCa Standard.
NFC-V definitions.
NFC definitions.
NFCForumTag
NFC Forum Tag Type.
Definition nfc.hpp:39
uint16_t get_number_of_user_blocks(const Type t)
Gets the number of user blocks.
Definition nfca.cpp:327
uint8_t get_maximum_write_blocks(const Type t)
Maximum number of blocks that can be write simultaneously.
Definition nfcf.cpp:112
uint16_t get_maximum_block(const Type t)
Gets the maximum block.
Definition nfcf.cpp:80
uint8_t get_maximum_read_blocks(const Type t)
Maximum number of blocks that can be read simultaneously.
Definition nfcf.cpp:106
constexpr uint32_t TIMEOUT_POLLING
Is the new value writable?
Definition nfcf.hpp:629
TimeSlot
Timeslot value for Polling.
Definition nfcf.hpp:111
constexpr uint16_t service_parse_cacheback_auth
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:143
constexpr uint16_t service_random_read_write
Random,Read/write,No authentication required (S, L, LS)
Definition nfcf.hpp:132
constexpr Format format_private
Has private area.
Definition nfcf.hpp:54
constexpr uint16_t system_code_shared
Shared area.
Definition nfcf.hpp:92
constexpr Format format_shared
Has shared area.
Definition nfcf.hpp:56
constexpr uint16_t service_parse_cacheback
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:144
constexpr uint16_t service_parse_decrement_auth
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:145
ResponseCode
NFC-F Response code.
Definition nfcf.hpp:78
constexpr uint16_t service_random_read_write_auth
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:131
constexpr uint16_t system_code_felica_plug
FeliCa Plug.
Definition nfcf.hpp:94
constexpr uint32_t TIMEOUT_POLLING_PICC
Is the new value writable?
Definition nfcf.hpp:630
constexpr uint16_t service_parse_increment_auth
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:147
constexpr uint16_t service_random_read_auth
Random,Read only,No authentication required (S)
Definition nfcf.hpp:133
CommandCode
NFC-F Command code.
Definition nfcf.hpp:65
bool can_write_reg(const REG &o, const REG &n)
Is the new value writable?
Definition nfcf.hpp:712
Mode
Mode for Standard.
Definition nfcf.hpp:295
@ Mode2
After mutual authentication is complete (Auth2)
@ Mode0
Power was supplied to the PICC.
@ Mode1
Certification for PICC has been completed (Auth1)
@ Mode3
After registering area services or executing system partitioning.
Type
Type of the PICC.
Definition nfcf.hpp:30
@ FeliCaLiteS
Lite-S.
@ FeliCaStandard
Standard.
constexpr Format format_felica_plug
FeliCa Plug.
Definition nfcf.hpp:58
constexpr uint16_t service_cyclic_read_write_auth
Cyclic,Read/write,Authentication required(S)
Definition nfcf.hpp:136
constexpr uint16_t service_parse_direct_auth
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:141
Mode
Mode for LiteS.
Definition nfcf.hpp:351
@ Mode11
External authentication complete, polling response not possible.
@ Mode10
External authentication complete, polling response possible.
@ Mode00
External authentication incomplete, polling response possible.
@ Mode01
External authentication incomplete, polling response not possible.
constexpr uint16_t KEY_VERIOSN_NONE
Definition nfcf.hpp:477
constexpr uint8_t timeslot_to_slot(const TimeSlot ts)
TimeSlot to the number of the slot.
Definition nfcf.hpp:118
constexpr uint16_t service_parse_direct
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:142
constexpr Format format_secure
FeliCa Secure ID.
Definition nfcf.hpp:57
constexpr uint16_t service_random_read
Random,Read only,No authentication required (S,LS)
Definition nfcf.hpp:134
constexpr Format format_nfcip1
Support ISO/IEC18092.
Definition nfcf.hpp:52
RequestCode
Request code for Polling.
Definition nfcf.hpp:101
@ SystemCode
Request system code.
@ CommunicationPerformance
Request communication performance.
uint8_t Format
Support ISO/IEC18092.
Definition nfcf.hpp:51
constexpr uint16_t system_code_ndef
NDEF.
Definition nfcf.hpp:90
constexpr uint16_t service_cyclic_read_auth
Cyclic,Read only,Authentication required(S)
Definition nfcf.hpp:138
constexpr Format format_ndef
Support NDEF.
Definition nfcf.hpp:55
constexpr uint16_t service_cyclic_read_write
Cyclic,Read/write,No authentication required(S)
Definition nfcf.hpp:137
constexpr uint16_t system_code_felica_secure_id
FeliCa secure ID.
Definition nfcf.hpp:91
constexpr uint16_t service_cyclic_read
Cyclic,Read only,No authentication required(S)
Definition nfcf.hpp:139
constexpr uint16_t service_parse_decrement
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:146
constexpr uint16_t system_code_wildcard
Wildcard.
Definition nfcf.hpp:89
constexpr uint16_t NODE_SYSTEM_KEY
Retrieving the System Key Version.
Definition nfcf.hpp:475
constexpr uint16_t system_code_lite
Lite, Lite-S.
Definition nfcf.hpp:93
constexpr uint16_t service_parse_increment
Random,Read/write,Authentication required (S)
Definition nfcf.hpp:148
constexpr uint16_t KEY_VERSION_NONE
No key version exists.
Definition nfcf.hpp:476
constexpr Format format_lite
Lite or Lite-S.
Definition nfcf.hpp:53
PICC information for NFC-F.
Definition nfcf.hpp:490
NFCForumTag nfcForumTagType() const
NFC ForumTag.
Definition nfcf.hpp:584
uint16_t userAreaSize() const
Total user area size.
Definition nfcf.hpp:515
std::string typeAsString() const
Gets the type string.
Definition nfcf.cpp:334
bool supportsNDEF() const
Supports NDEF?
Definition nfcf.hpp:575
uint16_t dfc_format
DFC format ID:0x82[8,9] BE if format include DFC.
Definition nfcf.hpp:503
bool validEmulation() const
Valid for emulation?
Definition nfcf.cpp:318
Format format
Format type group bits.
Definition nfcf.hpp:501
uint16_t lastUserBlock() const
Gets the last user block.
Definition nfcf.hpp:531
uint8_t idm[FELICA_ID_LENGTH]
Manufacture ID.
Definition nfcf.hpp:494
RequestCode request_code
Type of the request_data.
Definition nfcf.hpp:499
std::string pmmAsString() const
Gets the PMm string.
Definition nfcf.cpp:329
bool checkFormat(const Format f) const
Check format.
Definition nfcf.hpp:567
uint8_t pmm[FELICA_ID_LENGTH]
Manufacture Parameter.
Definition nfcf.hpp:495
uint8_t maximumWriteBlocks() const
Maximum number of blocks that can be write simultaneously.
Definition nfcf.hpp:557
bool emulate(const Type t, const uint8_t idm[FELICA_ID_LENGTH], const uint8_t pmm[FELICA_ID_LENGTH], const uint16_t sc=0)
Emulation settings.
Definition nfcf.cpp:340
uint16_t request_data
Any request data if exists.
Definition nfcf.hpp:498
uint16_t firstUserBlock() const
Gets the first user block.
Definition nfcf.hpp:523
Type type
PICC Type.
Definition nfcf.hpp:500
uint8_t maximumReadBlocks() const
Maximum number of blocks that can be read simultaneously.
Definition nfcf.hpp:549
bool isUserBlock(const block_t block) const
Is user block?
Definition nfcf.hpp:540
std::string idmAsString() const
Gets the IDm string.
Definition nfcf.cpp:324
uint16_t emulation_sc
System code for emulation.
Definition nfcf.hpp:504
bool valid() const
Valid for detection?
Definition nfcf.cpp:310
Block list element.
Definition nfcf.hpp:155
uint16_t number
block number (using low byte if 2 byte mode)
Definition nfcf.hpp:158
static block_t from(const uint8_t v[3])
Construct from encoded block list element.
Definition nfcf.hpp:180
void block(const uint16_t num)
Set block number.
Definition nfcf.hpp:238
constexpr uint8_t order() const
Gets service order.
Definition nfcf.hpp:221
constexpr block_t(const uint16_t num, const uint8_t access=0, const uint8_t order=0)
Construct from block number, access mode, and service order.
Definition nfcf.hpp:170
uint8_t header
size:1 access:3 order:4
Definition nfcf.hpp:157
constexpr bool is_2byte() const
Is 2-byte block list element?
Definition nfcf.hpp:197
constexpr uint16_t block() const
Gets block number.
Definition nfcf.hpp:229
constexpr uint8_t access_mode() const
Gets access mode bits.
Definition nfcf.hpp:213
void access_mode(const uint8_t a)
Set access mode bits.
Definition nfcf.hpp:247
uint8_t store(uint8_t buf[3]) const
Store encoded block list element.
Definition nfcf.hpp:274
void order(const uint8_t o)
Set service order.
Definition nfcf.hpp:255
constexpr bool is_3byte() const
Is 3-byte block list element?
Definition nfcf.hpp:205
Subtract Register Block Data.
Definition nfcf.hpp:636
uint64_t regC() const
Gets the RegC.
Definition nfcf.hpp:661
void regC(const uint64_t v)
Set the RegC.
Definition nfcf.hpp:684
void regB(const uint32_t v)
Set the RegB.
Definition nfcf.hpp:676
void regA(const uint32_t v)
Set the RegA.
Definition nfcf.hpp:668
uint32_t regA() const
Gets the RegA.
Definition nfcf.hpp:649
uint32_t regB() const
Gets the RegB.
Definition nfcf.hpp:655