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

Function w25q_read_data

bsp/hc32/tests/test_qspi.c:353–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351
352
353int32_t w25q_read_data(struct rt_qspi_device *device, uint32_t u32Addr, uint8_t *pu8ReadBuf, uint32_t u32Size)
354{
355 int32_t i32Ret = LL_OK;
356 rt_uint8_t txBuf[5] = {0};
357
358 txBuf[0] = W25Q_QSPI_RD_MD;
359 txBuf[1] = (u32Addr >> 16) & 0xFFU;
360 txBuf[2] = (u32Addr >> 8) & 0xFFU;
361 txBuf[3] = u32Addr & 0xFFU;
362 if (u32Size != bsp_qspi_send_then_recv(device, txBuf, 4, pu8ReadBuf, u32Size))
363 {
364 i32Ret = LL_ERR;
365 }
366
367 return i32Ret;
368}
369
370
371int32_t w25q_write_data(struct rt_qspi_device *device, uint32_t u32Addr, uint8_t *pu8WriteBuf, uint32_t u32Size)

Callers 1

w25q_write_read_dataFunction · 0.70

Calls 1

bsp_qspi_send_then_recvFunction · 0.85

Tested by

no test coverage detected