diff options
Diffstat (limited to 'os/io/templates')
-rw-r--r-- | os/io/templates/adc_lld.c | 30 | ||||
-rw-r--r-- | os/io/templates/adc_lld.h | 22 | ||||
-rw-r--r-- | os/io/templates/spi_lld.c | 8 |
3 files changed, 37 insertions, 23 deletions
diff --git a/os/io/templates/adc_lld.c b/os/io/templates/adc_lld.c index d45817778..31fd64691 100644 --- a/os/io/templates/adc_lld.c +++ b/os/io/templates/adc_lld.c @@ -28,6 +28,14 @@ #include <adc.h>
/*===========================================================================*/
+/* Low Level Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Low Level Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Low Level Driver local functions. */
/*===========================================================================*/
@@ -49,7 +57,7 @@ void adc_lld_init(void) { /**
* @brief Configures and activates the ADC peripheral.
*
- * @param[in] adcp pointer to the @p ADCDriver object
+ * @param[in] adcp pointer to the @p ADCDriver object
*/
void adc_lld_start(ADCDriver *adcp) {
@@ -62,7 +70,7 @@ void adc_lld_start(ADCDriver *adcp) { /**
* @brief Deactivates the ADC peripheral.
*
- * @param[in] adcp pointer to the @p ADCDriver object
+ * @param[in] adcp pointer to the @p ADCDriver object
*/
void adc_lld_stop(ADCDriver *adcp) {
@@ -71,28 +79,16 @@ void adc_lld_stop(ADCDriver *adcp) { /**
* @brief Starts an ADC conversion.
*
- * @param[in] adcp pointer to the @p ADCDriver object
- * @param[in] grpp pointer to a @p ADCConversionGroup object
- * @param[out] samples pointer to the samples buffer
- * @param[in] depth buffer depth (matrix rows number). The buffer depth
- * must be one or an even number.
- *
- * @note The buffer is organized as a matrix of M*N elements where M is the
- * channels number configured into the conversion group and N is the
- * buffer depth. The samples are sequentially written into the buffer
- * with no gaps.
+ * @param[in] adcp pointer to the @p ADCDriver object
*/
-void adc_lld_start_conversion(ADCDriver *adcp,
- ADCConversionGroup *grpp,
- void *samples,
- size_t depth) {
+void adc_lld_start_conversion(ADCDriver *adcp) {
}
/**
* @brief Stops an ongoing conversion.
*
- * @param[in] adcp pointer to the @p ADCDriver object
+ * @param[in] adcp pointer to the @p ADCDriver object
*/
void adc_lld_stop_conversion(ADCDriver *adcp) {
diff --git a/os/io/templates/adc_lld.h b/os/io/templates/adc_lld.h index 23e06f89e..cb790aec7 100644 --- a/os/io/templates/adc_lld.h +++ b/os/io/templates/adc_lld.h @@ -70,6 +70,7 @@ typedef struct { /**
* @brief Driver configuration structure.
+ * @note It could be empty on some architectures.
*/
typedef struct {
@@ -88,13 +89,25 @@ typedef struct { */
const ADCConfig *ad_config;
/**
- * @brief Semaphore for completion synchronization. + * @brief Synchronization semaphore.
*/
- Semaphore ac_sem;
+ Semaphore ad_sem;
/**
* @brief Current callback function or @p NULL.
*/
adccallback_t ad_callback;
+ /**
+ * @brief Current samples buffer pointer or @p NULL.
+ */
+ adcsample_t *ad_samples;
+ /**
+ * @brief Current samples buffer depth or @p 0.
+ */
+ size_t ad_depth;
+ /**
+ * @brief Current conversion group pointer or @p NULL.
+ */
+ ADCConversionGroup *ad_grpp;
/* End of the mandatory fields.*/
} ADCDriver;
@@ -108,10 +121,7 @@ extern "C" { void adc_lld_init(void);
void adc_lld_start(ADCDriver *adcp);
void adc_lld_stop(ADCDriver *adcp);
- void adc_lld_start_conversion(ADCDriver *adcp,
- ADCConversionGroup *grpp,
- void *samples,
- size_t depth);
+ void adc_lld_start_conversion(ADCDriver *adcp);
void adc_lld_stop_conversion(ADCDriver *adcp);
#ifdef __cplusplus
}
diff --git a/os/io/templates/spi_lld.c b/os/io/templates/spi_lld.c index 501352037..8e9a14b6a 100644 --- a/os/io/templates/spi_lld.c +++ b/os/io/templates/spi_lld.c @@ -28,6 +28,14 @@ #include <spi.h>
/*===========================================================================*/
+/* Low Level Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Low Level Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Low Level Driver local functions. */
/*===========================================================================*/
|