Zephyr API 3.6.99
Loading...
Searching...
No Matches
nrf_comp.h File Reference

Go to the source code of this file.

Data Structures

struct  comp_nrf_comp_se_config
 Single-ended mode configuration structure. More...
 
struct  comp_nrf_comp_diff_config
 Differential mode configuration structure. More...
 

Enumerations

enum  comp_nrf_comp_psel {
  COMP_NRF_COMP_PSEL_AIN0 , COMP_NRF_COMP_PSEL_AIN1 , COMP_NRF_COMP_PSEL_AIN2 , COMP_NRF_COMP_PSEL_AIN3 ,
  COMP_NRF_COMP_PSEL_AIN4 , COMP_NRF_COMP_PSEL_AIN5 , COMP_NRF_COMP_PSEL_AIN6 , COMP_NRF_COMP_PSEL_AIN7 ,
  COMP_NRF_COMP_PSEL_VDD_DIV2 , COMP_NRF_COMP_PSEL_VDDH_DIV5
}
 Positive input selection. More...
 
enum  comp_nrf_comp_extrefsel {
  COMP_NRF_COMP_EXTREFSEL_AIN0 , COMP_NRF_COMP_EXTREFSEL_AIN1 , COMP_NRF_COMP_EXTREFSEL_AIN2 , COMP_NRF_COMP_EXTREFSEL_AIN3 ,
  COMP_NRF_COMP_EXTREFSEL_AIN4 , COMP_NRF_COMP_EXTREFSEL_AIN5 , COMP_NRF_COMP_EXTREFSEL_AIN6 , COMP_NRF_COMP_EXTREFSEL_AIN7
}
 External reference selection. More...
 
enum  comp_nrf_comp_refsel {
  COMP_NRF_COMP_REFSEL_INT_1V2 , COMP_NRF_COMP_REFSEL_INT_1V8 , COMP_NRF_COMP_REFSEL_INT_2V4 , COMP_NRF_COMP_REFSEL_AVDDAO1V8 ,
  COMP_NRF_COMP_REFSEL_VDD , COMP_NRF_COMP_REFSEL_AREF
}
 Reference selection. More...
 
enum  comp_nrf_comp_sp_mode { COMP_NRF_COMP_SP_MODE_LOW , COMP_NRF_COMP_SP_MODE_NORMAL , COMP_NRF_COMP_SP_MODE_HIGH }
 Speed mode selection. More...
 
enum  comp_nrf_comp_isource { COMP_NRF_COMP_ISOURCE_DISABLED , COMP_NRF_COMP_ISOURCE_2UA5 , COMP_NRF_COMP_ISOURCE_5UA , COMP_NRF_COMP_ISOURCE_10UA }
 Current source configuration. More...
 

Functions

int comp_nrf_comp_configure_se (const struct device *dev, const struct comp_nrf_comp_se_config *config)
 Configure comparator in single-ended mode.
 
int comp_nrf_comp_configure_diff (const struct device *dev, const struct comp_nrf_comp_diff_config *config)
 Configure comparator in differential mode.
 

Enumeration Type Documentation

◆ comp_nrf_comp_extrefsel

External reference selection.

Enumerator
COMP_NRF_COMP_EXTREFSEL_AIN0 

AIN0 external input.

COMP_NRF_COMP_EXTREFSEL_AIN1 

AIN1 external input.

COMP_NRF_COMP_EXTREFSEL_AIN2 

AIN2 external input.

COMP_NRF_COMP_EXTREFSEL_AIN3 

AIN3 external input.

COMP_NRF_COMP_EXTREFSEL_AIN4 

AIN4 external input.

COMP_NRF_COMP_EXTREFSEL_AIN5 

AIN5 external input.

COMP_NRF_COMP_EXTREFSEL_AIN6 

AIN6 external input.

COMP_NRF_COMP_EXTREFSEL_AIN7 

AIN7 external input.

◆ comp_nrf_comp_isource

Current source configuration.

Enumerator
COMP_NRF_COMP_ISOURCE_DISABLED 

Current source disabled.

COMP_NRF_COMP_ISOURCE_2UA5 

2.5uA current source enabled

COMP_NRF_COMP_ISOURCE_5UA 

5uA current source enabled

COMP_NRF_COMP_ISOURCE_10UA 

10uA current source enabled

◆ comp_nrf_comp_psel

Positive input selection.

Enumerator
COMP_NRF_COMP_PSEL_AIN0 

AIN0 external input.

COMP_NRF_COMP_PSEL_AIN1 

AIN1 external input.

COMP_NRF_COMP_PSEL_AIN2 

AIN2 external input.

COMP_NRF_COMP_PSEL_AIN3 

AIN3 external input.

COMP_NRF_COMP_PSEL_AIN4 

AIN4 external input.

COMP_NRF_COMP_PSEL_AIN5 

AIN5 external input.

COMP_NRF_COMP_PSEL_AIN6 

AIN6 external input.

COMP_NRF_COMP_PSEL_AIN7 

AIN7 external input.

COMP_NRF_COMP_PSEL_VDD_DIV2 

VDD / 2.

COMP_NRF_COMP_PSEL_VDDH_DIV5 

VDDH / 5.

◆ comp_nrf_comp_refsel

Reference selection.

Enumerator
COMP_NRF_COMP_REFSEL_INT_1V2 

Internal 1.2V reference.

COMP_NRF_COMP_REFSEL_INT_1V8 

Internal 1.8V reference.

COMP_NRF_COMP_REFSEL_INT_2V4 

Internal 2.4V reference.

COMP_NRF_COMP_REFSEL_AVDDAO1V8 

AVDD 1.8V reference.

COMP_NRF_COMP_REFSEL_VDD 

VDD reference.

COMP_NRF_COMP_REFSEL_AREF 

Use external analog reference.

◆ comp_nrf_comp_sp_mode

Speed mode selection.

Enumerator
COMP_NRF_COMP_SP_MODE_LOW 

Low-power mode.

COMP_NRF_COMP_SP_MODE_NORMAL 

Normal mode.

COMP_NRF_COMP_SP_MODE_HIGH 

High-speed mode.

Function Documentation

◆ comp_nrf_comp_configure_diff()

int comp_nrf_comp_configure_diff ( const struct device * dev,
const struct comp_nrf_comp_diff_config * config )

Configure comparator in differential mode.

Parameters
devComparator device instance
configDifferential mode configuration
Return values
0if successful
negativeerrno-code otherwise

◆ comp_nrf_comp_configure_se()

int comp_nrf_comp_configure_se ( const struct device * dev,
const struct comp_nrf_comp_se_config * config )

Configure comparator in single-ended mode.

Parameters
devComparator device instance
configSingle-ended mode configuration
Return values
0if successful
negativeerrno-code otherwise