aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/adc_lld.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-10-08 18:16:38 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-10-08 18:16:38 +0000
commitf407e4a84fcf2cf3bb003ed36f80ec136f8683c2 (patch)
tree4320f476744a99f1814e4ad5007e8fc87e8467ff /os/hal/platforms/STM32/adc_lld.h
parent38cc48d575a6232cfd440d97711f89f5f531422d (diff)
downloadChibiOS-f407e4a84fcf2cf3bb003ed36f80ec136f8683c2.tar.gz
ChibiOS-f407e4a84fcf2cf3bb003ed36f80ec136f8683c2.tar.bz2
ChibiOS-f407e4a84fcf2cf3bb003ed36f80ec136f8683c2.zip
HAL improvements, mailboxes macro name changed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2238 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/adc_lld.h')
-rw-r--r--os/hal/platforms/STM32/adc_lld.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h
index 7fe219706..a72ce67f3 100644
--- a/os/hal/platforms/STM32/adc_lld.h
+++ b/os/hal/platforms/STM32/adc_lld.h
@@ -115,12 +115,19 @@ typedef uint16_t adcsample_t;
typedef uint16_t adc_channels_num_t;
/**
+ * @brief Type of a structure representing an ADC driver.
+ */
+typedef struct ADCDriver ADCDriver;
+
+/**
* @brief ADC notification callback type.
*
+ * @param[in] adcp pointer to the @p ADCDriver object triggering the
+ * callback
* @param[in] buffer pointer to the most recent samples data
* @param[in] n number of buffer rows available starting from @p buffer
*/
-typedef void (*adccallback_t)(adcsample_t *buffer, size_t n);
+typedef void (*adccallback_t)(ADCDriver *adcp, adcsample_t *buffer, size_t n);
/**
* @brief Conversion group configuration structure.
@@ -139,6 +146,10 @@ typedef struct {
* @brief Number of the analog channels belonging to the conversion group.
*/
adc_channels_num_t acg_num_channels;
+ /**
+ * @brief Callback function associated to the group or @p NULL.
+ */
+ adccallback_t acg_callback;
/* End of the mandatory fields.*/
/**
* @brief ADC CR1 register initialization data.
@@ -185,7 +196,7 @@ typedef struct {
/**
* @brief Structure representing an ADC driver.
*/
-typedef struct {
+struct ADCDriver {
/**
* @brief Driver state.
*/
@@ -195,10 +206,6 @@ typedef struct {
*/
const ADCConfig *ad_config;
/**
- * @brief Current callback function or @p NULL.
- */
- adccallback_t ad_callback;
- /**
* @brief Current samples buffer pointer or @p NULL.
*/
adcsample_t *ad_samples;
@@ -210,12 +217,15 @@ typedef struct {
* @brief Current conversion group pointer or @p NULL.
*/
const ADCConversionGroup *ad_grpp;
-#if ADC_USE_WAIT
+#if ADC_USE_WAIT || defined(__DOXYGEN__)
/**
* @brief Synchronization semaphore.
*/
Semaphore ad_sem;
#endif
+#if defined(ADC_DRIVER_EXT_FIELDS)
+ ADC_DRIVER_EXT_FIELDS
+#endif
/* End of the mandatory fields.*/
/**
* @brief Pointer to the ADCx registers block.
@@ -229,7 +239,7 @@ typedef struct {
* @brief DMA CCR register bit mask.
*/
uint32_t ad_dmaccr;
-} ADCDriver;
+};
/*===========================================================================*/
/* Driver macros. */