Jump to main content

##

# 2.32.15 DMAC_ChannelSettingsSet Function

## C

    bool DMAC_ChannelSettingsSet ( DMAC_CHANNEL channel, DMAC_CHANNEL_CONFIG settings );

## Summary

Changes the current transfer settings of the specified DMAC channel.

## Description

This function changes the current transfer settings of the specified DMAC channel. The application can use this function along with the DMAC_ChannelSettingsGet function to analyze and if required change the transfer parameters of the DMAC channel at run time.

Calling this function while a transfer is in progress could result in unpredictable module operation. The application can use the DMAC_ChannelTransfer() function to check if the channel is not busy and then change the channel settings. The new channel settings will be applicable on the next transfer that is schedule using the DMAC_ChannelTransfer() function.

## Precondition

DMAC should have been initialized by calling DMAC_Initialize.

## Parameters

Param | Description
--- | ---
channel | The DMAC channel whose channel settings need to be obtained.
settings | A DMAC_CHANNEL_CONFIG type value containing the channel settings.

## Returns

- True - The channel settings were updated successfully.

- False - The channel settings were not updated.

## Example

    // Change the beat size of DMAC Channel 0
    DMAC_CHANNEL_CONFIG settings = 0;
    settings = DMAC_ChannelSettingsGet(DMAC_CHANNEL_0);
    settings = (settings & ~DMAC_DESCRIPTOR_BTCTRL_BEATSIZE_Msk) | DMAC_DESCRIPTOR_BTCTRL_BEATSIZE_HWORD;
    DMAC_ChannelSettingsSet(DMAC_CHANNEL_0, settings);

## Remarks

None.