/* Set respective fields in the channel's TCD: DADDR, DOFF, ATTR, DLAST. These fields configure the DMA channel destination.  */
int kinetis_dma_ch_set_dest(int ch, u32 daddr, s16 doff, u8 bitwidth, s32 dlast)
/* Set respective fields in the channel's TCD: DADDR, DOFF, ATTR, DLAST. These fields configure the DMA channel destination.  */
int kinetis_dma_ch_set_dest(int ch, u32 daddr, s16 doff, u8 bitwidth, s32 dlast)
{
	DMAAPI_LOCKED_BEGIN
	KINETIS_DMA->tcd[ch].attr =
		(KINETIS_DMA->tcd[ch].attr & ~KINETIS_TCD_ATTR_DSIZE_MSK) |
		(bitwidth << KINETIS_TCD_ATTR_DSIZE_BITS);
	KINETIS_DMA->tcd[ch].daddr = daddr;
	KINETIS_DMA->tcd[ch].doff = doff;
	KINETIS_DMA->tcd[ch].dlast_sga = dlast;
	DMAAPI_LOCKED_END
}