CAT2 Peripheral Driver Library
Enumerated Types

Modules

 Control Register Enums
 
 Sample Control Register Enums
 
 Sample Time Register Enums
 
 Range Interrupt Register Enums
 This set of enumerations aids in configuring the SAR RANGE* registers.
 
 Channel Configuration Register Enums
 This set of enumerations aids in configuring the SAR CHAN_CONFIG and INJ_CHAN_CONFIG registers.
 

Enumerations

enum  cy_en_sar_status_t {
  CY_SAR_SUCCESS = 0x00UL,
  CY_SAR_BAD_PARAM = CY_SAR_ID | CY_PDL_STATUS_ERROR | 0x01UL,
  CY_SAR_TIMEOUT = CY_SAR_ID | CY_PDL_STATUS_ERROR | 0x02UL,
  CY_SAR_CONVERSION_NOT_COMPLETE = CY_SAR_ID | CY_PDL_STATUS_INFO | 0x03UL
}
 The SAR status/error code definitions. More...
 
enum  cy_en_sar_start_convert_sel_t {
  CY_SAR_START_CONVERT_SINGLE_SHOT = 0UL,
  CY_SAR_START_CONVERT_CONTINUOUS = 1UL
}
 Definitions for starting a conversion used in Cy_SAR_StartConvert. More...
 
enum  cy_en_sar_return_mode_t {
  CY_SAR_RETURN_STATUS = 0UL,
  CY_SAR_WAIT_FOR_RESULT = 1UL,
  CY_SAR_RETURN_STATUS_INJ = 2UL,
  CY_SAR_WAIT_FOR_RESULT_INJ = 3UL
}
 Definitions for the return mode used in Cy_SAR_IsEndConversion. More...
 
enum  cy_en_sar_ctrl_vref_sel_t {
  CY_SAR_VREF_SEL_BGR = 4UL,
  CY_SAR_VREF_SEL_EXT = 5UL,
  CY_SAR_VREF_SEL_VDDA_DIV_2 = 6UL,
  CY_SAR_VREF_SEL_VDDA = 7UL
}
 Reference voltage selection definitions. More...
 
enum  cy_en_sar_ctrl_neg_sel_t {
  CY_SAR_NEG_SEL_VSSA_KELVIN = 0UL,
  CY_SAR_NEG_SEL_ART_VSSA = 1UL,
  CY_SAR_NEG_SEL_P1 = 2UL,
  CY_SAR_NEG_SEL_P3 = 3UL,
  CY_SAR_NEG_SEL_P5 = 4UL,
  CY_SAR_NEG_SEL_P7 = 5UL,
  CY_SAR_NEG_SEL_ACORE = 6UL,
  CY_SAR_NEG_SEL_VREF = 7UL
}
 Negative terminal (Vminus) selection definitions for single-ended channels. More...
 
enum  cy_en_sar_ctrl_hw_ctrl_negvref_t {
  CY_SAR_NEGVREF_FW_ONLY = 0UL,
  CY_SAR_NEGVREF_HW = 1UL
}
 Enable hardware control of the switch between Vref and the Vminus input. More...
 
enum  cy_en_sar_ctrl_pwr_t {
  CY_SAR_NORMAL_PWR = 0UL,
  CY_SAR_HALF_PWR = 1UL,
  CY_SAR_MORE_PWR = 2UL,
  CY_SAR_QUARTER_PWR = 3UL
}
 Power mode. More...
 
enum  cy_en_sar_sample_ctrl_dsi_mode_t {
  CY_SAR_DSI_MODE_NORMAL = 0UL,
  CY_SAR_DSI_MODE_IGNORED = 1UL
}
 DSI mode. More...
 
enum  cy_en_sar_sample_ctrl_sub_resolution_t {
  CY_SAR_SUB_RESOLUTION_8B = 0UL,
  CY_SAR_SUB_RESOLUTION_10B = 1UL
}
 SubResolution.
 
enum  cy_en_sar_sample_ctrl_avg_cnt_t {
  CY_SAR_AVG_CNT_2 = 0UL,
  CY_SAR_AVG_CNT_4 = 1UL,
  CY_SAR_AVG_CNT_8 = 2UL,
  CY_SAR_AVG_CNT_16 = 3UL,
  CY_SAR_AVG_CNT_32 = 4UL,
  CY_SAR_AVG_CNT_64 = 5UL,
  CY_SAR_AVG_CNT_128 = 6UL,
  CY_SAR_AVG_CNT_256 = 7UL
}
 Configure number of samples for averaging. More...
 
enum  cy_en_sar_sample_ctrl_trigger_mode_t {
  CY_SAR_TRIGGER_MODE_FW_ONLY = 0UL,
  CY_SAR_TRIGGER_MODE_FW_AND_HWEDGE = 1UL,
  CY_SAR_TRIGGER_MODE_FW_AND_HWLEVEL = 3UL
}
 Configure the trigger mode. More...
 

Detailed Description

Enumeration Type Documentation

◆ cy_en_sar_status_t

The SAR status/error code definitions.

Enumerator
CY_SAR_SUCCESS 

Success.

CY_SAR_BAD_PARAM 

Invalid input parameters.

CY_SAR_TIMEOUT 

A timeout occurred.

CY_SAR_CONVERSION_NOT_COMPLETE 

SAR conversion is not complete.

◆ cy_en_sar_start_convert_sel_t

Definitions for starting a conversion used in Cy_SAR_StartConvert.

Enumerator
CY_SAR_START_CONVERT_SINGLE_SHOT 

Start a single scan (one shot) from firmware.

CY_SAR_START_CONVERT_CONTINUOUS 

Continuously scan enabled channels and ignores all triggers, firmware or hardware.

◆ cy_en_sar_return_mode_t

Definitions for the return mode used in Cy_SAR_IsEndConversion.

Enumerator
CY_SAR_RETURN_STATUS 

Immediately returns the conversion status.

CY_SAR_WAIT_FOR_RESULT 

Does not return a result until the conversion of all sequential channels is complete.

This mode is blocking.

CY_SAR_RETURN_STATUS_INJ 

Immediately returns the conversion status of the injection channel.

CY_SAR_WAIT_FOR_RESULT_INJ 

Does not return a result until the conversion of injection channels is complete.

This mode is blocking.

◆ cy_en_sar_ctrl_vref_sel_t

Reference voltage selection definitions.

Enumerator
CY_SAR_VREF_SEL_BGR 

1.2V from BandGap (VREF buffer on)

CY_SAR_VREF_SEL_EXT 

External precision Vref direct from a pin (low impedance path)

CY_SAR_VREF_SEL_VDDA_DIV_2 

Vdda/2 (VREF buffer on)

CY_SAR_VREF_SEL_VDDA 

Vdda.

◆ cy_en_sar_ctrl_neg_sel_t

Negative terminal (Vminus) selection definitions for single-ended channels.

The Vminus input for single ended channels can be connected to Vref, VSSA, or routed out to an external pin. The options for routing to a pin are through Pin 1, Pin 3, Pin 5, or Pin 7 of the SARMUX dedicated port or an acore wire in AROUTE, if available on the device.

CY_SAR_NEG_SEL_VSSA_KELVIN comes straight from a Vssa pad without any shared branches so that to keep quiet and avoid voltage drops.

Enumerator
CY_SAR_NEG_SEL_VSSA_KELVIN 

Connect Vminus to VSSA_KELVIN.

CY_SAR_NEG_SEL_P1 

Connect Vminus to Pin 1 of SARMUX dedicated port.

CY_SAR_NEG_SEL_P3 

Connect Vminus to Pin 3 of SARMUX dedicated port.

CY_SAR_NEG_SEL_P5 

Connect Vminus to Pin 5 of SARMUX dedicated port.

CY_SAR_NEG_SEL_P7 

Connect Vminus to Pin 7 of SARMUX dedicated port.

CY_SAR_NEG_SEL_ACORE 

Connect Vminus to an ACORE in AROUTE.

CY_SAR_NEG_SEL_VREF 

Connect Vminus to VREF input of SARADC.

◆ cy_en_sar_ctrl_hw_ctrl_negvref_t

Enable hardware control of the switch between Vref and the Vminus input.

Enumerator
CY_SAR_NEGVREF_FW_ONLY 

Only firmware control of the switch.

CY_SAR_NEGVREF_HW 

Enable hardware control of the switch.

◆ cy_en_sar_ctrl_pwr_t

Power mode.

Enumerator
CY_SAR_NORMAL_PWR 

Normal power (default), max clk_sar is 18MHz.

CY_SAR_HALF_PWR 

1/2 power mode, max clk_sar is 9MHz.

CY_SAR_MORE_PWR 

1.333 power mode, max clk_sar is 18MHz.

CY_SAR_QUARTER_PWR 

1/4 power mode, max clk_sar is 4.5MHz.

◆ cy_en_sar_sample_ctrl_dsi_mode_t

DSI mode.

Enumerator
CY_SAR_DSI_MODE_NORMAL 

SAR sequencer operates according to CHAN_EN enables and CHAN_CONFIG channel configurations.

CY_SAR_DSI_MODE_IGNORED 

CHAN_EN, INJ_START_EN and channel configurations in CHAN_CONFIG and INJ_CHAN_CONFIG are ignored.

◆ cy_en_sar_sample_ctrl_avg_cnt_t

Configure number of samples for averaging.

This applies only to channels with averaging enabled.

Enumerator
CY_SAR_AVG_CNT_2 

Set samples averaged to 2.

CY_SAR_AVG_CNT_4 

Set samples averaged to 4.

CY_SAR_AVG_CNT_8 

Set samples averaged to 8.

CY_SAR_AVG_CNT_16 

Set samples averaged to 16.

CY_SAR_AVG_CNT_32 

Set samples averaged to 32.

CY_SAR_AVG_CNT_64 

Set samples averaged to 64.

CY_SAR_AVG_CNT_128 

Set samples averaged to 128.

CY_SAR_AVG_CNT_256 

Set samples averaged to 256.

◆ cy_en_sar_sample_ctrl_trigger_mode_t

Configure the trigger mode.

Firmware triggering is always enabled and can be single shot or continuous. Additionally, hardware triggering can be enabled with the option to be edge or level sensitive.

Enumerator
CY_SAR_TRIGGER_MODE_FW_ONLY 

Firmware trigger only, disable hardware trigger.

CY_SAR_TRIGGER_MODE_FW_AND_HWEDGE 

Enable edge sensitive hardware trigger.

Each rising edge will trigger a single scan.

CY_SAR_TRIGGER_MODE_FW_AND_HWLEVEL 

Enable level sensitive hardware trigger.

The SAR will continuously scan while the trigger signal is high.