Skip to content

File syn_port_dma.h

FileList > port > syn_port_dma.h

Go to the source code of this file

Hardware port abstraction interface for DMA controller.

  • #include "../common/syn_defs.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Classes

Type Name
struct SYN_PortDmaTransfer
Hardware DMA transfer hardware request parameters.

Public Types

Type Name
enum SYN_DMA_Direction
DMA transfer direction.
enum SYN_DMA_Size
DMA transfer data element size.

Public Functions

Type Name
void syn_port_cache_clean (const void * addr, size_t len)
Flush/clean data cache for source RAM region before DMA read.
void syn_port_cache_invalidate (void * addr, size_t len)
Invalidate data cache for destination RAM region after DMA write.
uint32_t syn_port_dma_get_counter (uint8_t channel_id)
Get remaining transfer counter for hardware DMA channel.
bool syn_port_dma_is_busy (uint8_t channel_id)
Check if hardware DMA channel is active.
SYN_Status syn_port_dma_start (const SYN_PortDmaTransfer * xfer)
Trigger hardware DMA channel start.
SYN_Status syn_port_dma_stop (uint8_t channel_id)
Abort an active hardware DMA channel.

Public Types Documentation

enum SYN_DMA_Direction

DMA transfer direction.

enum SYN_DMA_Direction {
    SYN_DMA_DIR_MEM_TO_MEM = 0,
    SYN_DMA_DIR_MEM_TO_PERIPH = 1,
    SYN_DMA_DIR_PERIPH_TO_MEM = 2
};


enum SYN_DMA_Size

DMA transfer data element size.

enum SYN_DMA_Size {
    SYN_DMA_SIZE_8BIT = 1,
    SYN_DMA_SIZE_16BIT = 2,
    SYN_DMA_SIZE_32BIT = 4
};


Public Functions Documentation

function syn_port_cache_clean

Flush/clean data cache for source RAM region before DMA read.

void syn_port_cache_clean (
    const void * addr,
    size_t len
) 

Parameters:

  • addr Start address.
  • len Byte length.

function syn_port_cache_invalidate

Invalidate data cache for destination RAM region after DMA write.

void syn_port_cache_invalidate (
    void * addr,
    size_t len
) 

Parameters:

  • addr Start address.
  • len Byte length.

function syn_port_dma_get_counter

Get remaining transfer counter for hardware DMA channel.

uint32_t syn_port_dma_get_counter (
    uint8_t channel_id
) 

Parameters:

  • channel_id Hardware DMA channel index.

Returns:

Number of remaining transfer elements.


function syn_port_dma_is_busy

Check if hardware DMA channel is active.

bool syn_port_dma_is_busy (
    uint8_t channel_id
) 

Parameters:

  • channel_id Hardware DMA channel index.

Returns:

true if channel is actively transferring.


function syn_port_dma_start

Trigger hardware DMA channel start.

SYN_Status syn_port_dma_start (
    const SYN_PortDmaTransfer * xfer
) 

Parameters:

  • xfer Transfer configuration.

Returns:

SYN_OK on success, error code otherwise.


function syn_port_dma_stop

Abort an active hardware DMA channel.

SYN_Status syn_port_dma_stop (
    uint8_t channel_id
) 

Parameters:

  • channel_id Hardware DMA channel index.

Returns:

SYN_OK on success.



The documentation for this class was generated from the following file src/syntropic/port/syn_port_dma.h