aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/adc_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-24 15:35:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-24 15:35:53 +0000
commit9708a3c30ff4ce1d95b3333b6be4375138a89be5 (patch)
treea8b3422730ceaa58c1b4edf54b3a1f66d505310d /os/hal/templates/adc_lld.c
parent9a1b57db6d7da73e6a1ae070de1835caaf276341 (diff)
downloadChibiOS-9708a3c30ff4ce1d95b3333b6be4375138a89be5.tar.gz
ChibiOS-9708a3c30ff4ce1d95b3333b6be4375138a89be5.tar.bz2
ChibiOS-9708a3c30ff4ce1d95b3333b6be4375138a89be5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5313 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/templates/adc_lld.c')
-rw-r--r--os/hal/templates/adc_lld.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c
index 44c29d023..1ea117d8a 100644
--- a/os/hal/templates/adc_lld.c
+++ b/os/hal/templates/adc_lld.c
@@ -39,6 +39,11 @@
/* Driver exported variables. */
/*===========================================================================*/
+/** @brief ADC1 driver identifier.*/
+#if PLATFORM_ADC_USE_ADC1 || defined(__DOXYGEN__)
+ADCDriver ADCD1;
+#endif
+
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
@@ -62,6 +67,10 @@
*/
void adc_lld_init(void) {
+#if PLATFORM_ADC_USE_ADC1
+ /* Driver initialization.*/
+ adcObjectInit(&ADCD1);
+#endif /* PLATFORM_ADC_USE_ADC1 */
}
/**
@@ -73,10 +82,16 @@ void adc_lld_init(void) {
*/
void adc_lld_start(ADCDriver *adcp) {
- if (adcp->adc_state == ADC_STOP) {
- /* Clock activation.*/
+ if (adcp->state == ADC_STOP) {
+ /* Enables the pehipheral.*/
+#if PLATFORM_ADC_USE_ADC1
+ if (&ADCD1 == adcp) {
+
+ }
+#endif /* PLATFORM_ADC_USE_ADC1 */
}
- /* Configuration.*/
+ /* Configures the peripheral.*/
+
}
/**
@@ -89,8 +104,14 @@ void adc_lld_start(ADCDriver *adcp) {
void adc_lld_stop(ADCDriver *adcp) {
if (adcp->state == ADC_READY) {
- /* Clock de-activation.*/
+ /* Resets the peripheral.*/
+
+ /* Disables the peripheral.*/
+#if PLATFORM_ADC_USE_ADC1
+ if (&ADCD1 == adcp) {
+ }
+#endif /* PLATFORM_ADC_USE_ADC1 */
}
}