nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

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

Data Structures

struct  nrf_drv_lpcomp_config_t
 LPCOMP configuration. More...
 

Macros

#define NRF_DRV_LPCONF_DEFAULT_CONFIG
 

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 LCOMP 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 = {LPCOMP_CONFIG_REFERENCE , LPCOMP_CONFIG_DETECTION}, \
.input = 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]eventLPCOMP 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 LCOMP driver.

This function initializes the LPCOMP driver, but does not enable the peripheral nor any interrupts. To start the driver, the function nrf_drv_lpcomp_enable() should be executed after initialization.

Note
Driver will be initialized to default settings if configuration struct is not provided.
Parameters
[in]p_configInitial configuration. Default configuration used if NULL.
[in]events_handlerHandler function
Return values
NRF_ERROR_INVALID_PARAMIf the configuration is invalid.
NRF_ERROR_INVALID_STATEIf the driver has already been initialized.
void nrf_drv_lpcomp_uninit ( void  )

Function for uninitializing the LCOMP driver.

This function uninitializes the LCOMP 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()