Lines Matching refs:dma_cfg

114 			       struct dma_config *dma_cfg)  in dma_rpi_pico_config()  argument
124 if (dma_cfg->block_count != 1) { in dma_rpi_pico_config()
129 if (dma_cfg->channel_priority > 3) { in dma_rpi_pico_config()
130 LOG_ERR("channel_priority must be < 4 (%" PRIu32 ")", dma_cfg->channel_priority); in dma_rpi_pico_config()
134 if (dma_cfg->head_block->source_addr_adj == DMA_ADDR_ADJ_DECREMENT) { in dma_rpi_pico_config()
139 if (dma_cfg->head_block->dest_addr_adj == DMA_ADDR_ADJ_DECREMENT) { in dma_rpi_pico_config()
144 if (dma_cfg->head_block->source_addr_adj != DMA_ADDR_ADJ_INCREMENT && in dma_rpi_pico_config()
145 dma_cfg->head_block->source_addr_adj != DMA_ADDR_ADJ_NO_CHANGE) { in dma_rpi_pico_config()
146 LOG_ERR("invalid source_addr_adj %" PRIu16, dma_cfg->head_block->source_addr_adj); in dma_rpi_pico_config()
149 if (dma_cfg->head_block->dest_addr_adj != DMA_ADDR_ADJ_INCREMENT && in dma_rpi_pico_config()
150 dma_cfg->head_block->dest_addr_adj != DMA_ADDR_ADJ_NO_CHANGE) { in dma_rpi_pico_config()
151 LOG_ERR("invalid dest_addr_adj %" PRIu16, dma_cfg->head_block->dest_addr_adj); in dma_rpi_pico_config()
155 if (dma_cfg->source_data_size != 1 && dma_cfg->source_data_size != 2 && in dma_rpi_pico_config()
156 dma_cfg->source_data_size != 4) { in dma_rpi_pico_config()
158 dma_cfg->source_data_size); in dma_rpi_pico_config()
162 if (dma_cfg->source_data_size != dma_cfg->dest_data_size) { in dma_rpi_pico_config()
166 if (dma_cfg->dest_data_size != 1 && dma_cfg->dest_data_size != 2 && in dma_rpi_pico_config()
167 dma_cfg->dest_data_size != 4) { in dma_rpi_pico_config()
168 LOG_ERR("dest_data_size must be 1, 2, or 4 (%" PRIu32 ")", dma_cfg->dest_data_size); in dma_rpi_pico_config()
172 if (dma_cfg->channel_direction > PERIPHERAL_TO_MEMORY) { in dma_rpi_pico_config()
175 dma_cfg->channel_direction); in dma_rpi_pico_config()
181 data->channels[channel].source_address = (void *)dma_cfg->head_block->source_address; in dma_rpi_pico_config()
182 data->channels[channel].dest_address = (void *)dma_cfg->head_block->dest_address; in dma_rpi_pico_config()
183 data->channels[channel].block_size = dma_cfg->head_block->block_size; in dma_rpi_pico_config()
185 dma_cfg->head_block->source_addr_adj == in dma_rpi_pico_config()
188 dma_cfg->head_block->dest_addr_adj == in dma_rpi_pico_config()
192 dma_rpi_pico_transfer_size(dma_cfg->source_data_size)); in dma_rpi_pico_config()
194 RPI_PICO_DMA_SLOT_TO_DREQ(dma_cfg->dma_slot)); in dma_rpi_pico_config()
196 !!(dma_cfg->channel_priority)); in dma_rpi_pico_config()
198 data->channels[channel].callback = dma_cfg->dma_callback; in dma_rpi_pico_config()
199 data->channels[channel].user_data = dma_cfg->user_data; in dma_rpi_pico_config()
200 data->channels[channel].direction = dma_cfg->channel_direction; in dma_rpi_pico_config()