# Enumerated types¶

group group_csdadc_enums

Describes the enumeration types defined by the CSDADC.

These enumerations can be used for checking the CSDADC functions return statuses for defining a CSDADC resolution and an input voltage range and for defining Start and Stop conversion modes. Detailed information about the enumerations is available in each enumeration description.

Enums

enum cy_en_csdadc_status_t

CY_CSDADC_ID is a unique FW registration number. CY_PDL_STATUS_ERROR see SysLib Status Codes Macros.

Values:

enumerator CY_CSDADC_SUCCESS

The function executed successfully.

enumerator CY_CSDADC_BAD_PARAM

Any of the input parameter is invalid.

The user should check if all the input parameters are valid.

enumerator CY_CSDADC_HW_LOCKED

The CSD HW block is acquired and locked by another middleware or an application.

CSDADC must wait for the CSD HW block to be released to acquire the CSD HW block for use.

enumerator CY_CSDADC_HW_BUSY

The previous CSDADC operation not completed.

The user should call Cy_CSDADC_IsEndConversion() function and wait until current operation complete.

enumerator CY_CSDADC_OVERFLOW

This error could occur if CSDADC is not calibrated. The user should check VREF, PERI_CLK, interrupts and perform a new CSDADC calibration.

enumerator CY_CSDADC_CALIBRATION_FAIL

CSDADC can’t be calibrated well. The user should check VREF, PERI_CLK, interrupts.

enumerator CY_CSDADC_WRITE_CONFIG_FAIL

enumerator CY_CSDADC_NOT_INITIALIZED

This error could occur if the user tries to start conversion without a proper CSDADC initialization.

enumerator CY_CSDADC_TIMEOUT

This error could occur if a CSDADC conversion can not be stopped by Cy_CSDADC_StopConvert() function in the immediate mode. The user should check interrupts.

enum cy_en_csdadc_range_t

Values:

enumerator CY_CSDADC_RANGE_VREF

The GND to VREF input voltage range.

The user can choose this range because of its better linearity. The VREF can be set by middleware automatically depending on VDDA or can be set by the user manually.

enumerator CY_CSDADC_RANGE_VDDA

The GND to VDDA input voltage range.

This range has a worse linearity, but has a wider input voltage band.

enum cy_en_csdadc_resolution_t

Values:

enumerator CY_CSDADC_RESOLUTION_8BIT

The 8 bit resolution.

This mode has a worse accuracy but provides a minimum conversion time.

enumerator CY_CSDADC_RESOLUTION_10BIT

The 10 bit resolution.

This mode has a better accuracy than an 8bit, but has approximately a 4 times bigger conversion time.

enum cy_en_csdadc_conversion_mode_t

This enum type should be used to specify conversion mode of CSDADC when initiating a new conversion using the Cy_CSDADC_StartConvert() function. With a single shot mode, the CSDADC will convert every input channel voltages that are specified by channel mask parameter of this function. With a conditions mode, conversion will repeated for all specified channels until the user stop them by using the Cy_CSDADC_StopConvert() function. To read conversion data in the continuous mode without getting over-written, the user should call the Cy_CSDADC_GetConversionStatus() function.

Values:

enumerator CY_CSDADC_SINGLE_SHOT

The single shot mode.

enumerator CY_CSDADC_CONTINUOUS

The continuous mode.

enum cy_en_csdadc_stop_mode_t

This enum type should be used to specify stop conversion mode of CSDADC when breaking conversion(s) using the Cy_CSDADC_StopConvert() function. It can be used only in continuous conversion mode.

Values:

enumerator CY_CSDADC_IMMED_STOP

The immediate stop mode.

In this mode CSDADC conversion is disrupted immediately and an interrupt will be cleared. To prevent a possible CSD HW block hanging, a program watchdog starts. If this watchdog will be triggered, the Cy_CSDADC_StopConvert() function returns CY_CSDADC_TIMEOUT.

enumerator CY_CSDADC_CURRENT_CHAN_STOP

After the current channel conversion ending stop mode.

In this mode CSDADC conversion will be stopped after a current channel conversion. The user should check the status by using the Cy_CSDADC_IsEndConversion()function.

enumerator CY_CSDADC_ENABLED_CHAN_STOP

After the enabled channels conversion cycle ending stop mode.

In this mode CSDADC conversion will be stopped after all enabled channel conversion. The user should check the status by using the Cy_CSDADC_IsEndConversion()function.