![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
This driver provides Analog comparator driver support for the device. The driver requires the following IP drivers:
IP: Analog comparator driver
Enumerations | |
| enum | CHIP_ACMP_POS_INPUT_T { ACMP_POSIN_VLO = (0 << 8), ACMP_POSIN_ACMP_I1 = (1 << 8), ACMP_POSIN_ACMP_I2 = (2 << 8), ACMP_POSIN_INT_REF = (6 << 8) } |
| enum | CHIP_ACMP_NEG_INPUT_T { ACMP_NEGIN_VLO = (0 << 11), ACMP_NEGIN_ACMP_I1 = (1 << 11), ACMP_NEGIN_ACMP_I2 = (2 << 11), ACMP_NEGIN_INT_REF = (6 << 11) } |
Functions | |
| void | Chip_ACMP_Init (LPC_CMP_T *pACMP) |
| Initializes the ACMP. | |
| void | Chip_ACMP_Deinit (LPC_CMP_T *pACMP) |
| Deinitializes the ACMP. | |
| STATIC INLINE uint32_t | Chip_ACMP_GetCompStatus (LPC_CMP_T *pACMP) |
| Returns the current comparator status. | |
| STATIC INLINE void | Chip_ACMP_EdgeClear (LPC_CMP_T *pACMP) |
| Clears the ACMP interrupt (EDGECLR bit) | |
| STATIC INLINE void | Chip_ACMP_SetEdgeSelection (LPC_CMP_T *pACMP, IP_ACMP_001_EDGESEL_T edgeSel) |
| Sets up ACMP edge selection. | |
| STATIC INLINE void | Chip_ACMP_EnableSyncCompOut (LPC_CMP_T *pACMP) |
| Synchronizes Comparator output to bus clock. | |
| STATIC INLINE void | Chip_ACMP_DisableSyncCompOut (LPC_CMP_T *pACMP) |
| Sets comparator output to be used directly (no sync) | |
| STATIC INLINE void | Chip_ACMP_SetPosVoltRef (LPC_CMP_T *pACMP, CHIP_ACMP_POS_INPUT_T Posinput) |
| Selects positive voltage input. | |
| STATIC INLINE void | Chip_ACMP_SetNegVoltRef (LPC_CMP_T *pACMP, CHIP_ACMP_NEG_INPUT_T Neginput) |
| Selects negative voltage input. | |
| STATIC INLINE void | Chip_ACMP_SetHysteresis (LPC_CMP_T *pACMP, IP_ACMP_HYS_001_T hys) |
| Selects hysteresis level. | |
| STATIC INLINE void | Chip_ACMP_SetupAMCPRefs (LPC_CMP_T *pACMP, IP_ACMP_001_EDGESEL_T edgeSel, CHIP_ACMP_POS_INPUT_T Posinput, CHIP_ACMP_NEG_INPUT_T Neginput, IP_ACMP_HYS_001_T hys) |
| Helper function for setting up ACMP control. | |
| STATIC INLINE void | Chip_ACMP_SetupVoltLadder (LPC_CMP_T *pACMP, uint32_t ladsel, bool ladrefVDDCMP) |
| Sets up voltage ladder. | |
| STATIC INLINE void | Chip_ACMP_EnableVoltLadder (LPC_CMP_T *pACMP) |
| Enables voltage ladder. | |
| STATIC INLINE void | Chip_ACMP_DisableVoltLadder (LPC_CMP_T *pACMP) |
| Disables voltage ladder. | |
Analog Comparator negative input values
Definition at line 60 of file acmp_8xx.h.
Analog Comparator positive input values
Definition at line 50 of file acmp_8xx.h.
| void Chip_ACMP_Deinit | ( | LPC_CMP_T * | pACMP | ) |
Deinitializes the ACMP.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 63 of file acmp_8xx.c.
Sets comparator output to be used directly (no sync)
| pACMP | : Pointer to Analog Comparator block |
Definition at line 127 of file acmp_8xx.h.
Disables voltage ladder.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 210 of file acmp_8xx.h.
Clears the ACMP interrupt (EDGECLR bit)
| pACMP | : Pointer to Analog Comparator block |
Definition at line 96 of file acmp_8xx.h.
Synchronizes Comparator output to bus clock.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 117 of file acmp_8xx.h.
Enables voltage ladder.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 200 of file acmp_8xx.h.
Returns the current comparator status.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 86 of file acmp_8xx.h.
| void Chip_ACMP_Init | ( | LPC_CMP_T * | pACMP | ) |
Initializes the ACMP.
| pACMP | : Pointer to Analog Comparator block |
Definition at line 51 of file acmp_8xx.c.
| STATIC INLINE void Chip_ACMP_SetEdgeSelection | ( | LPC_CMP_T * | pACMP, |
| IP_ACMP_001_EDGESEL_T | edgeSel | ||
| ) |
Sets up ACMP edge selection.
| pACMP | : Pointer to Analog Comparator block |
| edgeSel | : Edge selection value |
Definition at line 107 of file acmp_8xx.h.
| STATIC INLINE void Chip_ACMP_SetHysteresis | ( | LPC_CMP_T * | pACMP, |
| IP_ACMP_HYS_001_T | hys | ||
| ) |
Selects hysteresis level.
| pACMP | : Pointer to Analog Comparator block |
| hys | : Selected Hysteresis level |
Definition at line 160 of file acmp_8xx.h.
| STATIC INLINE void Chip_ACMP_SetNegVoltRef | ( | LPC_CMP_T * | pACMP, |
| CHIP_ACMP_NEG_INPUT_T | Neginput | ||
| ) |
Selects negative voltage input.
| pACMP | : Pointer to Analog Comparator block |
| Neginput | : one of the negative input voltage sources |
Definition at line 149 of file acmp_8xx.h.
| STATIC INLINE void Chip_ACMP_SetPosVoltRef | ( | LPC_CMP_T * | pACMP, |
| CHIP_ACMP_POS_INPUT_T | Posinput | ||
| ) |
Selects positive voltage input.
| pACMP | : Pointer to Analog Comparator block |
| Posinput | : one of the positive input voltage sources |
Definition at line 138 of file acmp_8xx.h.
| STATIC INLINE void Chip_ACMP_SetupAMCPRefs | ( | LPC_CMP_T * | pACMP, |
| IP_ACMP_001_EDGESEL_T | edgeSel, | ||
| CHIP_ACMP_POS_INPUT_T | Posinput, | ||
| CHIP_ACMP_NEG_INPUT_T | Neginput, | ||
| IP_ACMP_HYS_001_T | hys | ||
| ) |
Helper function for setting up ACMP control.
| pACMP | : Pointer to Analog Comparator block |
| edgeSel | : Edge selection value |
| Posinput | : one of the positive input voltage sources |
| Neginput | : one of the negative input voltage sources |
| hys | : Selected Hysteresis level |
Definition at line 174 of file acmp_8xx.h.
| STATIC INLINE void Chip_ACMP_SetupVoltLadder | ( | LPC_CMP_T * | pACMP, |
| uint32_t | ladsel, | ||
| bool | ladrefVDDCMP | ||
| ) |
Sets up voltage ladder.
| pACMP | : Pointer to Analog Comparator block |
| ladsel | : Voltage ladder value (0 .. 31) |
| ladrefVDDCMP | : Selects the reference voltage Vref for the voltage ladder : false for VDD, true for VDDCMP pin |
Definition at line 190 of file acmp_8xx.h.