/Zephyr-Core-3.4.0/drivers/dma/ |
D | dma_pl330.c | 168 struct dma_pl330_ch_config *channel_cfg; in dma_pl330_setup_ch() local 172 channel_cfg = &dev_data->channels[ch]; in dma_pl330_setup_ch() 173 dma_exec_addr = channel_cfg->dma_exec_addr; in dma_pl330_setup_ch() 265 struct dma_pl330_ch_config *channel_cfg; in dma_pl330_start_dma_ch() local 269 channel_cfg = &dev_data->channels[ch]; in dma_pl330_start_dma_ch() 283 sys_write32(channel_cfg->dma_exec_addr, in dma_pl330_start_dma_ch() 321 struct dma_pl330_ch_config *channel_cfg; in dma_pl330_xfer() local 326 channel_cfg = &dev_data->channels[channel]; in dma_pl330_xfer() 327 ch_handle = &channel_cfg->internal; in dma_pl330_xfer() 338 dma_pl330_config_channel(channel_cfg, dst, src, size); in dma_pl330_xfer() [all …]
|
D | dma_sam_xdmac.c | 57 struct sam_xdmac_channel_cfg *channel_cfg; in sam_xdmac_isr() local 69 channel_cfg = &dev_data->dma_channels[channel]; in sam_xdmac_isr() 75 if (channel_cfg->callback) { in sam_xdmac_isr() 76 channel_cfg->callback(dev, channel_cfg->user_data, in sam_xdmac_isr() 182 struct sam_xdmac_channel_config channel_cfg; in sam_xdmac_config() local 231 channel_cfg.cfg = in sam_xdmac_config() 238 channel_cfg.cfg = in sam_xdmac_config() 245 channel_cfg.cfg = in sam_xdmac_config() 257 channel_cfg.cfg |= in sam_xdmac_config() 262 channel_cfg.ds_msp = 0U; in sam_xdmac_config() [all …]
|
/Zephyr-Core-3.4.0/drivers/adc/ |
D | adc_ads1x1x.c | 289 const struct adc_channel_cfg *channel_cfg) in ads1x1x_channel_setup() argument 296 if (channel_cfg->channel_id != 0) { in ads1x1x_channel_setup() 297 LOG_ERR("unsupported channel id '%d'", channel_cfg->channel_id); in ads1x1x_channel_setup() 301 if (channel_cfg->reference != ADC_REF_INTERNAL) { in ads1x1x_channel_setup() 302 LOG_ERR("unsupported channel reference type '%d'", channel_cfg->reference); in ads1x1x_channel_setup() 308 if (channel_cfg->differential) { in ads1x1x_channel_setup() 309 if (channel_cfg->input_positive == 0 && channel_cfg->input_negative == 1) { in ads1x1x_channel_setup() 311 } else if (channel_cfg->input_positive == 0 && in ads1x1x_channel_setup() 312 channel_cfg->input_negative == 3) { in ads1x1x_channel_setup() 314 } else if (channel_cfg->input_positive == 1 && in ads1x1x_channel_setup() [all …]
|
D | adc_smartbond_sdadc.c | 51 const struct adc_channel_cfg *channel_cfg) in sdadc_smartbond_channel_setup() argument 53 uint8_t channel_id = channel_cfg->channel_id; in sdadc_smartbond_channel_setup() 60 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in sdadc_smartbond_channel_setup() 65 if (channel_cfg->input_positive > SMARTBOND_SDADC_VBAT) { in sdadc_smartbond_channel_setup() 69 if (channel_cfg->differential) { in sdadc_smartbond_channel_setup() 70 if (channel_cfg->input_negative >= SMARTBOND_SDADC_VBAT) { in sdadc_smartbond_channel_setup() 77 if ((channel_cfg->input_positive == SMARTBOND_SDADC_VBAT && in sdadc_smartbond_channel_setup() 78 channel_cfg->gain != ADC_GAIN_1_4) || in sdadc_smartbond_channel_setup() 79 (channel_cfg->input_positive != SMARTBOND_SDADC_VBAT && in sdadc_smartbond_channel_setup() 80 channel_cfg->gain != ADC_GAIN_1)) { in sdadc_smartbond_channel_setup() [all …]
|
D | adc_ifx_cat1.c | 97 const struct adc_channel_cfg *channel_cfg) in ifx_cat1_adc_channel_setup() argument 102 cyhal_gpio_t vplus = CYHAL_GET_GPIO(_ADCSAR_PORT, channel_cfg->input_positive); in ifx_cat1_adc_channel_setup() 103 cyhal_gpio_t vminus = channel_cfg->differential ? in ifx_cat1_adc_channel_setup() 104 CYHAL_GET_GPIO(_ADCSAR_PORT, channel_cfg->input_negative) : in ifx_cat1_adc_channel_setup() 108 if (channel_cfg->reference != ADC_REF_INTERNAL) { in ifx_cat1_adc_channel_setup() 113 if (channel_cfg->gain != ADC_GAIN_1) { in ifx_cat1_adc_channel_setup() 118 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in ifx_cat1_adc_channel_setup() 119 switch (ADC_ACQ_TIME_UNIT(channel_cfg->acquisition_time)) { in ifx_cat1_adc_channel_setup() 121 acquisition_ns = ADC_ACQ_TIME_VALUE(channel_cfg->acquisition_time) * 1000; in ifx_cat1_adc_channel_setup() 124 acquisition_ns = ADC_ACQ_TIME_VALUE(channel_cfg->acquisition_time); in ifx_cat1_adc_channel_setup() [all …]
|
D | adc_sam.c | 67 const struct adc_channel_cfg *channel_cfg) in adc_sam_channel_setup() argument 72 uint8_t channel_id = channel_cfg->channel_id; in adc_sam_channel_setup() 74 if (channel_cfg->differential) { in adc_sam_channel_setup() 75 if (channel_id != (channel_cfg->input_positive / 2U) in adc_sam_channel_setup() 76 || channel_id != (channel_cfg->input_negative / 2U)) { in adc_sam_channel_setup() 81 if (channel_id != channel_cfg->input_positive) { in adc_sam_channel_setup() 87 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in adc_sam_channel_setup() 92 if (channel_cfg->reference != ADC_REF_EXTERNAL0) { in adc_sam_channel_setup() 93 LOG_ERR("Invalid ADC channel reference (%d)", channel_cfg->reference); in adc_sam_channel_setup() 98 if (channel_cfg->channel_id == SAM_ADC_TEMP_CHANNEL) { in adc_sam_channel_setup() [all …]
|
D | adc_b91.c | 275 const struct adc_channel_cfg *channel_cfg) in adc_b91_channel_setup() argument 287 if (channel_cfg->channel_id > 0) { in adc_b91_channel_setup() 293 if (channel_cfg->reference != ADC_REF_INTERNAL) { in adc_b91_channel_setup() 328 switch (channel_cfg->gain) { in adc_b91_channel_setup() 341 switch (channel_cfg->acquisition_time) { in adc_b91_channel_setup() 374 input_positive = adc_b91_get_pin(channel_cfg->input_positive); in adc_b91_channel_setup() 375 input_negative = adc_b91_get_pin(channel_cfg->input_negative); in adc_b91_channel_setup() 377 channel_cfg->differential) { in adc_b91_channel_setup() 380 } else if (channel_cfg->differential && (input_negative == (uint8_t)NOINPUTN)) { in adc_b91_channel_setup() 386 data->differential = channel_cfg->differential; in adc_b91_channel_setup() [all …]
|
D | adc_ads1119.c | 211 const struct adc_channel_cfg *channel_cfg) in ads1119_channel_setup() argument 217 if (channel_cfg->channel_id != 0) { in ads1119_channel_setup() 221 switch (channel_cfg->reference) { in ads1119_channel_setup() 232 if (channel_cfg->differential) { in ads1119_channel_setup() 233 if (channel_cfg->input_positive == 0 && channel_cfg->input_negative == 1) { in ads1119_channel_setup() 235 } else if (channel_cfg->input_positive == 1 && channel_cfg->input_negative == 2) { in ads1119_channel_setup() 237 } else if (channel_cfg->input_positive == 2 && channel_cfg->input_negative == 3) { in ads1119_channel_setup() 243 if (channel_cfg->input_positive == 0) { in ads1119_channel_setup() 245 } else if (channel_cfg->input_positive == 1) { in ads1119_channel_setup() 247 } else if (channel_cfg->input_positive == 2) { in ads1119_channel_setup() [all …]
|
D | adc_mcux_lpadc.c | 60 const struct adc_channel_cfg *channel_cfg) in mcux_lpadc_channel_setup() argument 70 if (channel_cfg->channel_id >= CONFIG_LPADC_CHANNEL_COUNT) { in mcux_lpadc_channel_setup() 71 LOG_ERR("Channel %d is not valid", channel_cfg->channel_id); in mcux_lpadc_channel_setup() 75 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in mcux_lpadc_channel_setup() 81 cmd = &data->cmd_config[channel_cfg->channel_id]; in mcux_lpadc_channel_setup() 84 channel_side = 0x20 & channel_cfg->input_positive; in mcux_lpadc_channel_setup() 86 channel_num = ADC_CMDL_ADCH(channel_cfg->input_positive); in mcux_lpadc_channel_setup() 93 if (channel_cfg->differential) { in mcux_lpadc_channel_setup() 95 if ((ADC_CMDL_ADCH(channel_cfg->input_positive)) != in mcux_lpadc_channel_setup() 96 (ADC_CMDL_ADCH(channel_cfg->input_negative))) { in mcux_lpadc_channel_setup() [all …]
|
D | adc_cc13xx_cc26xx.c | 123 const struct adc_channel_cfg *channel_cfg) in adc_cc13xx_cc26xx_channel_setup() argument 126 const uint8_t ch = channel_cfg->channel_id; in adc_cc13xx_cc26xx_channel_setup() 135 switch (ADC_ACQ_TIME_UNIT(channel_cfg->acquisition_time)) { in adc_cc13xx_cc26xx_channel_setup() 137 data->sample_time = (uint16_t)ADC_ACQ_TIME_VALUE(channel_cfg->acquisition_time); in adc_cc13xx_cc26xx_channel_setup() 140 sample_time_us = (uint16_t)ADC_ACQ_TIME_VALUE(channel_cfg->acquisition_time); in adc_cc13xx_cc26xx_channel_setup() 144 ADC_ACQ_TIME_VALUE(channel_cfg->acquisition_time) * 1000); in adc_cc13xx_cc26xx_channel_setup() 165 if (channel_cfg->differential) { in adc_cc13xx_cc26xx_channel_setup() 170 if (channel_cfg->gain != ADC_GAIN_1) { in adc_cc13xx_cc26xx_channel_setup() 175 if (channel_cfg->reference == ADC_REF_INTERNAL) { in adc_cc13xx_cc26xx_channel_setup() 177 } else if (channel_cfg->reference == ADC_REF_VDD_1) { in adc_cc13xx_cc26xx_channel_setup()
|
D | adc_smartbond_gpadc.c | 52 const struct adc_channel_cfg *channel_cfg) in adc_smartbond_channel_setup() argument 54 uint8_t channel_id = channel_cfg->channel_id; in adc_smartbond_channel_setup() 61 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in adc_smartbond_channel_setup() 66 if (channel_cfg->differential) { in adc_smartbond_channel_setup() 67 if (channel_cfg->input_positive != SMARTBOND_GPADC_P1_09 && in adc_smartbond_channel_setup() 68 channel_cfg->input_positive != SMARTBOND_GPADC_P0_08) { in adc_smartbond_channel_setup() 74 switch (channel_cfg->gain) { in adc_smartbond_channel_setup() 87 switch (channel_cfg->reference) { in adc_smartbond_channel_setup() 96 channel_cfg->input_positive << GPADC_GP_ADC_CTRL_REG_GP_ADC_SEL_Pos; in adc_smartbond_channel_setup() 97 if (!channel_cfg->differential) { in adc_smartbond_channel_setup()
|
D | adc_mcp320x.c | 47 const struct adc_channel_cfg *channel_cfg) in mcp320x_channel_setup() argument 52 if (channel_cfg->gain != ADC_GAIN_1) { in mcp320x_channel_setup() 53 LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain); in mcp320x_channel_setup() 57 if (channel_cfg->reference != ADC_REF_EXTERNAL0) { in mcp320x_channel_setup() 59 channel_cfg->reference); in mcp320x_channel_setup() 63 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in mcp320x_channel_setup() 65 channel_cfg->acquisition_time); in mcp320x_channel_setup() 69 if (channel_cfg->channel_id >= config->channels) { in mcp320x_channel_setup() 70 LOG_ERR("unsupported channel id '%d'", channel_cfg->channel_id); in mcp320x_channel_setup() 74 WRITE_BIT(data->differential, channel_cfg->channel_id, in mcp320x_channel_setup() [all …]
|
D | adc_ads7052.c | 41 const struct adc_channel_cfg *channel_cfg) in adc_ads7052_channel_setup() argument 45 if (channel_cfg->gain != ADC_GAIN_1) { in adc_ads7052_channel_setup() 46 LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain); in adc_ads7052_channel_setup() 50 if (channel_cfg->reference != ADC_REF_VDD_1) { in adc_ads7052_channel_setup() 51 LOG_ERR("unsupported channel reference '%d'", channel_cfg->reference); in adc_ads7052_channel_setup() 55 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in adc_ads7052_channel_setup() 56 LOG_ERR("unsupported acquisition_time '%d'", channel_cfg->acquisition_time); in adc_ads7052_channel_setup() 60 if (channel_cfg->channel_id >= config->channels) { in adc_ads7052_channel_setup() 61 LOG_ERR("unsupported channel id '%d'", channel_cfg->channel_id); in adc_ads7052_channel_setup()
|
D | adc_nrfx_adc.c | 48 const struct adc_channel_cfg *channel_cfg) in adc_nrfx_channel_setup() argument 50 uint8_t channel_id = channel_cfg->channel_id; in adc_nrfx_channel_setup() 57 if (channel_cfg->acquisition_time != ADC_ACQ_TIME_DEFAULT) { in adc_nrfx_channel_setup() 62 if (channel_cfg->differential) { in adc_nrfx_channel_setup() 67 switch (channel_cfg->gain) { in adc_nrfx_channel_setup() 82 switch (channel_cfg->reference) { in adc_nrfx_channel_setup() 108 config->input = channel_cfg->input_positive; in adc_nrfx_channel_setup()
|
D | iadc_gecko.c | 353 const struct adc_channel_cfg *channel_cfg) in adc_gecko_channel_setup() argument 358 if (channel_cfg->channel_id < GECKO_CHANNEL_COUNT) { in adc_gecko_channel_setup() 359 channel_config = &data->channel_config[channel_cfg->channel_id]; in adc_gecko_channel_setup() 361 LOG_DBG("Requested channel index not available: %d", channel_cfg->channel_id); in adc_gecko_channel_setup() 367 channel_config->input_positive = channel_cfg->input_positive; in adc_gecko_channel_setup() 369 if (channel_cfg->differential) { in adc_gecko_channel_setup() 370 channel_config->input_negative = channel_cfg->input_negative; in adc_gecko_channel_setup() 377 switch (channel_cfg->gain) { in adc_gecko_channel_setup() 399 LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain); in adc_gecko_channel_setup() 404 switch (channel_cfg->reference) { in adc_gecko_channel_setup() [all …]
|
/Zephyr-Core-3.4.0/drivers/dac/ |
D | dac_stm32.c | 83 const struct dac_channel_cfg *channel_cfg) in dac_stm32_channel_setup() argument 89 if ((channel_cfg->channel_id - STM32_FIRST_CHANNEL >= in dac_stm32_channel_setup() 91 (channel_cfg->channel_id < STM32_FIRST_CHANNEL)) { in dac_stm32_channel_setup() 92 LOG_ERR("Channel %d is not valid", channel_cfg->channel_id); in dac_stm32_channel_setup() 96 if ((channel_cfg->resolution == 8) || in dac_stm32_channel_setup() 97 (channel_cfg->resolution == 12)) { in dac_stm32_channel_setup() 98 data->resolution = channel_cfg->resolution; in dac_stm32_channel_setup() 104 if (channel_cfg->buffered) { in dac_stm32_channel_setup() 111 table_channels[channel_cfg->channel_id - STM32_FIRST_CHANNEL], in dac_stm32_channel_setup() 115 table_channels[channel_cfg->channel_id - STM32_FIRST_CHANNEL]); in dac_stm32_channel_setup()
|
D | dac_handlers.c | 14 struct dac_channel_cfg channel_cfg; in z_vrfy_dac_channel_setup() local 17 Z_OOPS(z_user_from_copy(&channel_cfg, in z_vrfy_dac_channel_setup() 22 &channel_cfg); in z_vrfy_dac_channel_setup()
|
D | dac_dacx3608.c | 88 const struct dac_channel_cfg *channel_cfg) in dacx3608_channel_setup() argument 95 if (channel_cfg->channel_id > DACX3608_MAX_CHANNEL - 1) { in dacx3608_channel_setup() 96 LOG_ERR("Unsupported channel %d", channel_cfg->channel_id); in dacx3608_channel_setup() 100 if (channel_cfg->resolution != config->resolution) { in dacx3608_channel_setup() 101 LOG_ERR("Unsupported resolution %d", channel_cfg->resolution); in dacx3608_channel_setup() 105 if (data->configured & BIT(channel_cfg->channel_id)) { in dacx3608_channel_setup() 106 LOG_DBG("Channel %d already configured", channel_cfg->channel_id); in dacx3608_channel_setup() 112 BIT(channel_cfg->channel_id), setting); in dacx3608_channel_setup() 118 data->configured |= BIT(channel_cfg->channel_id); in dacx3608_channel_setup() 120 LOG_DBG("Channel %d initialized", channel_cfg->channel_id); in dacx3608_channel_setup()
|
D | dac_mcux_dac.c | 28 const struct dac_channel_cfg *channel_cfg) in mcux_dac_channel_setup() argument 34 if (channel_cfg->channel_id != 0) { in mcux_dac_channel_setup() 35 LOG_ERR("unsupported channel %d", channel_cfg->channel_id); in mcux_dac_channel_setup() 39 if (channel_cfg->resolution != 12) { in mcux_dac_channel_setup() 40 LOG_ERR("unsupported resolution %d", channel_cfg->resolution); in mcux_dac_channel_setup()
|
D | dac_esp32.c | 40 const struct dac_channel_cfg *channel_cfg) in dac_esp32_channel_setup() argument 44 if (channel_cfg->channel_id > DAC_CHANNEL_MAX) { in dac_esp32_channel_setup() 45 LOG_ERR("Channel %d is not valid", channel_cfg->channel_id); in dac_esp32_channel_setup() 49 dac_output_enable(channel_cfg->channel_id); in dac_esp32_channel_setup()
|
D | dac_mcux_dac32.c | 31 const struct dac_channel_cfg *channel_cfg) in mcux_dac32_channel_setup() argument 37 if (channel_cfg->channel_id != 0) { in mcux_dac32_channel_setup() 38 LOG_ERR("unsupported channel %d", channel_cfg->channel_id); in mcux_dac32_channel_setup() 42 if (channel_cfg->resolution != 12) { in mcux_dac32_channel_setup() 43 LOG_ERR("unsupported resolution %d", channel_cfg->resolution); in mcux_dac32_channel_setup()
|
D | dac_ltc166x.c | 55 const struct dac_channel_cfg *channel_cfg) in ltc166x_channel_setup() argument 59 if (channel_cfg->channel_id > config->nchannels - 1) { in ltc166x_channel_setup() 60 LOG_ERR("Unsupported channel %d", channel_cfg->channel_id); in ltc166x_channel_setup() 64 if (channel_cfg->resolution != config->resolution) { in ltc166x_channel_setup() 65 LOG_ERR("Unsupported resolution %d", channel_cfg->resolution); in ltc166x_channel_setup()
|
D | dac_gd32.c | 101 const struct dac_channel_cfg *channel_cfg) in dac_gd32_channel_setup() argument 105 uint8_t dacx = channel_cfg->channel_id; in dac_gd32_channel_setup() 112 if ((channel_cfg->resolution != 8U) && in dac_gd32_channel_setup() 113 (channel_cfg->resolution != 12U)) { in dac_gd32_channel_setup() 118 data->resolutions[dacx] = channel_cfg->resolution; in dac_gd32_channel_setup()
|
/Zephyr-Core-3.4.0/include/zephyr/drivers/ |
D | dac.h | 56 const struct dac_channel_cfg *channel_cfg); 93 const struct dac_channel_cfg *channel_cfg); 96 const struct dac_channel_cfg *channel_cfg) in z_impl_dac_channel_setup() argument 101 return api->channel_setup(dev, channel_cfg); in z_impl_dac_channel_setup()
|
D | adc.h | 267 struct adc_channel_cfg channel_cfg; member 310 .channel_cfg = ADC_CHANNEL_CFG_DT(node_id), \ 575 const struct adc_channel_cfg *channel_cfg); 620 const struct adc_channel_cfg *channel_cfg); 623 const struct adc_channel_cfg *channel_cfg) in z_impl_adc_channel_setup() argument 628 return api->channel_setup(dev, channel_cfg); in z_impl_adc_channel_setup() 646 return adc_channel_setup(spec->dev, &spec->channel_cfg); in adc_channel_setup_dt() 797 if (spec->channel_cfg.reference == ADC_REF_INTERNAL) { in adc_raw_to_millivolts_dt() 809 if (spec->channel_cfg.differential) { in adc_raw_to_millivolts_dt() 813 return adc_raw_to_millivolts(vref_mv, spec->channel_cfg.gain, in adc_raw_to_millivolts_dt()
|