You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|| !(trans_desc->flags&SPI_TRANS_USE_TXDATA||trans_desc->tx_buffer!=NULL), "SPI half duplex mode does not support using DMA with both MOSI and MISO phases.", ESP_ERR_INVALID_ARG );
683
+
SPI_CHECK(!is_half_duplex||bus_attr->dma_chan==0|| !rx_enabled|| !tx_enabled, "SPI half duplex mode does not support using DMA with both MOSI and MISO phases.", ESP_ERR_INVALID_ARG );
678
684
#endif
679
685
//MOSI phase is skipped only when both tx_buffer and SPI_TRANS_USE_TXDATA are not set.
"trans tx_buffer should be NULL and SPI_TRANS_USE_TXDATA should be cleared to skip MOSI phase.", ESP_ERR_INVALID_ARG);
686
+
SPI_CHECK(trans_desc->length!=0|| !tx_enabled, "trans tx_buffer should be NULL and SPI_TRANS_USE_TXDATA should be cleared to skip MOSI phase.", ESP_ERR_INVALID_ARG);
682
687
//MISO phase is skipped only when both rx_buffer and SPI_TRANS_USE_RXDATA are not set.
683
688
//If set rxlength=0 in full_duplex mode, it will be automatically set to length
"trans rx_buffer should be NULL and SPI_TRANS_USE_RXDATA should be cleared to skip MISO phase.", ESP_ERR_INVALID_ARG);
689
+
SPI_CHECK(!is_half_duplex||trans_desc->rxlength!=0|| !rx_enabled, "trans rx_buffer should be NULL and SPI_TRANS_USE_RXDATA should be cleared to skip MISO phase.", ESP_ERR_INVALID_ARG);
687
690
//In Full duplex mode, default rxlength to be the same as length, if not filled in.
688
691
// set rxlength to length is ok, even when rx buffer=NULL
689
-
if (trans_desc->rxlength==0&& !(handle->cfg.flags&SPI_DEVICE_HALFDUPLEX)) {
692
+
if (trans_desc->rxlength==0&& !is_half_duplex) {
690
693
trans_desc->rxlength=trans_desc->length;
691
694
}
695
+
//Dummy phase is not available when both data out and in are enabled, regardless of FD or HD mode.
696
+
SPI_CHECK(!tx_enabled|| !rx_enabled|| !dummy_enabled|| !extra_dummy_enabled, "Dummy phase is not available when both data out and in are enabled", ESP_ERR_INVALID_ARG);
Copy file name to clipboardExpand all lines: docs/en/api-reference/peripherals/spi_master.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -520,8 +520,7 @@ Known Issues
520
520
This can prohibit you from transmitting and receiving data longer than 64 bytes.
521
521
3. Try using the command and address fields to replace the write phase.
522
522
523
-
2. Full-duplex transactions are not compatible with the *dummy bit workaround*, hence the frequency is limited. See :ref:`dummy
524
-
bit speed-up workaround <dummy_bit_workaround>`.
523
+
2. Full-duplex transactions are not compatible with the *dummy bit workaround*, hence the frequency is limited. See :ref:`dummy bit speed-up workaround <dummy_bit_workaround>`.
525
524
526
525
3. ``dummy_bits`` in :cpp:type:`spi_device_interface_config_t` and :cpp:type:`spi_transaction_ext_t` are not available when SPI read and write phases are both enabled (regardless of full duplex or half duplex mode).
0 commit comments