Low Power Comparator (LPCOMP) peripheral driver.
More...
Low Power Comparator (LPCOMP) peripheral driver.
◆ NRFX_LPCOMP_DEFAULT_CONFIG
#define NRFX_LPCOMP_DEFAULT_CONFIG |
( |
|
_input | ) |
|
Value:{ \
.interrupt_priority = NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY \
}
uint32_t nrf_lpcomp_input_t
LPCOMP input selection.
Definition: nrf_lpcomp.h:119
@ NRF_LPCOMP_REF_SUPPLY_4_8
Use supply with a 4/8 prescaler as reference.
Definition: nrf_lpcomp.h:76
@ NRF_LPCOMP_DETECT_CROSS
Generate ANADETEC on crossing, both upwards and downwards crossing.
Definition: nrf_lpcomp.h:137
@ NRF_LPCOMP_HYST_NOHYST
Comparator hysteresis disabled.
Definition: nrf_lpcomp.h:149
LPCOMP driver default configuration.
This configuration sets up LPCOMP with the following options:
- reference voltage: 4/8 of supply voltage
- detection of both up and down crossings
- hysteresis disabled
- Parameters
-
[in] | _input | Comparator input pin. |
◆ nrfx_lpcomp_event_handler_t
LPCOMP event handler function type.
- Parameters
-
◆ nrfx_lpcomp_disable()
void nrfx_lpcomp_disable |
( |
void |
| ) |
|
Function for disabling the LPCOMP peripheral.
Before calling this function, the driver must be initialized. This function disables the LPCOMP peripheral and its interrupts.
- See also
- nrfx_lpcomp_enable
◆ nrfx_lpcomp_enable()
void nrfx_lpcomp_enable |
( |
void |
| ) |
|
Function for enabling the LPCOMP peripheral and interrupts.
Before calling this function, the driver must be initialized. This function enables the LPCOMP peripheral and its interrupts.
- See also
- nrfx_lpcomp_disable
◆ nrfx_lpcomp_init()
Function for initializing the LPCOMP driver.
This function initializes the LPCOMP driver, but does not enable the peripheral or any interrupts. To start the driver, call the function nrfx_lpcomp_enable() after initialization.
- Parameters
-
[in] | p_config | Pointer to the structure with the initial configuration. |
[in] | event_handler | Event handler provided by the user. Must not be NULL. |
- Return values
-
NRFX_SUCCESS | Initialization was successful. |
NRFX_ERROR_ALREADY | The driver is already initialized. |
NRFX_ERROR_INVALID_STATE | The driver is already initialized. Deprecated - use NRFX_ERROR_ALREADY instead. |
NRFX_ERROR_BUSY | The COMP peripheral is already in use. This is possible only if Peripheral Resource Sharing (PRS) module is enabled. |
◆ nrfx_lpcomp_init_check()
bool nrfx_lpcomp_init_check |
( |
void |
| ) |
|
Function for checking if the LPCOMP driver is initialized.
- Return values
-
true | Driver is already initialized. |
false | Driver is not initialized. |
◆ nrfx_lpcomp_uninit()
void nrfx_lpcomp_uninit |
( |
void |
| ) |
|
Function for uninitializing the LPCOMP driver.
This function uninitializes the LPCOMP driver. The LPCOMP peripheral and its interrupts are disabled, and local variables are cleaned. After this call, you must initialize the driver again by calling nrfx_lpcomp_init() if you want to use it.
- See also
- nrfx_lpcomp_disable
-
nrfx_lpcomp_init