Now I use sdk15.2.0 hrs project to add the spim.
the mode of the spi is timer+ppi+spi.
question:1.I can't enter the led_timer_handler on time;2.I can't get the right data,when I enable the ble advertise.
Now I use sdk15.2.0 hrs project to add the spim.
the mode of the spi is timer+ppi+spi.
question:1.I can't enter the led_timer_handler on time;2.I can't get the right data,when I enable the ble advertise.
Hi, AndreasF.
now I try to use the spi driver to read data.I use some code like this.
s8 bmi160_bus_burst_read(u8 dev_addr, u8 reg_addr, u8 *reg_data, u32 cnt) { m_tx_buf[0] = reg_addr | READ_MASK; nrf_drv_spi_xfer_desc_t xfer = NRF_DRV_SPI_XFER_TRX(m_tx_buf, 1, reg_data, 255); uint32_t flags = NRF_DRV_SPI_FLAG_HOLD_XFER | NRF_DRV_SPI_FLAG_REPEATED_XFER | NRF_DRV_SPI_FLAG_RX_POSTINC | NRF_DRV_SPI_FLAG_NO_XFER_EVT_HANDLER; nrf_drv_spi_xfer(&spi, &xfer, flags); burst_transfer_enable(); nrf_spim_task_trigger(spi.p_registers, NRF_SPIM_TASK_START); while(!burst_completed){ __WFE(); } spi_xfer_done = false; burst_completed = false; return SUCCESS; }
but I have some question about the NRF_DRV_SPI_FLAG_REPEATED_XFER flag.it's mean the PPI trigger once read action,the spi will read one byte data or 255 byte data?When it finishes reading 255 bytes,it will auto read next 255 bytes or I need to use the read funtion again?
Hi again.
When you want to transmit you can either start the transmitt transaction by:
1) Manually with PPI
2) By using the spi-functions.
If you want to send many transactions with data you have to wait for the event that tells you that the "current transaction" you are sending is finished, before you start the next transaction.
Best regards,
Andreas