Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
adc_npcx_threshold.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef _ADC_NPCX_THRESHOLD_H_
8#define _ADC_NPCX_THRESHOLD_H_
9
10#include <zephyr/device.h>
11
16
18 /* Selects ADC channel to be used for measurement */
20 /* Sets relation between measured value and assetion threshold value.*/
22 /* Sets the threshold value to which measured data is compared. */
24 /* Sets worker queue thread to be notified */
26
28};
29
31 /* Threshold ocntrol parameter */
33 /* Parameter value */
35};
36
51int adc_npcx_threshold_mv_to_thrval(const struct device *dev, uint32_t val_mv,
52 uint32_t *thrval);
53
69 const uint8_t th_sel,
70 const struct adc_npcx_threshold_param
71 *param);
72
87int adc_npcx_threshold_ctrl_enable(const struct device *dev, uint8_t th_sel,
88 const bool enable);
89
90#endif /*_ADC_NPCX_THRESHOLD_H_ */
adc_npcx_threshold_param_l_h
Definition adc_npcx_threshold.h:12
@ ADC_NPCX_THRESHOLD_PARAM_L_H_LOWER
Definition adc_npcx_threshold.h:14
@ ADC_NPCX_THRESHOLD_PARAM_L_H_HIGHER
Definition adc_npcx_threshold.h:13
adc_npcx_threshold_param_type
Definition adc_npcx_threshold.h:17
@ ADC_NPCX_THRESHOLD_PARAM_WORK
Definition adc_npcx_threshold.h:25
@ ADC_NPCX_THRESHOLD_PARAM_MAX
Definition adc_npcx_threshold.h:27
@ ADC_NPCX_THRESHOLD_PARAM_CHNSEL
Definition adc_npcx_threshold.h:19
@ ADC_NPCX_THRESHOLD_PARAM_L_H
Definition adc_npcx_threshold.h:21
@ ADC_NPCX_THRESHOLD_PARAM_THVAL
Definition adc_npcx_threshold.h:23
int adc_npcx_threshold_ctrl_set_param(const struct device *dev, const uint8_t th_sel, const struct adc_npcx_threshold_param *param)
Set ADC threshold parameter.
int adc_npcx_threshold_ctrl_enable(const struct device *dev, uint8_t th_sel, const bool enable)
Enables/Disables ADC threshold interruption.
int adc_npcx_threshold_mv_to_thrval(const struct device *dev, uint32_t val_mv, uint32_t *thrval)
Convert input value in millivolts to corresponding threshold register value.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Definition adc_npcx_threshold.h:30
uint32_t val
Definition adc_npcx_threshold.h:34
enum adc_npcx_threshold_param_type type
Definition adc_npcx_threshold.h:32
Runtime device structure (in ROM) per driver instance.
Definition device.h:412