3.2.8 DIAG_DMAC
The DIAG_DMAC module is designed to verify the correct functionality of the Direct Memory Access Controller (DMAC) through a set of C function calls.
The DIAG_DMAC software test API is mapped to the following safety mechanisms:
| Function | Diagnostic Mechanism | Use Case | Elapsed Time (μs)~ |
|---|---|---|---|
| DIAG_DMAC_Disable() | DMA_DISABLE | POST / OnDemand | 1.5 |
| DIAG_DMAC_Enable() | DMA_ENABLE | POST / OnDemand | 1.45 |
| DIAG_DMAC_Interrupts() | DMA_INTERRUPTS | POST | 41.45 |
| DIAG_DMAC_LinkedList() | DMA_LINKED_TRANSFER | POST / OnDemand | 69.27 |
| DIAG_DMAC_SFRReset() | SFR_RESET_CHECK | POST | 46.20 |
| DIAG_DMAC_SFRWriteRead() | SFR_WRITE_READ | POST / OnDemand | 52.72 |
| DIAG_DMAC_Transfer() | DMA_TRANSFER | POST / OnDemand / InUSE | 45.20 |
Configuring the Diagnostic
DMAC Safe-Plib must be configured as illustrated to supported to support all diagnostics:

Using the Diagnostic (example reference)
#include "definitions.h"
// SFR testing
DIAG_TEST_STATUS DIAG_DMAC_SFRPost()
{
DIAG_TEST_STATUS result = DIAG_TEST_NOT_EXECUTED;
NVMCTRL_Initialize();
result = DIAG_DMAC_SFRReset(NULL,0,false);
if (result == DIAG_TEST_PASSED)
{
result = DIAG_DMAC_SFRWriteRead(NULL,0,false);
}
return result;
}
// Post testing
DIAG_TEST_STATUS DIAG_DMAC_Post()
{
DIAG_TEST_STATUS result;
result = DIAG_DMAC_Transfer(DMAC_CHANNEL_9);
if (result == DIAG_TEST_PASSED)
{
result = DIAG_DMAC_Interrupts(DMAC_CHANNEL_9);
if (result == DIAG_TEST_PASSED)
{
result = DIAG_DMAC_LinkedList(DMAC_CHANNEL_9);
}
}
return result;
}
