Skip to content

Commit

Permalink
Fix "show_registers" Register Address for ST25R3916 Registers space B
Browse files Browse the repository at this point in the history
  • Loading branch information
bvernoux committed Aug 10, 2021
1 parent 9db3eab commit 7457e10
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/hydranfc_v2/hydranfc_v2_nfc_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,26 @@ static void show_registers(t_hydra_console *con)
ReturnCode err;
unsigned int i;
t_st25r3916Regs regDump;
/* Translation of Reg Space B index to real register address */
const uint8_t reg_space_b_idx_to_addr[ST25R3916_SPACE_B_REG_LEN] =
{
0x05, // Index 0
0x06, // Index 1
0x0B, // Index 2
0x0C, // Index 3
0x0D, // Index 4
0x0F, // Index 5
0x15, // Index 6
0x28, // Index 7
0x29, // Index 8
0x2A, // Index 9
0x2B, // Index 10
0x2C, // Index 11
0x30, // Index 12
0x31, // Index 13
0x32, // Index 14
0x33 // Index 15
};

err = st25r3916GetRegsDump(&regDump);
if(err != ERR_NONE) {
Expand All @@ -1002,7 +1022,7 @@ static void show_registers(t_hydra_console *con)
/* ST25R3916 space B */
cprintf(con, "ST25R3916 Registers space B:\r\n");
for (i = 0; i < ST25R3916_SPACE_B_REG_LEN; i++) {
cprintf(con, "0x%02x\t: 0x%02x\r\n", i, regDump.RsB[i]);
cprintf(con, "0x%02x\t: 0x%02x\r\n", reg_space_b_idx_to_addr[i], regDump.RsB[i]);
}
}

Expand Down

0 comments on commit 7457e10

Please sign in to comment.