Go to the source code of this file.
◆ adc_npcx_threshold_param_l_h
Enumerator |
---|
ADC_NPCX_THRESHOLD_PARAM_L_H_HIGHER | |
ADC_NPCX_THRESHOLD_PARAM_L_H_LOWER | |
◆ adc_npcx_threshold_param_type
Enumerator |
---|
ADC_NPCX_THRESHOLD_PARAM_CHNSEL | |
ADC_NPCX_THRESHOLD_PARAM_L_H | |
ADC_NPCX_THRESHOLD_PARAM_THVAL | |
ADC_NPCX_THRESHOLD_PARAM_WORK | |
ADC_NPCX_THRESHOLD_PARAM_MAX | |
◆ adc_npcx_threshold_ctrl_enable()
int adc_npcx_threshold_ctrl_enable |
( |
const struct device * |
dev, |
|
|
uint8_t |
th_sel, |
|
|
const bool |
enable |
|
) |
| |
Enables/Disables ADC threshold interruption.
- Note
- This function is available only if
CONFIG_ADC_CMP_NPCX
is selected.
- Parameters
-
dev | Pointer to the device structure for the driver instance. |
th_sel | Threshold selected. |
enable | Enable or disables threshold interruption. |
- Returns
- 0 on success, negative error code otherwise. all parameters must be configure prior enabling threshold interruption, otherwise error will be returned.
◆ adc_npcx_threshold_ctrl_set_param()
Set ADC threshold parameter.
- Note
- This function is available only if
CONFIG_ADC_CMP_NPCX
is selected.
- Parameters
-
dev | Pointer to the device structure for the driver instance. |
th_sel | Threshold selected. |
param | Pointer of parameter structure. See struct adc_npcx_threshold_param for supported parameters. |
- Returns
- 0 on success, negative error code otherwise.
◆ adc_npcx_threshold_mv_to_thrval()
Convert input value in millivolts to corresponding threshold register value.
- Note
- This function is available only if
CONFIG_ADC_CMP_NPCX
is selected.
- Parameters
-
dev | Pointer to the device structure for the driver instance. |
val_mv | Input value in millivolts to be converted. |
thrval | Pointer of variable to hold the result of conversion. |
- Returns
- 0 on success, negative result if input cannot be converted due to overflow.