This set of functions are specific to the comparator mode.
|
void | Cy_CTB_CompSetConfig (CTBM_Type *base, cy_en_ctb_opamp_sel_t compNum, cy_en_ctb_comp_level_t level, cy_en_ctb_comp_bypass_t bypass, cy_en_ctb_comp_hyst_t hyst) |
| Configure the CTB comparator for pulse or level output, to bypass clock synchronization, and to enable hysteresis. More...
|
|
uint32_t | Cy_CTB_CompGetConfig (const CTBM_Type *base, cy_en_ctb_opamp_sel_t compNum) |
| Return the CTB comparator operating configuration as set by Cy_CTB_CompSetConfig. More...
|
|
void | Cy_CTB_CompSetInterruptEdgeType (CTBM_Type *base, cy_en_ctb_opamp_sel_t compNum, cy_en_ctb_comp_edge_t edge) |
| Configure the type of edge that will trigger a comparator interrupt. More...
|
|
uint32_t | Cy_CTB_CompGetStatus (const CTBM_Type *base, cy_en_ctb_opamp_sel_t compNum) |
| Return the comparator output status. More...
|
|
◆ Cy_CTB_CompSetConfig()
Configure the CTB comparator for pulse or level output, to bypass clock synchronization, and to enable hysteresis.
- Parameters
-
base | Pointer to structure describing registers |
compNum | CY_CTB_OPAMP_0, CY_CTB_OPAMP_1, or CY_CTB_OPAMP_BOTH |
level | Configure output to produce a pulse or level output signal |
bypass | Configure output to be clock synchronized or unsynchronized |
hyst | Enable or disable input hysteresis |
- Returns
- None
- Function Usage
◆ Cy_CTB_CompGetConfig()
◆ Cy_CTB_CompSetInterruptEdgeType()
Configure the type of edge that will trigger a comparator interrupt.
- Parameters
-
- Returns
- None
- Function Usage
◆ Cy_CTB_CompGetStatus()
Return the comparator output status.
When the positive input voltage is greater than the negative input voltage, the comparator status is high. Otherwise, the status is low.
- Parameters
-
- Returns
- The comparator status. A value of 0 is returned if compNum is invalid.
- 0: Status is low
- 1: Status is high
- Function Usage
uint32_t status;
if (1UL == status)
{
}
else
{
}