Skip to content

Commit e741037

Browse files
authored
Merge branch 'solosky:develop' into develop
2 parents a487a98 + 0c06cf6 commit e741037

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

fw/application/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ SRC_FILES += \
332332
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/crypto1_helper.c \
333333
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_14a.c \
334334
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf1.c \
335-
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_ntag.c \
335+
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf0_ntag.c \
336336
$(CHAMELEON_ROOT)/application/src/rfid/crc_utils.c \
337337
$(CHAMELEON_ROOT)/application/src/rfid/hex_utils.c \
338338
$(CHAMELEON_ROOT)/application/src/rfid/mf1_crapto1.c \

fw/application/src/app/chameleon/port/tag_helper.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "nrf_log.h"
66
#include "utils2.h"
77
#include <string.h>
8+
#define NFC_TAG_NTAG_DATA_SIZE 4
89

910
const static tag_specific_type_name_t tag_type_names[] = {
1011
{TAG_TYPE_UNDEFINED, "-", "-", 0},
@@ -14,9 +15,17 @@ const static tag_specific_type_name_t tag_type_names[] = {
1415
{TAG_TYPE_MIFARE_2048, "MF 2K", "MiFare 2K", 128 * NFC_TAG_MF1_DATA_SIZE},
1516
{TAG_TYPE_MIFARE_4096, "MF 4K", "MiFare 4K", 256 * NFC_TAG_MF1_DATA_SIZE},
1617
// NTAG series
17-
{TAG_TYPE_NTAG_213, "N213", "NTAG 213", 45 * NFC_TAG_NTAG_DATA_SIZE},
18-
{TAG_TYPE_NTAG_215, "N215", "NTAG 215", 135 * NFC_TAG_NTAG_DATA_SIZE},
19-
{TAG_TYPE_NTAG_216, "N216", "NTAG 216", 231 * NFC_TAG_NTAG_DATA_SIZE},
18+
{TAG_TYPE_NTAG_210, "N210", "NTAG 210", NTAG210_PAGES * NFC_TAG_NTAG_DATA_SIZE},
19+
{TAG_TYPE_NTAG_212, "N212", "NTAG 212", NTAG212_PAGES * NFC_TAG_NTAG_DATA_SIZE},
20+
{TAG_TYPE_NTAG_213, "N213", "NTAG 213", NTAG213_PAGES * NFC_TAG_NTAG_DATA_SIZE},
21+
{TAG_TYPE_NTAG_215, "N215", "NTAG 215", NTAG215_PAGES * NFC_TAG_NTAG_DATA_SIZE},
22+
{TAG_TYPE_NTAG_216, "N216", "NTAG 216", NTAG216_PAGES * NFC_TAG_NTAG_DATA_SIZE},
23+
24+
{TAG_TYPE_MF0ICU1, "ICU1", "MF0ICU1", MF0ICU1_PAGES * NFC_TAG_NTAG_DATA_SIZE},
25+
{TAG_TYPE_MF0ICU2, "ICU2", "MF0ICU2", MF0ICU2_PAGES * NFC_TAG_NTAG_DATA_SIZE},
26+
{TAG_TYPE_MF0UL11,"UL11", "MFOUL11", MF0UL11_PAGES * NFC_TAG_NTAG_DATA_SIZE},
27+
{TAG_TYPE_MF0UL21,"UL21", "MF0UL21", MF0UL21_PAGES * NFC_TAG_NTAG_DATA_SIZE},
28+
2029
};
2130
// typedef enum {
2231
// NFC_TAG_MF1_WRITE_NORMAL = 0u,
@@ -75,9 +84,9 @@ const nfc_tag_14a_coll_res_reference_t *tag_helper_get_active_coll_res_ref() {
7584
// nfc_tag_mf1_information_t *m_tag_information = (nfc_tag_mf1_information_t *)tag_buffer->buffer;
7685
// return &m_tag_information->res_coll;
7786
} else {
78-
// nfc_tag_ntag_information_t *m_tag_information = (nfc_tag_ntag_information_t *)tag_buffer->buffer;
87+
// nfc_tag_mf0_ntag_information_t *m_tag_information = (nfc_tag_mf0_ntag_information_t *)tag_buffer->buffer;
7988
// return &m_tag_information->res_coll;
80-
return get_ntag_coll_res();
89+
return nfc_tag_mf0_ntag_get_coll_res();
8190
}
8291
}
8392

@@ -150,7 +159,7 @@ uint8_t *tag_helper_get_active_tag_memory_data() {
150159
nfc_tag_mf1_information_t *m_tag_information = (nfc_tag_mf1_information_t *)tag_buffer->buffer;
151160
return &m_tag_information->memory;
152161
} else {
153-
nfc_tag_ntag_information_t *m_tag_information = (nfc_tag_ntag_information_t *)tag_buffer->buffer;
162+
nfc_tag_mf0_ntag_information_t *m_tag_information = (nfc_tag_mf0_ntag_information_t *)tag_buffer->buffer;
154163
return &m_tag_information->memory;
155164
}
156165
}
@@ -160,12 +169,12 @@ void tag_helper_generate_uid() {
160169
tag_group_type_t tag_group_type = tag_helper_get_tag_group_type(tag_type);
161170
tag_data_buffer_t *tag_buffer = get_buffer_by_tag_type(tag_type);
162171
if (tag_group_type == TAG_GROUP_NTAG) {
163-
nfc_tag_ntag_information_t *m_tag_information = (nfc_tag_ntag_information_t *)tag_buffer->buffer;
172+
nfc_tag_mf0_ntag_information_t *m_tag_information = (nfc_tag_mf0_ntag_information_t *)tag_buffer->buffer;
164173
uint8_t uuid[7];
165174
ret_code_t err_code = utils_rand_bytes(uuid, sizeof(uuid));
166175
if (err_code == NRF_SUCCESS) {
167176
uuid[0] = 04; // fixed
168-
m_tag_information->memory[0][0] = uuid[0];
177+
m_tag_information->memory[0][0] = uuid[0];
169178
m_tag_information->memory[0][1] = uuid[1];
170179
m_tag_information->memory[0][2] = uuid[2];
171180
// BCC 0 is always equal to UID0 ⊕ UID 1 ⊕ UID 2 ⊕ 0x88

fw/application/src/app/chameleon/port/tag_helper.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef TAG_HELPER_H
22
#define TAG_HELPER_H
33

4-
#include "tag_base_type.h"
54
#include "nfc_14a.h"
5+
#include "nfc_mf0_ntag.h"
66
#include "nfc_mf1.h"
7-
#include "nfc_ntag.h"
7+
#include "tag_base_type.h"
88

99
#define TAG_TYPE_MAX 9
1010
#define TAG_TYPE_HF_MAX 8
@@ -25,7 +25,7 @@ typedef enum {
2525

2626
extern const tag_specific_type_t hf_tag_specific_types[];
2727

28-
const tag_specific_type_name_t* tag_helper_get_tag_type_name(tag_specific_type_t tag_type);
28+
const tag_specific_type_name_t *tag_helper_get_tag_type_name(tag_specific_type_t tag_type);
2929
const nfc_tag_14a_coll_res_reference_t *tag_helper_get_active_coll_res_ref();
3030
tag_specific_type_t tag_helper_get_active_tag_type();
3131
void tag_helper_format_uid(char *buff, uint8_t *uid, uint8_t uid_len);
@@ -39,5 +39,4 @@ uint8_t *tag_helper_get_active_tag_memory_data();
3939

4040
void tag_helper_generate_uid();
4141

42-
4342
#endif

fw/components/chameleon-ultra

fw/components/littlefs

Submodule littlefs updated 67 files

0 commit comments

Comments
 (0)