Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
dma.h File Reference

Explicit DMA memory domains, physical streams and drain facts. More...

Go to the source code of this file.

Data Structures

struct  nx_dma_memory_region_t
 Reviewed DMA-visible memory interval, never CPU accessibility. More...
struct  nx_dma_resource_t
 Opaque physical engine and request selector identities. More...
struct  nx_dma_drain_facts_t
 Independent facts required before memory borrow release. More...

Macros

#define NX_DMA_MEMORY_READ   1U
#define NX_DMA_MEMORY_WRITE   2U

Enumerations

enum  nx_dma_direction_t { NX_DMA_TO_DEVICE , NX_DMA_FROM_DEVICE }
 Transfer direction determines device access to caller memory. More...

Functions

nx_result_t nx_dma_buffer_validate (const nx_dma_memory_region_t *regions, size_t count, const void *data, size_t length, size_t alignment, nx_dma_direction_t direction)
 Validate an entire buffer within one explicit memory domain.
nx_result_t nx_dma_resources_validate (const nx_dma_resource_t *resources, size_t count)
 Reject duplicate physical streams in an assembled resource set.
nx_result_t nx_dma_drain_check (const nx_dma_drain_facts_t *facts)
 Require engine, IRQ and peripheral drain independently.

Detailed Description

Explicit DMA memory domains, physical streams and drain facts.

Author
Nexus Team

Definition in file dma.h.

Macro Definition Documentation

◆ NX_DMA_MEMORY_READ

#define NX_DMA_MEMORY_READ   1U

Definition at line 18 of file dma.h.

◆ NX_DMA_MEMORY_WRITE

#define NX_DMA_MEMORY_WRITE   2U

Definition at line 19 of file dma.h.

Enumeration Type Documentation

◆ nx_dma_direction_t

Transfer direction determines device access to caller memory.

Enumerator
NX_DMA_TO_DEVICE 
NX_DMA_FROM_DEVICE 

Definition at line 22 of file dma.h.

Function Documentation

◆ nx_dma_buffer_validate()

nx_result_t nx_dma_buffer_validate ( const nx_dma_memory_region_t * regions,
size_t count,
const void * data,
size_t length,
size_t alignment,
nx_dma_direction_t direction )

Validate an entire buffer within one explicit memory domain.

Parameters
[in]regionsImmutable SoC domains kept alive for this call.
[in]countPositive number of domains.
[in]dataNonempty caller buffer; never borrowed by this helper.
[in]lengthPositive byte length, including all DMA accesses.
[in]alignmentNonzero power-of-two transfer alignment.
[in]directionDevice reads or writes the supplied memory.
Returns
Success, INVALID for malformed ranges/alignment or PERMISSION for a range outside the required DMA domain.
Note
Bounded task/IRQ check, no MMIO, allocation or side effects.

◆ nx_dma_drain_check()

nx_result_t nx_dma_drain_check ( const nx_dma_drain_facts_t * facts)

Require engine, IRQ and peripheral drain independently.

Parameters
[in]factsProvider observations; not retained.
Returns
Success only when all sources are detached and idle, BUSY while any source remains, INVALID for impossible counters.
Note
The provider must observe actual registers and ordering before setting these facts. This helper does not stop hardware.

◆ nx_dma_resources_validate()

nx_result_t nx_dma_resources_validate ( const nx_dma_resource_t * resources,
size_t count )

Reject duplicate physical streams in an assembled resource set.

Parameters
[in]resourcesImmutable resource list, not retained.
[in]countResource count; zero allows a NULL list.
Returns
Success, INVALID for a NULL nonempty list or reserved zero controller, BUSY for a duplicate physical engine.
Note
Cold conflict check; the selected SoC must validate all identities against its actual topology before using them. This helper does not infer silicon support or allocate.