Jump to main content

##

# 2.3.3 ADCx_ComparisonWindowSet Function

## C

    void ADCx_ComparisonWindowSet(int16_t low_threshold, int16_t high_threshold); // x is instance of the peripheral and it is applicable only for devices having multiple instances of the peripheral.
    void ADCx_ComparisonWindowSet(uint16_t low_threshold, uint16_t high_threshold); // x is instance of the peripheral and it is applicable only for devices having multiple instances of the peripheral.

## Summary

This function sets the window upper threshold and lower threshold values.

## Description

This function configures the window threshold values.

## Precondition

ADCx_Initialize() function must have been called first for the associated instance.

## Parameters

Param | Description
--- | ---
low_threshold | 16-bit value for lower threshold
high_threshold | 16-bit value for upper threshold

## Returns

None

## Example

    ADC0_Initialize();
    ADC0_ComparisonWindowSet(0x100, 0x200);

## Remarks

Threshold values are based on result sign mode (differential mode) and result resolution (8, 10, 12 or 16 bit) configuration.