Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
nrf_lpcomp.h File Reference

Go to the source code of this file.

Data Structures

struct  comp_nrf_lpcomp_config
 Configuration structure. More...
 

Enumerations

enum  comp_nrf_lpcomp_psel {
  COMP_NRF_LPCOMP_PSEL_AIN0 , COMP_NRF_LPCOMP_PSEL_AIN1 , COMP_NRF_LPCOMP_PSEL_AIN2 , COMP_NRF_LPCOMP_PSEL_AIN3 ,
  COMP_NRF_LPCOMP_PSEL_AIN4 , COMP_NRF_LPCOMP_PSEL_AIN5 , COMP_NRF_LPCOMP_PSEL_AIN6 , COMP_NRF_LPCOMP_PSEL_AIN7
}
 Positive input selection. More...
 
enum  comp_nrf_lpcomp_extrefsel { COMP_NRF_LPCOMP_EXTREFSEL_AIN0 , COMP_NRF_LPCOMP_EXTREFSEL_AIN1 }
 External reference selection. More...
 
enum  comp_nrf_lpcomp_refsel {
  COMP_NRF_LPCOMP_REFSEL_VDD_1_8 , COMP_NRF_LPCOMP_REFSEL_VDD_2_8 , COMP_NRF_LPCOMP_REFSEL_VDD_3_8 , COMP_NRF_LPCOMP_REFSEL_VDD_4_8 ,
  COMP_NRF_LPCOMP_REFSEL_VDD_5_8 , COMP_NRF_LPCOMP_REFSEL_VDD_6_8 , COMP_NRF_LPCOMP_REFSEL_VDD_7_8 , COMP_NRF_LPCOMP_REFSEL_VDD_1_16 ,
  COMP_NRF_LPCOMP_REFSEL_VDD_3_16 , COMP_NRF_LPCOMP_REFSEL_VDD_5_16 , COMP_NRF_LPCOMP_REFSEL_VDD_7_16 , COMP_NRF_LPCOMP_REFSEL_VDD_9_16 ,
  COMP_NRF_LPCOMP_REFSEL_VDD_11_16 , COMP_NRF_LPCOMP_REFSEL_VDD_13_16 , COMP_NRF_LPCOMP_REFSEL_VDD_15_16 , COMP_NRF_LPCOMP_REFSEL_AREF
}
 Reference selection. More...
 

Functions

int comp_nrf_lpcomp_configure (const struct device *dev, const struct comp_nrf_lpcomp_config *config)
 Configure comparator.
 

Enumeration Type Documentation

◆ comp_nrf_lpcomp_extrefsel

External reference selection.

Enumerator
COMP_NRF_LPCOMP_EXTREFSEL_AIN0 

AIN0 external input.

COMP_NRF_LPCOMP_EXTREFSEL_AIN1 

AIN1 external input.

◆ comp_nrf_lpcomp_psel

Positive input selection.

Enumerator
COMP_NRF_LPCOMP_PSEL_AIN0 

AIN0 external input.

COMP_NRF_LPCOMP_PSEL_AIN1 

AIN1 external input.

COMP_NRF_LPCOMP_PSEL_AIN2 

AIN2 external input.

COMP_NRF_LPCOMP_PSEL_AIN3 

AIN3 external input.

COMP_NRF_LPCOMP_PSEL_AIN4 

AIN4 external input.

COMP_NRF_LPCOMP_PSEL_AIN5 

AIN5 external input.

COMP_NRF_LPCOMP_PSEL_AIN6 

AIN6 external input.

COMP_NRF_LPCOMP_PSEL_AIN7 

AIN7 external input.

◆ comp_nrf_lpcomp_refsel

Reference selection.

Enumerator
COMP_NRF_LPCOMP_REFSEL_VDD_1_8 

Use (VDD * (1/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_2_8 

Use (VDD * (2/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_3_8 

Use (VDD * (3/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_4_8 

Use (VDD * (4/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_5_8 

Use (VDD * (5/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_6_8 

Use (VDD * (6/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_7_8 

Use (VDD * (7/8)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_1_16 

Use (VDD * (1/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_3_16 

Use (VDD * (3/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_5_16 

Use (VDD * (5/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_7_16 

Use (VDD * (7/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_9_16 

Use (VDD * (9/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_11_16 

Use (VDD * (11/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_13_16 

Use (VDD * (13/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_VDD_15_16 

Use (VDD * (15/16)) as reference.

COMP_NRF_LPCOMP_REFSEL_AREF 

Use external analog reference.

Function Documentation

◆ comp_nrf_lpcomp_configure()

int comp_nrf_lpcomp_configure ( const struct device * dev,
const struct comp_nrf_lpcomp_config * config )

Configure comparator.

Parameters
devComparator device instance
configConfiguration
Return values
0if successful
negativeerrno-code otherwise