1.34.1.9 AFECx_ConversionSequenceSet Function

C

void AFECx_ConversionSequenceSet (AFEC_CHANNEL *channelList, uint8_t numChannel) // x - Instance of the AFEC peripheral

Summary

Sets the user sequence of the channel conversion

Description

This function sets the order in which channels are converted.

Precondition

AFECx_Initialize() must have been called first for the associate instance. Conversion should not be ongoing while changing the sequence.

Parameters

Param Description
*channelList pointer to the list of the channels which describes the order of conversion
numChannel Number of enabled channels in the list

Returns

None.

Example

AFEC_CHANNEL seq_order[4] = {AFEC_CH3, AFEC_CH5, AFEC_CH1, AFEC_CH2};
    AFEC0_Initialize();
    AFEC0_ConversionSequenceSet(seq_order, 0x4);
    AFEC0_ChannelsEnable(AFEC_CH0_MASK | AFEC_CH1_MASK | AFEC_CH2_MASK | AFEC_CH3_MASK);

Remarks

Conversion order is set in this function and remains valid until user configures new conversion sequence order or reinitializes the peripheral. Array pointed to by *channelList must be valid during the call to this function. This function copies the array data into AFEC HW registers.