Index: firmware/App/Drivers/InternalADC.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -20,12 +20,18 @@ #include "CPLD.h" #include "InternalADC.h" +/** + * @addtogroup InternalADC + * @{ + */ + // ********** private definitions ********** -#define MAX_ADC_CHANNELS 24 // ADC supports up to 24 channels -#define SIZE_OF_ROLLING_AVG 16 // samples in rolling average calculations -#define ROLLING_AVG_SHIFT_DIVIDER 4 // rolling average shift divider - +#define MAX_ADC_CHANNELS 24 ///< ADC supports up to 24 channels. +#define SIZE_OF_ROLLING_AVG 16 ///< samples in rolling average calculations. +#define ROLLING_AVG_SHIFT_DIVIDER 4 ///< rolling average shift divider. + +/// Mapping from enumerated used ADC channel to processor channel ID. const INT_ADC_CHANNEL_T adcChannelNum2ChannelId[ MAX_ADC_CHANNELS ] = { INT_ADC_DIAL_IN_PUMP_SPEED, // 0 @@ -56,20 +62,18 @@ // ********** private data ********** -static adcData_t adcRawReadings[ NUM_OF_INT_ADC_CHANNELS ]; // buffer holds latest adc channel readings -static U32 adcRawReadingsCount = 0; // readings count for raw readings buffer +static adcData_t adcRawReadings[ NUM_OF_INT_ADC_CHANNELS ]; ///< Buffer holds latest adc channel readings. +static U32 adcRawReadingsCount = 0; ///< Readings count for raw readings buffer. -static U16 adcReadings[ NUM_OF_INT_ADC_CHANNELS ][ SIZE_OF_ROLLING_AVG ]; // holds samples for each channel for a rolling average -static U32 adcReadingsIdx[ NUM_OF_INT_ADC_CHANNELS ]; // index for next reading in each rolling average array -static U32 adcReadingsTotals[ NUM_OF_INT_ADC_CHANNELS ]; // rolling total for each channel - used to calc average -static U32 adcReadingsAvgs[ NUM_OF_INT_ADC_CHANNELS ]; // rolling average for each channel +static U16 adcReadings[ NUM_OF_INT_ADC_CHANNELS ][ SIZE_OF_ROLLING_AVG ]; ///< Holds samples for each channel for a rolling average. +static U32 adcReadingsIdx[ NUM_OF_INT_ADC_CHANNELS ]; ///< Index for next reading in each rolling average array. +static U32 adcReadingsTotals[ NUM_OF_INT_ADC_CHANNELS ]; ///< Rolling total for each channel - used to calc average. +static U32 adcReadingsAvgs[ NUM_OF_INT_ADC_CHANNELS ]; ///< Rolling average for each channel. // ********** private function prototypes ********** - - -/************************************************************************* - * @brief initInternalADC +/*********************************************************************//** + * @brief * The initInternalADC function initializes the InternalADC module. * @details * Inputs : none @@ -99,8 +103,8 @@ adcEnableNotification( adcREG1, adcGROUP1 ); } -/************************************************************************* - * @brief adcNotification +/*********************************************************************//** + * @brief * The adcNotification function handles an ADC conversion complete interrupt. * All channel readings in the FIFO are retrieved. * @details @@ -118,15 +122,13 @@ } } -/************************************************************************* - * @brief execInternalADC +/*********************************************************************//** + * @brief * The execInternalADC function processes the last set of raw ADC channel * readings and kicks off the next conversion of ADC channels. * @details * Inputs : adcRawReadingsCount, adcRawReadings[] * Outputs : adcReadings[][], adcReadingsIdx[], adcReadingsTotals[], adcReadingsAvgs[] - * @param adc pointer to the ADC1 controller - * @param group ADC channel group ID * @return none *************************************************************************/ void execInternalADC( void ) @@ -156,8 +158,8 @@ adcStartConversion( adcREG1, adcGROUP1 ); } -/************************************************************************* - * @brief getIntADCReading +/*********************************************************************//** + * @brief * The getIntADCReading function gets the latest average reading for a given * channel. * @details @@ -182,3 +184,4 @@ return result; } +/**@}*/