How to read and write MIFARE Ultralight pages with PN7150

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to read and write MIFARE Ultralight pages with PN7150

跳至解决方案
2,792 次查看
owenl
Contributor I

I am looking for the command sequence to read/write MIFARE Ultralight pages with a PN7150. I'm struggling with the PN7150 user manual - I see a sequence diagram for MIFARE Classic (with authentication) but not for the MIFARE Ultralight. Can anyone enlighten me or point to some sample code.

(The DH is a micro-controller running FreeRTOS)

0 项奖励
回复
1 解答
2,778 次查看
owenl
Contributor I

Answering myself. Something along the lines of:

uint8_t ReadPage[] = {0x00, 0x00, 0x02, 0x30, page};
esp_err_t err = i2c_manager_write(port_, deviceAddress_, I2C_NO_REG, ReadPage, sizeof(ReadPage));
 
Send the 3 byte header and 2 byte payload - (0x30 == READ cmd) and page number. Then handle the returned CORE_CONN_CREDITS_NTF followed by the NCI_DATA_MSG response containing 16 bytes starting from the page address.

在原帖中查看解决方案

1 回复
2,779 次查看
owenl
Contributor I

Answering myself. Something along the lines of:

uint8_t ReadPage[] = {0x00, 0x00, 0x02, 0x30, page};
esp_err_t err = i2c_manager_write(port_, deviceAddress_, I2C_NO_REG, ReadPage, sizeof(ReadPage));
 
Send the 3 byte header and 2 byte payload - (0x30 == READ cmd) and page number. Then handle the returned CORE_CONN_CREDITS_NTF followed by the NCI_DATA_MSG response containing 16 bytes starting from the page address.