This commit is contained in:
刘可亮
2024-06-04 19:00:30 +08:00
parent 990c72f5be
commit 0a13af6a1d
1668 changed files with 342810 additions and 37726 deletions

View File

@@ -81,20 +81,30 @@ static rt_err_t _adc_control(rt_device_t dev, int cmd, void *args)
else if (cmd == RT_ADC_CMD_CONFIG_DMA && adc->ops->config_dma)
{
return adc->ops->config_dma(adc, args);
}
else if (cmd == RT_ADC_CMD_GET_DMA_DATA && adc->ops->get_dma_data)
{
return adc->ops->get_dma_data(adc, (rt_uint32_t)(long)args);
}
else if (cmd == RT_ADC_CMD_GET_MODE && adc->ops->get_mode)
{
return adc->ops->get_mode(adc, args);
}
else if (cmd == RT_ADC_CMD_OBTAIN_DATA_MODE && adc->ops->get_obtaining_data_mode)
{
return adc->ops->get_obtaining_data_mode(adc, (rt_uint32_t)(long)args);
}
else if (cmd == RT_ADC_CMD_IRQ_COUNT && adc->ops->get_irq_count)
{
return adc->ops->get_irq_count(adc, (rt_uint32_t)(long)args);
}
else if (cmd == RT_ADC_CMD_OBTAIN_DATA_MODE && adc->ops->get_obtaining_data_mode)
else if (cmd == RT_ADC_CMD_IRQ_CALLBACK && adc->ops->irq_callback)
{
return adc->ops->get_obtaining_data_mode(adc, (rt_uint32_t)(long)args);
return adc->ops->irq_callback(adc, args);
}
else if (cmd == RT_ADC_CMD_GET_CH_INFO && adc->ops->get_ch_info)
{
return adc->ops->get_ch_info(adc, args);
}
#endif
else if (cmd == RT_ADC_CMD_GET_VREF && adc->ops->get_vref && args)