You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/03/23 04:31:34 UTC

[GitHub] sterlinghughes closed pull request #932: ADC: Added missing function for blocking read of channel.

sterlinghughes closed pull request #932: ADC: Added missing function for blocking read of channel.
URL: https://github.com/apache/mynewt-core/pull/932
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/drivers/adc/include/adc/adc.h b/hw/drivers/adc/include/adc/adc.h
index ad1ab7dd7..732c903c1 100644
--- a/hw/drivers/adc/include/adc/adc.h
+++ b/hw/drivers/adc/include/adc/adc.h
@@ -182,6 +182,22 @@ adc_sample(struct adc_dev *dev)
     return (dev->ad_funcs.af_sample(dev));
 }
 
+/**
+ * Blocking read of an ADC channel.  This is implemented by the HW specific
+ * drivers.
+ *
+ * @param The ADC device to perform the blocking read on
+ * @param The channel to read
+ * @param The result to put the ADC reading into
+ *
+ * @return 0 on success, non-zero error code on failure
+ */
+static inline int
+adc_read_channel(struct adc_dev *dev, uint8_t ch, int *result)
+{
+    return (dev->ad_funcs.af_read_channel(dev, ch, result));
+}
+
 /**
  * Set a result buffer to store data into.  Optionally, provide a
  * second buffer to continue writing data into as the first buffer


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services