Hardware Abstraction Layer (HAL)
COMP (Analog Comparator)

On CAT1 & CAT2, the comparator driver can use either of two underlying hardware blocks:

Generally, a set of pins can only connect to either an Opamp or an LPComp but not both. In the event that both connections are possible, the LPComp will be preferred.

Power Level Mapping

The following table shows how the HAL-defined power levels map to the hardware-specific power levels. For the LPComp, some levels are named differently between CAT1 & CAT2. In this case, the differences are in brackets, with the first item being for CAT1 and the second for CAT2.

HAL Power Level Opamp Power Level LPComp Power Level
CYHAL_POWER_LEVEL_HIGH CY_CTB_POWER_HIGH CY_LPCOMP_MODE_[NORMAL/FAST]
CYHAL_POWER_LEVEL_MEDIUM CY_CTB_POWER_MEDIUM CY_LPCOMP_MODE_[LP/SLOW]
CYHAL_POWER_LEVEL_LOW CY_CTB_POWER_LOW CY_LPCOMP_MODE_ULP
CYHAL_POWER_LEVEL_DEFAULT CY_CTB_POWER_MEDIUM CY_LPCOMP_MODE_[LP/SLOW]