eag****com
Dir Sir or Madam
I have developed the POC device using GR5515 and GH3026.
SPI was deployed for communication between GR5515 and GH3026.
My code snippet is as follows and then spi dma read is working well, but spi dma write(transmit) is not working.
Of course, spi sync transmit is working well, too. Could you let me know the reason?
Thanks.
GU8 hal_gh3x2x_spi_write(GU8 write_buffer[], GU16 length)
{
#if SPI_DMA == 0
g_spi_master_tdone = 0;
GU8 ret = app_spi_dma_transmit_async(APP_SPI_ID_MASTER, write_buffer, length);
if (ret != APP_DRV_SUCCESS)
{
printf("I2C master send failed.\r\n");
return;
}
while (g_spi_master_tdone == 0);
#else
GU8 ret = app_spi_transmit_sync(APP_SPI_ID_MASTER, write_buffer, length, 1000);
#endif
return ret;
}
GU8 hal_gh3x2x_spi_read(GU8 read_buffer[], GU16 length)
{
// memset(read_buffer, 0xFF, length);
#if SPI_DMA
g_spi_master_rdone = 0;
GU8 ret = app_spi_dma_receive_async(APP_SPI_ID_MASTER, read_buffer, length);
while (g_spi_master_rdone == 0);
#else
GU8 ret = app_spi_receive_sync(APP_SPI_ID_MASTER, read_buffer, length, 1000);
#endif
return ret;
}
zhongchengzhi
What's the app_spi_dma_transmit_async t return value?
Open WeChat, use "Scan" to follow.