Lines Matching refs:trans_desc

761 …TER_ISR_ATTR esp_err_t check_trans_valid(spi_device_handle_t handle, spi_transaction_t *trans_desc)  in check_trans_valid()  argument
766 bool tx_enabled = (trans_desc->flags & SPI_TRANS_USE_TXDATA) || (trans_desc->tx_buffer); in check_trans_valid()
767 bool rx_enabled = (trans_desc->flags & SPI_TRANS_USE_RXDATA) || (trans_desc->rx_buffer); in check_trans_valid()
768 spi_transaction_ext_t *t_ext = (spi_transaction_ext_t *)trans_desc; in check_trans_valid()
769 …bool dummy_enabled = (((trans_desc->flags & SPI_TRANS_VARIABLE_DUMMY)? t_ext->dummy_bits: handle->… in check_trans_valid()
774 …SPI_CHECK((trans_desc->flags & SPI_TRANS_USE_RXDATA)==0 || trans_desc->rxlength <= 32, "SPI_TRANS_… in check_trans_valid()
775 …SPI_CHECK((trans_desc->flags & SPI_TRANS_USE_TXDATA)==0 || trans_desc->length <= 32, "SPI_TRANS_US… in check_trans_valid()
776 …SPI_CHECK(trans_desc->length <= bus_attr->max_transfer_sz*8, "txdata transfer > host maximum", ESP… in check_trans_valid()
777 …SPI_CHECK(trans_desc->rxlength <= bus_attr->max_transfer_sz*8, "rxdata transfer > host maximum", E… in check_trans_valid()
778 …SPI_CHECK(is_half_duplex || trans_desc->rxlength <= trans_desc->length, "rx length > tx length in … in check_trans_valid()
781 …SPI_CHECK(!(host->id == SPI3_HOST && trans_desc->flags & SPI_TRANS_MODE_OCT), "SPI3 does not suppo… in check_trans_valid()
782 …SPI_CHECK(!((trans_desc->flags & SPI_TRANS_MODE_OCT) && (handle->cfg.flags & SPI_DEVICE_3WIRE)), "… in check_trans_valid()
783 …SPI_CHECK(!((trans_desc->flags & SPI_TRANS_MODE_OCT) && !is_half_duplex), "Incompatible when setti… in check_trans_valid()
785 …SPI_CHECK(!((trans_desc->flags & (SPI_TRANS_MODE_DIO|SPI_TRANS_MODE_QIO)) && (handle->cfg.flags & … in check_trans_valid()
786 …SPI_CHECK(!((trans_desc->flags & (SPI_TRANS_MODE_DIO|SPI_TRANS_MODE_QIO)) && !is_half_duplex), "In… in check_trans_valid()
793 …SPI_CHECK(!is_half_duplex || !trans_desc->length || !trans_desc->rxlength, "SPI half duplex mode i… in check_trans_valid()
796 …SPI_CHECK(trans_desc->length != 0 || !tx_enabled, "trans tx_buffer should be NULL and SPI_TRANS_US… in check_trans_valid()
799 …SPI_CHECK(!is_half_duplex || trans_desc->rxlength != 0 || !rx_enabled, "trans rx_buffer should be … in check_trans_valid()
802 if (trans_desc->rxlength==0 && !is_half_duplex) { in check_trans_valid()
803 trans_desc->rxlength=trans_desc->length; in check_trans_valid()
809 …SPI_CHECK(trans_desc->length <= SPI_LL_DMA_MAX_BIT_LEN, "txdata transfer > hardware max supported … in check_trans_valid()
810 …SPI_CHECK(trans_desc->rxlength <= SPI_LL_DMA_MAX_BIT_LEN, "rxdata transfer > hardware max supporte… in check_trans_valid()
812 …SPI_CHECK(trans_desc->length <= SPI_LL_CPU_MAX_BIT_LEN, "txdata transfer > hardware max supported … in check_trans_valid()
813 …SPI_CHECK(trans_desc->rxlength <= SPI_LL_CPU_MAX_BIT_LEN, "rxdata transfer > hardware max supporte… in check_trans_valid()
821 spi_transaction_t *trans_desc = trans_buf->trans; in uninstall_priv_desc() local
822 if ((void *)trans_buf->buffer_to_send != &trans_desc->tx_data[0] && in uninstall_priv_desc()
823 trans_buf->buffer_to_send != trans_desc->tx_buffer) { in uninstall_priv_desc()
828 (void *)trans_buf->buffer_to_rcv != &trans_desc->rx_data[0] && in uninstall_priv_desc()
829 trans_buf->buffer_to_rcv != trans_desc->rx_buffer) { // NOLINT(clang-analyzer-unix.Malloc) in uninstall_priv_desc()
830 if (trans_desc->flags & SPI_TRANS_USE_RXDATA) { in uninstall_priv_desc()
831 …memcpy((uint8_t *) & trans_desc->rx_data[0], trans_buf->buffer_to_rcv, (trans_desc->rxlength + 7) … in uninstall_priv_desc()
833 memcpy(trans_desc->rx_buffer, trans_buf->buffer_to_rcv, (trans_desc->rxlength + 7) / 8); in uninstall_priv_desc()
839 static SPI_MASTER_ISR_ATTR esp_err_t setup_priv_desc(spi_transaction_t *trans_desc, spi_trans_priv_… in setup_priv_desc() argument
841 *new_desc = (spi_trans_priv_t) { .trans = trans_desc, }; in setup_priv_desc()
845 if ( trans_desc->flags & SPI_TRANS_USE_RXDATA ) { in setup_priv_desc()
846 rcv_ptr = (uint32_t *)&trans_desc->rx_data[0]; in setup_priv_desc()
849 rcv_ptr = trans_desc->rx_buffer; in setup_priv_desc()
854 rcv_ptr = heap_caps_malloc(((trans_desc->rxlength + 31) / 32) * 4, MALLOC_CAP_DMA); in setup_priv_desc()
861 if ( trans_desc->flags & SPI_TRANS_USE_TXDATA ) { in setup_priv_desc()
862 send_ptr = (uint32_t *)&trans_desc->tx_data[0]; in setup_priv_desc()
865 send_ptr = trans_desc->tx_buffer ; in setup_priv_desc()
870 uint32_t *temp = heap_caps_malloc((trans_desc->length + 7) / 8, MALLOC_CAP_DMA); in setup_priv_desc()
873 memcpy( temp, send_ptr, (trans_desc->length + 7) / 8 ); in setup_priv_desc()
885 … spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t tick… in spi_device_queue_trans() argument
887 esp_err_t ret = check_trans_valid(handle, trans_desc); in spi_device_queue_trans()
896 if (host->device_acquiring_lock != handle && (trans_desc->flags & SPI_TRANS_CS_KEEP_ACTIVE)) { in spi_device_queue_trans()
901 ret = setup_priv_desc(trans_desc, &trans_buf, (host->bus_attr->dma_enabled)); in spi_device_queue_trans()
933 …evice_get_trans_result(spi_device_handle_t handle, spi_transaction_t **trans_desc, TickType_t tick… in spi_device_get_trans_result() argument
952 (*trans_desc) = trans_buf.trans; in spi_device_get_trans_result()
958 …rr_t SPI_MASTER_ATTR spi_device_transmit(spi_device_handle_t handle, spi_transaction_t *trans_desc) in spi_device_transmit() argument
963 ret = spi_device_queue_trans(handle, trans_desc, portMAX_DELAY); in spi_device_transmit()
969 assert(ret_trans == trans_desc); in spi_device_transmit()
1037 …pi_device_polling_start(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t tick… in spi_device_polling_start() argument
1041 ret = check_trans_valid(handle, trans_desc); in spi_device_polling_start()
1051 if ((trans_desc->flags & SPI_TRANS_CS_KEEP_ACTIVE) != 0) { in spi_device_polling_start()
1061 ret = setup_priv_desc(trans_desc, &host->cur_trans_buf, (host->bus_attr->dma_enabled)); in spi_device_polling_start()
1107 …TER_ISR_ATTR spi_device_polling_transmit(spi_device_handle_t handle, spi_transaction_t* trans_desc) in spi_device_polling_transmit() argument
1110 ret = spi_device_polling_start(handle, trans_desc, portMAX_DELAY); in spi_device_polling_transmit()