/* Translates a DMA handle into a pointer to a channel. */
static DMA_Channel_t* HandleToChannel(DMA_Handle_t handle)
/* Translates a DMA handle into a pointer to a channel. */
static DMA_Channel_t* HandleToChannel(DMA_Handle_t handle)
{
	int controllerIdx;
	int channelIdx;
	controllerIdx = CONTROLLER_FROM_HANDLE(handle);
	channelIdx = CHANNEL_FROM_HANDLE(handle);
	if ((controllerIdx > DMA_NUM_CONTROLLERS)
	    || (channelIdx > DMA_NUM_CHANNELS)) {
		return NULL;
	}
	return &gDMA.controller[controllerIdx].channel[channelIdx];
}