Lines Matching +full:adc +full:- +full:config

4  * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/drivers/adc.h>
30 struct adc_dt_spec adc; member
41 const struct mcp970x_config *config = dev->config; in fetch() local
42 struct mcp970x_data *data = dev->data; in fetch()
46 return -ENOTSUP; in fetch()
49 ret = adc_read_dt(&config->adc, &data->sequence); in fetch()
59 const struct mcp970x_config *config = dev->config; in get() local
60 struct mcp970x_data *data = dev->data; in get()
61 int32_t raw_val = data->raw; in get()
68 return -ENOTSUP; in get()
71 ret = adc_raw_to_millivolts_dt(&config->adc, &raw_val); in get()
77 if (config->family == FAMILY_MCP9700_9700A) { in get()
78 t = (MC_PER_C * (raw_val - MV_AT_0C_MCP9700_9700A)) / T_COEFF_MCP9700_9700A; in get()
82 t = (MC_PER_C * 10 * (raw_val - MV_AT_0C_MCP9701_9701A)) / t_coeff; in get()
85 val->val1 = t / MC_PER_C; in get()
86 val->val2 = 1000 * (t % MC_PER_C); in get()
88 LOG_DBG("%d of %d, %dmV, %dmC", data->raw, (1 << data->sequence.resolution) - 1, raw_val, in get()
101 const struct mcp970x_config *config = dev->config; in init() local
102 struct mcp970x_data *data = dev->data; in init()
105 if (!adc_is_ready_dt(&config->adc)) { in init()
106 LOG_ERR("ADC is not ready"); in init()
107 return -ENODEV; in init()
110 ret = adc_channel_setup_dt(&config->adc); in init()
116 ret = adc_sequence_init_dt(&config->adc, &data->sequence); in init()
122 data->sequence.buffer = &data->raw; in init()
123 data->sequence.buffer_size = sizeof(data->raw); in init()
132 .adc = ADC_DT_SPEC_INST_GET(inst), \