Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches

Direct Memory Access driver to service high data throughput peripherals allowing them to access data memory directly using dsPIC MCUs. More...

+ Collaboration diagram for DMA Driver:

Files

file  dma.h
 This is the generated driver header file for the DMA driver.
 
file  dma_types.h
 This is the generated driver types header file for the DMA driver.
 
file  dma.c
 This is the generated driver source file for DMA driver.
 

Data Structures

struct  DMA_INTERFACE
 Structure containing the function pointers of DMA driver. More...
 

Macros

#define DMA_SPI_Initialize   DMA_Initialize
 This macro defines the Custom Name for DMA_Initialize API.
 
#define DMA_SPI_Deinitialize   DMA_Deinitialize
 This macro defines the Custom Name for DMA_Deinitialize API.
 
#define DMA_SPI_ChannelEnable   DMA_ChannelEnable
 This macro defines the Custom Name for DMA_ChannelEnable API.
 
#define DMA_SPI_TransferCountSet   DMA_TransferCountSet
 This macro defines the Custom Name for DMA_TransferCountSet API.
 
#define DMA_SPI_TransferCountGet   DMA_TransferCountGet
 This macro defines the Custom Name for DMA_TransferCountGet API.
 
#define DMA_SPI_SoftwareTriggerEnable   DMA_SoftwareTriggerEnable
 This macro defines the Custom Name for DMA_SoftwareTriggerEnable API.
 
#define DMA_SPI_SourceAddressSet   DMA_SourceAddressSet
 This macro defines the Custom Name for DMA_SourceAddressSet API.
 
#define DMA_SPI_DestinationAddressSet   DMA_DestinationAddressSet
 This macro defines the Custom Name for DMA_DestinationAddressSet API.
 
#define DMA_SPI_IsSoftwareRequestPending   DMA_IsSoftwareRequestPending
 This macro defines the Custom Name for DMA_IsSoftwareRequestPending API.
 
#define DMA_SPI_ChannelTasks   DMA_ChannelTasks
 This macro defines the Custom Name for DMA_ChannelTasks API.
 
#define DMA_SPI_ChannelCallbackRegister   DMA_ChannelCallbackRegister
 This macro defines the Custom Name for DMA_ChannelCallbackRegister API.
 

Enumerations

enum  DMA_CHANNEL { DMA_CHANNEL_0 = 0 , DMA_CHANNEL_1 = 1 , DMA_CHANNEL_2 = 2 , DMA_CHANNEL_3 = 3 , DMA_CHANNEL_4 = 4 , DMA_CHANNEL_5 = 5 , DMA_NUMBER_OF_CHANNELS = 6 }
 Defines the DMA channles that are selected from the MCC Melody User Interface for the DMA transfers. The below are the custom names given in the MCC Melody User Interface. More...
 

Functions

void DMA_Initialize (void)
 Initializes the DMA module.
 
void DMA_Deinitialize (void)
 Deinitializes the DMA to POR values.
 
static void DMA_ChannelEnable (enum DMA_CHANNEL channel)
 This inline function enables the DMA channel.
 
static void DMA_ChannelDisable (enum DMA_CHANNEL channel)
 This inline function disables the DMA channel.
 
static void DMA_TransferCountSet (enum DMA_CHANNEL channel, uint16_t transferCount)
 This inline function sets the number of transfer counts to DMA channel.
 
static uint16_t DMA_TransferCountGet (enum DMA_CHANNEL channel)
 This inline function returns the number of transfer counts from DMA channel.
 
static void DMA_SoftwareTriggerEnable (enum DMA_CHANNEL channel)
 This inline function sets the software trigger of the DMA channel.
 
static void DMA_SourceAddressSet (enum DMA_CHANNEL channel, uint16_t address)
 This inline function sets the source address to specified DMA channel.
 
static void DMA_DestinationAddressSet (enum DMA_CHANNEL channel, uint16_t address)
 This inline function sets the destination address to specified DMA channel.
 
static bool DMA_IsSoftwareRequestPending (enum DMA_CHANNEL channel)
 This inline function returns the status of the software request of the DMA channel.
 
void DMA_ChannelTasks (void)
 This function is used to implement the tasks for polled implementations of DMA Channel.
 
void DMA_ChannelCallbackRegister (void(*callback)(enum DMA_CHANNEL channel))
 This function can be used to override default callback and to define custom callback for DMA Channel event.
 
void DMA_ChannelCallback (enum DMA_CHANNEL channel)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using DMA_ChannelCallbackRegister.
 

Variables

const struct DMA_INTERFACE DMA_SPI
 Structure object of type DMA_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. DMA can be changed by the user in the DMA user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
 

Detailed Description

Macro Definition Documentation

◆ DMA_SPI_ChannelCallbackRegister

#define DMA_SPI_ChannelCallbackRegister   DMA_ChannelCallbackRegister

Definition at line 115 of file dma.h.

◆ DMA_SPI_ChannelEnable

#define DMA_SPI_ChannelEnable   DMA_ChannelEnable

Definition at line 75 of file dma.h.

◆ DMA_SPI_ChannelTasks

#define DMA_SPI_ChannelTasks   DMA_ChannelTasks

Definition at line 110 of file dma.h.

◆ DMA_SPI_Deinitialize

#define DMA_SPI_Deinitialize   DMA_Deinitialize

Definition at line 70 of file dma.h.

◆ DMA_SPI_DestinationAddressSet

#define DMA_SPI_DestinationAddressSet   DMA_DestinationAddressSet

Definition at line 100 of file dma.h.

◆ DMA_SPI_Initialize

#define DMA_SPI_Initialize   DMA_Initialize

Definition at line 65 of file dma.h.

◆ DMA_SPI_IsSoftwareRequestPending

#define DMA_SPI_IsSoftwareRequestPending   DMA_IsSoftwareRequestPending

Definition at line 105 of file dma.h.

◆ DMA_SPI_SoftwareTriggerEnable

#define DMA_SPI_SoftwareTriggerEnable   DMA_SoftwareTriggerEnable

Definition at line 90 of file dma.h.

◆ DMA_SPI_SourceAddressSet

#define DMA_SPI_SourceAddressSet   DMA_SourceAddressSet

Definition at line 95 of file dma.h.

◆ DMA_SPI_TransferCountGet

#define DMA_SPI_TransferCountGet   DMA_TransferCountGet

Definition at line 85 of file dma.h.

◆ DMA_SPI_TransferCountSet

#define DMA_SPI_TransferCountSet   DMA_TransferCountSet

Definition at line 80 of file dma.h.

Enumeration Type Documentation

◆ DMA_CHANNEL

Enumerator
DMA_CHANNEL_0 

DMA channel 0

DMA_CHANNEL_1 

DMA channel 1

DMA_CHANNEL_2 

DMA channel 2

DMA_CHANNEL_3 

DMA channel 3

DMA_CHANNEL_4 

DMA channel 4

DMA_CHANNEL_5 

DMA channel 5

DMA_NUMBER_OF_CHANNELS 

Maximum number of Channels supported by hardware : 6

Definition at line 50 of file dma_types.h.

Function Documentation

◆ DMA_ChannelCallback()

void DMA_ChannelCallback ( enum DMA_CHANNEL channel)
Parameters
[in]channel- Selected channel for the Callback handling
Returns
none

Definition at line 226 of file dma.c.

◆ DMA_ChannelCallbackRegister()

void DMA_ChannelCallbackRegister ( void(*)(enum DMA_CHANNEL channel) callback)
Parameters
[in]callback- Address of the callback function
Returns
none

Definition at line 218 of file dma.c.

+ Here is the caller graph for this function:

◆ DMA_ChannelDisable()

static void DMA_ChannelDisable ( enum DMA_CHANNEL channel)
inlinestatic
Precondition
DMA_Initialize must be called.
Parameters
[in]channel- DMA channel number
Returns
none

Definition at line 175 of file dma.h.

+ Here is the caller graph for this function:

◆ DMA_ChannelEnable()

static void DMA_ChannelEnable ( enum DMA_CHANNEL channel)
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
Returns
none

Definition at line 142 of file dma.h.

+ Here is the caller graph for this function:

◆ DMA_ChannelTasks()

void DMA_ChannelTasks ( void )
Precondition
DMA_Initialize must be called
Parameters
none
Returns
none

Definition at line 241 of file dma.c.

◆ DMA_Deinitialize()

void DMA_Deinitialize ( void )
Parameters
none
Returns
none

Definition at line 163 of file dma.c.

◆ DMA_DestinationAddressSet()

static void DMA_DestinationAddressSet ( enum DMA_CHANNEL channel,
uint16_t address )
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
[in]address- Destination address
Returns
none

Definition at line 352 of file dma.h.

◆ DMA_Initialize()

void DMA_Initialize ( void )
Parameters
none
Returns
none

Definition at line 67 of file dma.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DMA_IsSoftwareRequestPending()

static bool DMA_IsSoftwareRequestPending ( enum DMA_CHANNEL channel)
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
Returns
true - DMA request is pending
false - DMA request is not pending

Definition at line 387 of file dma.h.

◆ DMA_SoftwareTriggerEnable()

static void DMA_SoftwareTriggerEnable ( enum DMA_CHANNEL channel)
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
Returns
none

Definition at line 284 of file dma.h.

◆ DMA_SourceAddressSet()

static void DMA_SourceAddressSet ( enum DMA_CHANNEL channel,
uint16_t address )
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
[in]address- Source address
Returns
none

Definition at line 318 of file dma.h.

◆ DMA_TransferCountGet()

static uint16_t DMA_TransferCountGet ( enum DMA_CHANNEL channel)
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
Returns
Returns the transfer count value

Definition at line 248 of file dma.h.

◆ DMA_TransferCountSet()

static void DMA_TransferCountSet ( enum DMA_CHANNEL channel,
uint16_t transferCount )
inlinestatic
Precondition
DMA_Initialize must be called
Parameters
[in]channel- DMA channel number
[in]transferCount- Transfer count Value
Returns
none

Definition at line 209 of file dma.h.

Variable Documentation

◆ DMA_SPI

const struct DMA_INTERFACE DMA_SPI
extern

Definition at line 51 of file dma.c.