Discuz! Board
标题:
nrf52832 spi
[打印本页]
作者:
yanli.lily
时间:
2018-11-15 19:34
标题:
nrf52832 spi
nrf52832的SPIM在开始时发送TASKS_START,TX_BUF传输结束后会收到EVENT_ENDTX,想请教一下,这样发送的话,SPI的SCK每8 clock(即1byte)之间是没有时间间隔的,如图nrf52832时序所示,如果想在每byte间加入时间间隔(如图SPI_SCK有时间间隔所示),应该怎么做呢?
附代码如下:
ret_code_t nrf_drv_spi_transfer(uint8_t const * p_tx_buffer,
uint8_t * p_rx_buffer,
uint8_t buffer_length)
{
nrf_gpio_pin_clear(SPI_CS_PIN);
NRF_SPIM0->EVENTS_END = 0U;
NRF_SPIM0->EVENTS_STOPPED = 0U;
NRF_SPIM0->TXD.MAXCNT = buffer_length;
NRF_SPIM0->RXD.MAXCNT = buffer_length;
NRF_SPIM0->TXD.PTR = (uint32_t)p_tx_buffer;
NRF_SPIM0->RXD.PTR = (uint32_t)p_rx_buffer;
NRF_SPIM0->TXD.LIST = 0;
NRF_SPIM0->RXD.LIST = 0;
NRF_SPIM0->TASKS_START = 1U;
}
void SPI0_TWI0_IRQHandler()
{
while (NRF_SPIM0->EVENTS_END == 0U);
NRF_SPIM0->EVENTS_END = 0U;
nrf_gpio_pin_set(SPI_CS_PIN);
}
作者:
admin
时间:
2018-11-16 20:47
发空数据
欢迎光临 Discuz! Board (http://qfv8.com/)
Powered by Discuz! X3