Jump to main content

##

# 2.133.9 XDMACn_ChannelSettingsSet Function

## C

    // n is instance of the peripheral and it is applicable only for devices having multiple instances of the peripheral.
    bool XDMACnChannelSettingsSet (XDMAC_CHANNEL channel, XDMAC_CHANNEL_SETTINGS setting)

## Summary

Sets the channel settings of a specific XDMAC Channel.

## Description

This function sets the channel settings of the XDMAC channel.

This function can be used along with the XDMAC_ChannelSettingsGet to update any specific setting of the XDMAC channel. Any ongoing transaction of the specified XDMAC channel will be aborted when this function is called.

## Precondition

XDMAC should have been initialized by calling XDMACn_Initialize.

## Parameters

Param | Description
--- | ---
channel | A specific XDMAC channel
setting | Settings for a channel

## Returns

Settings update status. - True - Channel settings are updated successfully.

- False - Channel settings update failed.

## Example

    //Update the transfer direction dynamically which was set to
    //PER2MEM from within DMA manager to MEM2PER.
    XDMAC_CHANNEL_CONFIG settings = 0;
    settings = XDMAC_ChannelSettingsGet(XDMAC_CHANNEL_0);
    settings = (settings & ~XDMAC_CC_DSYNC_Msk) | XDMAC_CC_DSYNC_MEM2PER;
    XDMAC_ChannelSettingsSet(XDMAC_CHANNEL_0, settings);

## Remarks

Use macro definitions from the packs header to construct a new setting.