reg32_t *ctrlb;
};
-#define DMAC_CHANNEL_CNT 5
+#define DMAC_CHANNEL_CNT 6
struct DmacCh dmac_ch[] =
{
{
return 0;
}
-int dmac_stop(int ch)
+void dmac_stop(int ch)
{
DMAC_CHDR = BV(ch);
- return 0;
-}
-
-bool dmac_isLLIDone(int ch)
-{
- return (DMAC_EBCIMR |= (BV(ch) << DMAC_EBCISR_CBTC0));
-}
-
-bool dmac_waitLLIDone(int ch)
-{
- while(!(DMAC_EBCIMR |= (BV(ch) << DMAC_EBCISR_CBTC0)))
- cpu_relax();
-
- DMAC_CHDR = BV(ch);
- return true;
-}
-
-bool dmac_isDone(int ch)
-{
- //event_wait(&data_ready);
- return (*dmac_ch[ch].ctrla & BV(31));//(DMAC_CHSR |= (BV(dmac->ch) << DMAC_CHSR_EMPT0));
-}
-
-bool dmac_waitDone(int ch)
-{
- event_wait(&data_ready);
- DMAC_CHDR = BV(ch);
- return true;
+ dmac_ch_enabled &= ~BV(ch);
}
int dmac_error(int ch)
void dmac_configureDmaCfgLLI(int ch, DmacDesc *lli, uint32_t cfg);
void dmac_setSourcesLLI(int ch, DmacDesc *lli, uint32_t src, uint32_t dst, uint32_t desc);
void dmac_configureDmacLLI(int ch, DmacDesc *lli, size_t transfer_size, uint32_t cfg, uint32_t ctrla, uint32_t ctrlb);
-bool dmac_isLLIDone(int ch);
-bool dmac_waitLLIDone(int ch);
void dmac_setSources(int ch, uint32_t src, uint32_t dst);
void dmac_configureDmac(int ch, size_t transfer_size, uint32_t cfg, uint32_t ctrla, uint32_t ctrlb);
int dmac_start(int ch);
-int dmac_stop(int ch);
-bool dmac_isDone(int ch);
-bool dmac_waitDone(int ch);
+void dmac_stop(int ch);
int dmac_error(int ch);
bool dmac_enableCh(int ch, dmac_handler_t handler);
void dmac_init(void);