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

Function w25q_write_sr

bsp/hc32/tests/test_qspi.c:331–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329
330
331void w25q_write_sr(struct rt_qspi_device *device, uint8_t reg, uint8_t value)
332{
333 rt_uint8_t txBuf[5] = {0};
334
335 txBuf[0] = W25Q_WR_ENABLE;
336 if (1 != rt_qspi_send(device, txBuf, 1))
337 {
338 rt_kprintf("qspi send cmd failed!\n");
339 }
340 txBuf[0] = reg;
341 txBuf[1] = value;
342 if (2 != bsp_qspi_send(device, txBuf, 2, 1))
343 {
344 rt_kprintf("qspi send addr failed!\n");
345 }
346 if (LL_OK != w25q_check_process_done(device, 500U))
347 {
348 rt_kprintf("qspi wait busy failed!\n");
349 }
350}
351
352
353int32_t w25q_read_data(struct rt_qspi_device *device, uint32_t u32Addr, uint8_t *pu8ReadBuf, uint32_t u32Size)

Callers 1

qspi_thread_entryFunction · 0.85

Calls 4

rt_qspi_sendFunction · 0.85
rt_kprintfFunction · 0.85
bsp_qspi_sendFunction · 0.85
w25q_check_process_doneFunction · 0.70

Tested by

no test coverage detected