/* Create a DMA transfer descriptor with configurations. 
This function will set the transfer configurations to the DMA transfer descriptor. */
void dma_descriptor_create(DmacDescriptor *descriptor, struct dma_descriptor_config *config)
/* Create a DMA transfer descriptor with configurations. 
This function will set the transfer configurations to the DMA transfer descriptor. */
void dma_descriptor_create(DmacDescriptor *descriptor, struct dma_descriptor_config *config)
{
	descriptor->BTCTRL.bit.VALID = config->descriptor_valid;
	descriptor->BTCTRL.bit.EVOSEL = config->event_output_selection;
	descriptor->BTCTRL.bit.BLOCKACT = config->block_action;
	descriptor->BTCTRL.bit.BEATSIZE = config->beat_size;
	descriptor->BTCTRL.bit.SRCINC = config->src_increment_enable;
	descriptor->BTCTRL.bit.DSTINC = config->dst_increment_enable;
	descriptor->BTCTRL.bit.STEPSEL = config->step_selection;
	descriptor->BTCTRL.bit.STEPSIZE = config->step_size;
	descriptor->BTCNT.reg = config->block_transfer_count;
	descriptor->SRCADDR.reg = config->source_address;
	descriptor->DSTADDR.reg = config->destination_address;
	descriptor->DESCADDR.reg = config->next_descriptor_address;
}