static void fifo_push(struct ai_controller* ai)
{
    unsigned int duration = get_dma_duration(ai);

    if (ai->regs[AI_STATUS_REG] & AI_STATUS_BUSY)
    {
        ai->fifo[1].address = ai->regs[AI_DRAM_ADDR_REG];
        ai->fifo[1].length = ai->regs[AI_LEN_REG];
        ai->fifo[1].duration = duration;
        ai->regs[AI_STATUS_REG] |= AI_STATUS_FULL;
    }
    else
    {
        ai->fifo[0].address = ai->regs[AI_DRAM_ADDR_REG];
        ai->fifo[0].length = ai->regs[AI_LEN_REG];
        ai->fifo[0].duration = duration;
        ai->regs[AI_STATUS_REG] |= AI_STATUS_BUSY;

        do_dma(ai, &ai->fifo[0]);
    }
}
Beispiel #2
0
void AiLenChanged(usf_state_t *state) {
	unsigned int duration = get_dma_duration(state);

	if (AI_STATUS_REG & AI_STATUS_BUSY) {
		state->fifo[1].address = AI_DRAM_ADDR_REG;
		state->fifo[1].length = AI_LEN_REG;
		state->fifo[1].duration = duration;

		if (state->enableFIFOfull)
			AI_STATUS_REG |= AI_STATUS_FULL;
		else
			do_dma(state, &state->fifo[1]);
	}
	else {
		state->fifo[0].address = AI_DRAM_ADDR_REG;
		state->fifo[0].length = AI_LEN_REG;
		state->fifo[0].duration = duration;
		AI_STATUS_REG |= AI_STATUS_BUSY;

		do_dma(state, &state->fifo[0]);
	}
}
Beispiel #3
0
void AiQueueInt(usf_state_t *state) {
	ChangeTimer(state,AiTimer,state->enableFIFOfull ? get_dma_duration(state) + state->Timers->Timer : 0);
}