| 329 | |
| 330 | |
| 331 | void 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 | |
| 353 | int32_t w25q_read_data(struct rt_qspi_device *device, uint32_t u32Addr, uint8_t *pu8ReadBuf, uint32_t u32Size) |
no test coverage detected