Low Power Comparator (LPCOMP) driver. More...
Data Structures | |
struct | nrf_drv_lpcomp_config_t |
LPCOMP configuration. More... | |
Macros | |
#define | NRF_DRV_LPCONF_DEFAULT_CONFIG |
LPCOMP driver default configuration including the LPCOMP HAL configuration. More... | |
Typedefs | |
typedef void(* | lpcomp_events_handler_t )(nrf_lpcomp_event_t event) |
LPCOMP event handler function type. More... | |
Functions | |
ret_code_t | nrf_drv_lpcomp_init (const nrf_drv_lpcomp_config_t *p_config, lpcomp_events_handler_t events_handler) |
Function for initializing the LPCOMP driver. More... | |
void | nrf_drv_lpcomp_uninit (void) |
Function for uninitializing the LCOMP driver. More... | |
void | nrf_drv_lpcomp_enable (void) |
Function for enabling the LPCOMP peripheral and interrupts. More... | |
void | nrf_drv_lpcomp_disable (void) |
Function for disabling the LPCOMP peripheral. More... | |
Low Power Comparator (LPCOMP) driver.
#define NRF_DRV_LPCONF_DEFAULT_CONFIG |
LPCOMP driver default configuration including the LPCOMP HAL configuration.
typedef void(* lpcomp_events_handler_t)(nrf_lpcomp_event_t event) |
LPCOMP event handler function type.
[in] | event | LPCOMP event. |
void nrf_drv_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.
void nrf_drv_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.
ret_code_t nrf_drv_lpcomp_init | ( | const nrf_drv_lpcomp_config_t * | p_config, |
lpcomp_events_handler_t | events_handler | ||
) |
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 nrf_drv_lpcomp_enable() after initialization.
If no configuration structure is provided, the driver is initialized with the default settings.
[in] | p_config | Initial configuration. If NULL, the default configuration is used. |
[in] | events_handler | Handler function. |
NRF_ERROR_INVALID_PARAM | If the configuration is invalid. |
NRF_ERROR_INVALID_STATE | If the driver has already been initialized. |
void nrf_drv_lpcomp_uninit | ( | void | ) |
Function for uninitializing the LCOMP 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 nrf_drv_lpcomp_init() if you want to use it.