Subversion Repositories svn.mios32

Rev

Rev 1643 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1643 Rev 1960
Line 1... Line 1...
1
// $Id: mios32_ain.c 1643 2013-01-04 18:49:10Z tk $
1
// $Id: mios32_ain.c 1960 2014-02-09 20:21:24Z tk $
2
//! \defgroup MIOS32_AIN
2
//! \defgroup MIOS32_AIN
3
//!
3
//!
4
//! AIN driver for MIOS32
4
//! AIN driver for MIOS32
5
//! 
5
//! 
6
//! ADC channels which should be converted have to be specified with a
6
//! ADC channels which should be converted have to be specified with a
Line 372... Line 372...
372
372
373
  return 0; // no error
373
  return 0; // no error
374
#endif
374
#endif
375
}
375
}
376
376
-
 
377
/////////////////////////////////////////////////////////////////////////////
-
 
378
//! Starts an ADC conversion (use this if the MIOS32_AIN_Handler call has been
-
 
379
//! disabled via #define MIOS32_DONT_SERVICE_AIN 1 in mios32_config.h
-
 
380
//! 
-
 
381
//! In this case, the MIOS32_AIN_StartConversions() function has to be called
-
 
382
//! periodically from the application (e.g. from a timer), and conversion values
-
 
383
//! can be retrieved with MIOS32_AIN_PinGet()
-
 
384
//! \return < 0 on errors
-
 
385
/////////////////////////////////////////////////////////////////////////////
-
 
386
s32 MIOS32_AIN_StartConversions(void)
-
 
387
{
-
 
388
#if !MIOS32_AIN_CHANNEL_MASK
-
 
389
  return -1; // no analog input selected
-
 
390
#else
-
 
391
  // conversions always running...
-
 
392
  return 0; // no error
-
 
393
#endif
-
 
394
}
377
395
378
396
379
/////////////////////////////////////////////////////////////////////////////
397
/////////////////////////////////////////////////////////////////////////////
380
//! ADC interrupt is triggered when all ADC channels have been converted
398
//! ADC interrupt is triggered when all ADC channels have been converted
381
//! \note shouldn't be called directly from application
399
//! \note shouldn't be called directly from application