MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / w25q_read_uid

Function w25q_read_uid

bsp/hc32/tests/test_qspi.c:125–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125void w25q_read_uid(struct rt_qspi_device *device)
126{
127 rt_uint8_t w25x_read_uid = 0x4B; /* 命令 */
128 rt_uint8_t u8UID[8] = {0};
129 rt_uint8_t txBuf[5] = {0};
130
131 rt_memset(txBuf, 0xFF, 5);
132 txBuf[0] = w25x_read_uid;
133
134 if (8 != rt_qspi_send_then_recv(device, txBuf, 5, u8UID, 8))
135 {
136 rt_kprintf("qspi get uid failed!\n");
137 }
138 else
139 {
140 rt_kprintf("w25q UID is: %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x\r\n",
141 u8UID[0], u8UID[1], u8UID[2], u8UID[3], u8UID[4], u8UID[5], u8UID[6], u8UID[7]);
142 }
143}
144
145
146int32_t w25q_check_process_done(struct rt_qspi_device *device, uint32_t u32Timeout)

Callers 1

qspi_thread_entryFunction · 0.70

Calls 3

rt_memsetFunction · 0.85
rt_qspi_send_then_recvFunction · 0.85
rt_kprintfFunction · 0.85

Tested by

no test coverage detected