| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules | Data Structures | Macros | Typedefs | Functions
LPCOMP driver
LPCOMP HAL and driver

Low Power Comparator (LPCOMP) driver. More...

## Modules
| LPCOMP peripheral driver configuration

## 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...

## Detailed Description

Low Power Comparator (LPCOMP) driver.

## Macro Definition Documentation

#define NRF_DRV_LPCONF_DEFAULT_CONFIG

Value:
{ \
.hal = {(nrf_lpcomp_ref_t)LPCOMP_CONFIG_REFERENCE , (nrf_lpcomp_detect_t)LPCOMP_CONFIG_DETECTION}, \
.input = (nrf_lpcomp_input_t)LPCOMP_CONFIG_INPUT, \
.interrupt_priority = LPCOMP_CONFIG_IRQ_PRIORITY \
}

LPCOMP driver default configuration including the LPCOMP HAL configuration.

## Typedef Documentation

typedef void(* lpcomp_events_handler_t)(nrf_lpcomp_event_t event)

LPCOMP event handler function type.

Parameters

  [in] | event | LPCOMP event.

## Function Documentation

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.

See Also
  nrf_drv_lpcomp_enable()

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.

See Also
  nrf_drv_lpcomp_disable()

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.

Parameters

  [in] | p_config | Initial configuration. If NULL, the default configuration is used.
  [in] | events_handler | Handler function.

Return values

  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.

See Also
  nrf_drv_lpcomp_disable()
  nrf_drv_lpcomp_init()