The MCUXpresso SDK provides a peripheral driver for the cmp driver module of MCUXpresso SDK devices.
|
enum | _cmp_vref_select {
KCMP_VREFSelectVDDA = 1U,
KCMP_VREFSelectInternalVREF = 0U
} |
| VREF select. More...
|
|
enum | cmp_interrupt_type_t {
kCMP_EdgeDisable = 0U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_EdgeRising = 2U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_EdgeFalling = 4U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_EdgeRisingFalling = 6U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_LevelDisable = 1U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_LevelHigh = 3U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_LevelLow = 5U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT,
kCMP_LevelDisable1 = 7U << SYSCON_COMP_INT_CTRL_INT_CTRL_SHIFT
} |
| cmp interrupt type More...
|
|
enum | cmp_pmux_input_t {
kCMP_PInputVREF = 0U << PMC_COMP_PMUX_SHIFT,
kCMP_PInputP0_0 = 1U << PMC_COMP_PMUX_SHIFT,
kCMP_PInputP0_9 = 2U << PMC_COMP_PMUX_SHIFT,
kCMP_PInputP0_18 = 3U << PMC_COMP_PMUX_SHIFT,
kCMP_PInputP1_14 = 4U << PMC_COMP_PMUX_SHIFT,
kCMP_PInputP2_23 = 5U << PMC_COMP_PMUX_SHIFT
} |
| cmp Pmux input source More...
|
|
enum | cmp_nmux_input_t {
kCMP_NInputVREF = 0U << PMC_COMP_NMUX_SHIFT,
kCMP_NInputP0_0 = 1U << PMC_COMP_NMUX_SHIFT,
kCMP_NInputP0_9 = 2U << PMC_COMP_NMUX_SHIFT,
kCMP_NInputP0_18 = 3U << PMC_COMP_NMUX_SHIFT,
kCMP_NInputP1_14 = 4U << PMC_COMP_NMUX_SHIFT,
kCMP_NInputP2_23 = 5U << PMC_COMP_NMUX_SHIFT
} |
| cmp Nmux input source More...
|
|
Enumerator |
---|
KCMP_VREFSelectVDDA |
Select VDDA as VREF.
|
KCMP_VREFSelectInternalVREF |
select internal VREF as VREF
|
Enumerator |
---|
kCMP_EdgeDisable |
disable edge sensitive
|
kCMP_EdgeRising |
Edge sensitive, falling edge.
|
kCMP_EdgeFalling |
Edge sensitive, rising edge.
|
kCMP_EdgeRisingFalling |
Edge sensitive, rising and falling edge.
|
kCMP_LevelDisable |
disable level sensitive
|
kCMP_LevelHigh |
Level sensitive, high level.
|
kCMP_LevelLow |
Level sensitive, low level.
|
kCMP_LevelDisable1 |
disable level sensitive
|
Enumerator |
---|
kCMP_PInputVREF |
Cmp Pmux input from VREF.
|
kCMP_PInputP0_0 |
Cmp Pmux input from P0_0.
|
kCMP_PInputP0_9 |
Cmp Pmux input from P0_9.
|
kCMP_PInputP0_18 |
Cmp Pmux input from P0_18.
|
kCMP_PInputP1_14 |
Cmp Pmux input from P1_14.
|
kCMP_PInputP2_23 |
Cmp Pmux input from P2_23.
|
Enumerator |
---|
kCMP_NInputVREF |
Cmp Nmux input from VREF.
|
kCMP_NInputP0_0 |
Cmp Nmux input from P0_0.
|
kCMP_NInputP0_9 |
Cmp Nmux input from P0_9.
|
kCMP_NInputP0_18 |
Cmp Nmux input from P0_18.
|
kCMP_NInputP1_14 |
Cmp Nmux input from P1_14.
|
kCMP_NInputP2_23 |
Cmp Nmux input from P2_23.
|
Note: The cmp initial function not responsible for cmp power, application shall handle it.
- Parameters
-
config | init configurations. |
Note: The cmp deinit function not responsible for cmp power, application shall handle it.
- Parameters
-
pmux_select_source | reference cmp_pmux_input_t above. |
- Parameters
-
nmux_select_source | reference cmp_nmux_input_t above. |
static void CMP_EnableLowePowerMode |
( |
bool |
enable | ) |
|
|
inlinestatic |
- Parameters
-
enable | true is enter low power mode, false is enter fast mode |
static void CMP_SetRefStep |
( |
uint32_t |
step | ) |
|
|
inlinestatic |
- Parameters
-
step | reference voltage step, per steps of (VREFINPUT/31). |
static void CMP_VREFSelect |
( |
uint32_t |
select | ) |
|
|
inlinestatic |
- Parameters
-
select | 1 is Select VDDA, 0 is Select internal VREF. |
static uint32_t CMP_GetOutput |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- 1 indicates p is greater than n, 0 indicates n is greater than p.
static void CMP_InterruptSourceSelect |
( |
bool |
enable | ) |
|
|
inlinestatic |
- Parameters
-
enable | true is Select Analog Comparator raw output (unfiltered) as input for interrupt detection. false is Select Analog Comparator filtered output as input for interrupt detection. |
static bool CMP_GetStatus |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- true is interrupt pending, false is no interrupt pending.
- Parameters
-
type | reference cmp_interrupt_type_t. |
static bool CMP_GetInterruptStatus |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- true is interrupt pending, false is no interrupt pending.