MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / init_capture_dma

Function init_capture_dma

FluxEngine.cydsn/main.c:398–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static void init_capture_dma(void)
399{
400 dma_channel = SAMPLER_DMA_DmaInitialize(
401 1 /* bytes */,
402 true /* request per burst */,
403 HI16(CYDEV_PERIPH_BASE),
404 HI16(CYDEV_SRAM_BASE));
405
406 for (int i=0; i<BUFFER_COUNT; i++)
407 td[i] = CyDmaTdAllocate();
408 for (int i=0; i<BUFFER_COUNT; i++)
409 {
410 int nexti = i+1;
411 if (nexti == BUFFER_COUNT)
412 nexti = 0;
413
414 CyDmaTdSetConfiguration(td[i], BUFFER_SIZE, td[nexti],
415 CY_DMA_TD_INC_DST_ADR | SAMPLER_DMA__TD_TERMOUT_EN);
416 CyDmaTdSetAddress(td[i], LO16((uint32)SAMPLER_FIFO_FIFO_PTR), LO16((uint32)&dma_buffer[i]));
417 }
418}
419
420static void cmd_read(struct read_frame* f)
421{

Callers 1

cmd_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected