Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -674,7 +674,7 @@ * @details * Inputs : targetBloodFlowRate * Outputs : none -/ * @return the current target blood flow rate (in mL/min). + * @return the current target blood flow rate (in mL/min). *************************************************************************/ S32 getTargetBloodFlowRate( void ) { Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -692,7 +692,7 @@ * @details * Inputs : measuredDialInFlowRate * Outputs : none -/ * @return the current dialIn flow rate (in mL/min). + * @return the current dialIn flow rate (in mL/min). *************************************************************************/ F32 getMeasuredDialInFlowRate( void ) { @@ -776,7 +776,7 @@ * @details * Inputs : adcDialInPumpMCCurrentmA * Outputs : none -/ * @return the current dialIn pump current (in mA). + * @return the current dialIn pump current (in mA). *************************************************************************/ F32 getMeasuredDialInPumpMCCurrent( void ) { Index: firmware/App/Drivers/CPLD.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/CPLD.c (.../CPLD.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Drivers/CPLD.c (.../CPLD.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -23,40 +23,45 @@ #include "WatchdogMgmt.h" #include "CPLD.h" +/** + * @addtogroup CPLD + * @{ + */ + // ********** private definitions ********** // GIO port A pin assignments for pins connected to CPLD -#define OFF_BUTTON_GIO_PORT_PIN 0U -#define STOP_BUTTON_GIO_PORT_PIN 1U +#define OFF_BUTTON_GIO_PORT_PIN 0U ///< GPIO pin ID on port A for off button input signal. +#define STOP_BUTTON_GIO_PORT_PIN 1U ///< GPIO pin ID on port A for stop button input signal. // GIO port B pin assignments for pins connected to CPLD -#define OFF_REQUEST_GIO_PORT_PIN 0U -#define WD_PET_GIO_PORT_PIN 1U -#define WD_EXP_GIO_PORT_PIN 2U +#define OFF_REQUEST_GIO_PORT_PIN 0U ///< GPIO pin ID on port B for power off request output signal. +#define WD_PET_GIO_PORT_PIN 1U ///< GPIO pin ID on port B for watchdog pet output signal. +#define WD_EXP_GIO_PORT_PIN 2U ///< GPIO pin ID on port B for watchdog expired input signal. // MIBSPI5 port pin assignments for pins connected to CPLD -#define GREEN_SPI5_PORT_MASK 0x00000200 // (CLK - re-purposed as output GPIO) -#define BLUE_SPI5_PORT_MASK 0x00000400 // (SIMO[0] - re-purposed as output GPIO) -#define RED_SPI5_PORT_MASK 0x00000800 // (SOMI[0] - re-purposed as output GPIO) +#define GREEN_SPI5_PORT_MASK 0x00000200 ///< (CLK - re-purposed as output GPIO) for green alarm lamp signal. +#define BLUE_SPI5_PORT_MASK 0x00000400 ///< (SIMO[0] - re-purposed as output GPIO) for blue alarm lamp signal. +#define RED_SPI5_PORT_MASK 0x00000800 ///< (SOMI[0] - re-purposed as output GPIO) for red alarm lamp signal. // CPLD pin I/O macros -#define GET_OFF() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, OFF_BUTTON_GIO_PORT_PIN)) -#define GET_STOP() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, STOP_BUTTON_GIO_PORT_PIN)) -#define GET_WD_EXP() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTB, WD_EXP_GIO_PORT_PIN)) +#define GET_OFF() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, OFF_BUTTON_GIO_PORT_PIN)) ///< Macro to get off button signal state. +#define GET_STOP() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, STOP_BUTTON_GIO_PORT_PIN)) ///< Macro to get stop button signal state. +#define GET_WD_EXP() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTB, WD_EXP_GIO_PORT_PIN)) ///< Macro to get watchdog expired signal state. -#define TGL_WD_PET() gioToggleBit( gioPORTB, WD_PET_GIO_PORT_PIN ) -#define TGL_OFF_REQ() gioToggleBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN) -#define SET_WD_PET() gioSetBit( gioPORTB, WD_PET_GIO_PORT_PIN, PIN_SIGNAL_HIGH ) -#define SET_OFF_REQ() gioSetBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN, PIN_SIGNAL_HIGH ) -#define SET_GREEN() {mibspiREG5->PC3 |= GREEN_SPI5_PORT_MASK;} -#define SET_BLUE() {mibspiREG5->PC3 |= BLUE_SPI5_PORT_MASK;} -#define SET_RED() {mibspiREG5->PC3 |= RED_SPI5_PORT_MASK;} +#define TGL_WD_PET() gioToggleBit( gioPORTB, WD_PET_GIO_PORT_PIN ) ///< Macro to toggle watchdog pet signal state. +#define TGL_OFF_REQ() gioToggleBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN) ///< Macro to toggle power off request signal state. +#define SET_WD_PET() gioSetBit( gioPORTB, WD_PET_GIO_PORT_PIN, PIN_SIGNAL_HIGH ) ///< Macro to set watchdog pet signal state high. +#define SET_OFF_REQ() gioSetBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN, PIN_SIGNAL_HIGH ) ///< Macro to set power off request signal state high. +#define SET_GREEN() {mibspiREG5->PC3 |= GREEN_SPI5_PORT_MASK;} ///< Macro to set green alarm lamp signal state high. +#define SET_BLUE() {mibspiREG5->PC3 |= BLUE_SPI5_PORT_MASK;} ///< Macro to set blue alarm lamp signal state high. +#define SET_RED() {mibspiREG5->PC3 |= RED_SPI5_PORT_MASK;} ///< Macro to set red alarm lamp signal state high. -#define CLR_WD_PET() gioSetBit( gioPORTB, WD_PET_GIO_PORT_PIN, PIN_SIGNAL_LOW ) -#define CLR_OFF_REQ() gioSetBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN, PIN_SIGNAL_LOW ) -#define CLR_GREEN() {mibspiREG5->PC3 &= ~GREEN_SPI5_PORT_MASK;} -#define CLR_BLUE() {mibspiREG5->PC3 &= ~BLUE_SPI5_PORT_MASK;} -#define CLR_RED() {mibspiREG5->PC3 &= ~RED_SPI5_PORT_MASK;} +#define CLR_WD_PET() gioSetBit( gioPORTB, WD_PET_GIO_PORT_PIN, PIN_SIGNAL_LOW ) ///< Macro to set watchdog pet signal state low. +#define CLR_OFF_REQ() gioSetBit( gioPORTB, OFF_REQUEST_GIO_PORT_PIN, PIN_SIGNAL_LOW ) ///< Macro to set power off request signal state low. +#define CLR_GREEN() {mibspiREG5->PC3 &= ~GREEN_SPI5_PORT_MASK;} ///< Macro to set green alarm lamp signal state low. +#define CLR_BLUE() {mibspiREG5->PC3 &= ~BLUE_SPI5_PORT_MASK;} ///< Macro to set blue alarm lamp signal state low. +#define CLR_RED() {mibspiREG5->PC3 &= ~RED_SPI5_PORT_MASK;} ///< Macro to set red alarm lamp signal state low. #ifdef RM46_EVAL_BOARD_TARGET // for RM46 eval board, user button B uses the MIBSPI1_nCS[4] pin, so need to re-purpose that pin as GPIO to see the button @@ -82,8 +87,8 @@ } #endif -/************************************************************************* - * @brief initCPLD +/*********************************************************************//** + * @brief * The initCPLD function initializes the CPLD module. * @details * Inputs : none @@ -104,8 +109,8 @@ CLR_BLUE(); } -/************************************************************************* - * @brief toggleCPLDWatchdog +/*********************************************************************//** + * @brief * The toggleCPLDWatchdog function toggles the watchdog pet signal to CPLD. * @details * Inputs : none @@ -117,14 +122,14 @@ TGL_WD_PET(); } -/************************************************************************* - * @brief getCPLDWatchdogExpired +/*********************************************************************//** + * @brief * The getCPLDWatchdogExpired function determines the current signal level * on the watchdog expired pin from the CPLD. * @details * Inputs : Signal from CPLD on watchdog expired pin. * Outputs : none - * @return level : (LOW or HIGH) + * @return level (LOW or HIGH) *************************************************************************/ PIN_SIGNAL_STATE_T getCPLDWatchdogExpired( void ) { @@ -133,8 +138,8 @@ return level; } -/************************************************************************* - * @brief setCPLDLampGreen +/*********************************************************************//** + * @brief * The setCPLDLampGreen function sets the alarm lamp green signal to CPLD * to given level. * @details @@ -155,8 +160,8 @@ } } -/************************************************************************* - * @brief setCPLDLampBlue +/*********************************************************************//** + * @brief * The setCPLDLampBlue function sets the alarm lamp blue signal to CPLD * to given level. * @details @@ -177,8 +182,8 @@ } } -/************************************************************************* - * @brief setCPLDLampRed +/*********************************************************************//** + * @brief * The setCPLDLampRed function sets the alarm lamp red signal to CPLD * to given level. * @details @@ -199,8 +204,8 @@ } } -/************************************************************************* - * @brief toggleCPLDOffRequest +/*********************************************************************//** + * @brief * The toggleCPLDOffRequest function toggles the off request signal to CPLD. * @details * Inputs : none @@ -212,14 +217,14 @@ TGL_OFF_REQ(); } -/************************************************************************* - * @brief getCPLDOffButton +/*********************************************************************//** + * @brief * The getCPLDOffButton function determines the current signal level * on the off button pin from the CPLD. * @details * Inputs : Signal from CPLD on off button pin. * Outputs : none - * @return level : (LOW or HIGH) + * @return level (LOW or HIGH) *************************************************************************/ PIN_SIGNAL_STATE_T getCPLDOffButton( void ) { @@ -233,14 +238,14 @@ return level; } -/************************************************************************* - * @brief getCPLDStopButton +/*********************************************************************//** + * @brief * The getCPLDStopButton function determines the current signal level * on the stop button pin from the CPLD. * @details * Inputs : Signal from CPLD on off button pin. * Outputs : none - * @return level : (LOW or HIGH) + * @return level (LOW or HIGH) *************************************************************************/ PIN_SIGNAL_STATE_T getCPLDStopButton( void ) { @@ -254,3 +259,4 @@ return level; } +/**@}*/ Index: firmware/App/Drivers/CPLD.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/CPLD.h (.../CPLD.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Drivers/CPLD.h (.../CPLD.h) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -20,6 +20,15 @@ #include "HDCommon.h" +/** + * @defgroup CPLD CPLD + * @brief The CPLD module provides functions to interface with the various + * CPLD functions (watchdog, alarm lamp, off/stop buttons, power off request). + * + * @addtogroup CPLD + * @{ + */ + // ********** public function prototypes ********** void initCPLD( void ); @@ -40,4 +49,6 @@ void setUserLED( BOOL on ); #endif +/**@}*/ + #endif Index: firmware/App/Drivers/Comm.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/Comm.c (.../Comm.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Drivers/Comm.c (.../Comm.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -21,19 +21,24 @@ #include "Comm.h" +/** + * @addtogroup CommLowLevel + * @{ + */ + // ********** private definitions ********** -#define DMA_CH_STATUS_BIT(ch) ((U32)1U << (ch)) +#define DMA_CH_STATUS_BIT(ch) ((U32)1U << (ch)) ///< Macro to get bit mask for status of a given DMA channel. // ********** private data ********** -static volatile BOOL canXmitsInProgress = FALSE; +static volatile BOOL canXmitsInProgress = FALSE; ///< Flag indicates a CAN frame transmit is in progress. #ifdef DEBUG_ENABLED static volatile BOOL uartXmitsInProgress = FALSE; #endif -/************************************************************************* - * @brief signalCANXmitsInitiated +/*********************************************************************//** + * @brief * The signalCANXmitsInitiated function sets the CAN transmits in * progress flag. * @details @@ -46,8 +51,8 @@ canXmitsInProgress = TRUE; } -/************************************************************************* - * @brief signalCANXmitsCompleted +/*********************************************************************//** + * @brief * The signalCANXmitsCompleted function resets the CAN transmits in * progress flag. * @details @@ -60,8 +65,8 @@ canXmitsInProgress = FALSE; } -/************************************************************************* - * @brief signalSCI1XmitsInitiated +/*********************************************************************//** + * @brief * The signalSCI1XmitsInitiated function sets the SCI1 transmits in * progress flag. * @details @@ -76,8 +81,8 @@ } #endif -/************************************************************************* - * @brief signalSCI1XmitsCompleted +/*********************************************************************//** + * @brief * The signalSCI1XmitsCompleted function resets the SCI1 transmits in * progress flag. * @details @@ -92,8 +97,8 @@ } #endif -/************************************************************************* - * @brief setSCI1DMAReceiveInterrupt +/*********************************************************************//** + * @brief * The setSCI1DMAReceiveInterrupt function enables DMA receive interrupts * for the SCI1 peripheral. * @details @@ -108,8 +113,8 @@ } #endif -/************************************************************************* - * @brief setSCI1DMATransmitInterrupt +/*********************************************************************//** + * @brief * The setSCI1DMATransmitInterrupt function enables DMA transmit interrupts * for the SCI1 peripheral. * @details @@ -124,8 +129,8 @@ } #endif -/************************************************************************* - * @brief clearSCI1DMAReceiveInterrupt +/*********************************************************************//** + * @brief * The clearSCI1DMAReceiveInterrupt function disables DMA receive interrupts * for the SCI1 peripheral. * @details @@ -140,8 +145,8 @@ } #endif -/************************************************************************* - * @brief clearSCI1DMATransmitInterrupt +/*********************************************************************//** + * @brief * The clearSCI1DMATransmitInterrupt function disables DMA transmit interrupts * for the SCI1 peripheral. * @details @@ -156,8 +161,8 @@ } #endif -/************************************************************************* - * @brief setSCI2DMAReceiveInterrupt +/*********************************************************************//** + * @brief * The setSCI2DMAReceiveInterrupt function enables DMA receive interrupts * for the SCI2 peripheral. * @details @@ -170,8 +175,8 @@ scilinREG->SETINT = SCI_DMA_RECEIVE_INT; } -/************************************************************************* - * @brief setSCI2DMATransmitInterrupt +/*********************************************************************//** + * @brief * The setSCI2DMATransmitInterrupt function enables DMA transmit interrupts * for the SCI2 peripheral. * @details @@ -184,8 +189,8 @@ scilinREG->SETINT = SCI_DMA_TRANSMIT_INT; } -/************************************************************************* - * @brief clearSCI2DMAReceiveInterrupt +/*********************************************************************//** + * @brief * The clearSCI2DMAReceiveInterrupt function disables DMA receive interrupts * for the SCI2 peripheral. * @details @@ -198,8 +203,8 @@ scilinREG->CLEARINT = SCI_DMA_RECEIVE_INT; } -/************************************************************************* - * @brief clearSCI2DMATransmitInterrupt +/*********************************************************************//** + * @brief * The clearSCI2DMATransmitInterrupt function disables DMA transmit interrupts * for the SCI2 peripheral. * @details @@ -212,8 +217,8 @@ scilinREG->CLEARINT = SCI_DMA_TRANSMIT_INT; } -/************************************************************************* - * @brief clearSCI1CommErrors +/*********************************************************************//** + * @brief * The clearSCI1CommErrors function clears framing and/or overrun error flags \ * for the SCI1 peripheral. * @details @@ -227,8 +232,8 @@ sciREG->FLR |= ( SCI_FE_INT | SCI_OE_INT ); } -/************************************************************************* - * @brief clearSCI2CommErrors +/*********************************************************************//** + * @brief * The clearSCI2CommErrors function clears framing and/or overrun error flags * for the SCI2 peripheral. * @details @@ -242,8 +247,8 @@ scilinREG->FLR |= ( SCI_FE_INT | SCI_OE_INT ); } -/************************************************************************* - * @brief isSCI1DMATransmitInProgress +/*********************************************************************//** + * @brief * The isSCI2DMATransmitInProgress function determines whether a DMA transmit * is in progress on the SCI1 peripheral. * @details @@ -262,8 +267,8 @@ } #endif -/************************************************************************* - * @brief isSCI2DMATransmitInProgress +/*********************************************************************//** + * @brief * The isSCI2DMATransmitInProgress function determines whether a DMA transmit * is in progress on the SCI2 peripheral. * @details @@ -279,8 +284,8 @@ return ( ( transmitterBusy == TRUE ) || ( dmaTransmitterBusy == TRUE ) ? TRUE : FALSE ); } -/************************************************************************* - * @brief isCAN1TransmitInProgress +/*********************************************************************//** + * @brief * The isCAN1TransmitInProgress function determines whether a transmit * is in progress on the CAN1 peripheral. * @details @@ -295,3 +300,4 @@ return result; } +/**@}*/ Index: firmware/App/Drivers/Comm.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/Comm.h (.../Comm.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Drivers/Comm.h (.../Comm.h) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -20,10 +20,19 @@ #include "HDCommon.h" +/** + * @defgroup CommLowLevel CommLowLevel + * @brief The low level communication module provides low level comm signal, + * status, and interrupt functions. + * + * @addtogroup CommLowLevel + * @{ + */ + // ********** public definitions ********** -#define SCI_DMA_TRANSMIT_INT 0x00010000 -#define SCI_DMA_RECEIVE_INT 0x00060000 +#define SCI_DMA_TRANSMIT_INT 0x00010000 ///< bit mask for setting/clearing serial DMA transmit interrupts. +#define SCI_DMA_RECEIVE_INT 0x00060000 ///< bit mask for setting/clearing serial DMA receive interrupts. // ********** public function prototypes ********** @@ -49,4 +58,6 @@ BOOL isCAN1TransmitInProgress( void ); +/**@}*/ + #endif 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; } +/**@}*/ Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -20,27 +20,33 @@ #include "HDCommon.h" +/** + * @defgroup InternalADC InternalADC + * @brief The internal ADC module provides functions for reading the sampled + * internal ADC channel data. + * + * @addtogroup InternalADC + * @{ + */ + // ********** public definitions ********** -#define INT_ADC_BITS_PER_CHANNEL 12 -#define INT_ADC_FULL_SCALE_BITS 4096 -#define INT_ADC_ZERO 1998 -#ifndef BREADBOARD_TARGET - #define INT_ADC_REF_V 3.0 -#else - #define INT_ADC_REF_V 3.3 -#endif - +#define INT_ADC_BITS_PER_CHANNEL 12 ///< Internal ADC channels are 12-bit. +#define INT_ADC_FULL_SCALE_BITS 4096 ///< Internal ADC has 4096 full scale counts per channel. +#define INT_ADC_ZERO 1998 ///< For signed 2's compliment data, zero is here. +#define INT_ADC_REF_V 3.0 ///< Internal ADC reference voltage is 3.0V. + +/// Enumeration of internal ADC channels that are used. typedef enum Int_ADC_Channels { - INT_ADC_NOT_USED = 0, - INT_ADC_BLOOD_PUMP_SPEED, - INT_ADC_BLOOD_PUMP_MOTOR_CURRENT, - INT_ADC_DIAL_IN_PUMP_SPEED, - INT_ADC_DIAL_IN_PUMP_MOTOR_CURRENT, - INT_ADC_DIAL_OUT_PUMP_SPEED, - INT_ADC_DIAL_OUT_PUMP_MOTOR_CURRENT, - NUM_OF_INT_ADC_CHANNELS + INT_ADC_NOT_USED = 0, ///< Not used. + INT_ADC_BLOOD_PUMP_SPEED, ///< Internal ADC channel for blood pump speed. + INT_ADC_BLOOD_PUMP_MOTOR_CURRENT, ///< Internal ADC channel for blood pump current. + INT_ADC_DIAL_IN_PUMP_SPEED, ///< Internal ADC channel for dialysate inlet pump speed. + INT_ADC_DIAL_IN_PUMP_MOTOR_CURRENT, ///< Internal ADC channel for dialysate inlet pump current. + INT_ADC_DIAL_OUT_PUMP_SPEED, ///< Internal ADC channel for dialysate outlet pump speed. + INT_ADC_DIAL_OUT_PUMP_MOTOR_CURRENT, ///< Internal ADC channel for dialysate outlet pump current. + NUM_OF_INT_ADC_CHANNELS ///< Number of used internal ADC channels. } INT_ADC_CHANNEL_T; // ********** public function prototypes ********** @@ -49,4 +55,6 @@ void execInternalADC( void ); U16 getIntADCReading( INT_ADC_CHANNEL_T channel ); +/**@}*/ + #endif Index: firmware/App/HDCommon.h =================================================================== diff -u -rc6f3b01d1b0a5e3fdf480a7ee205ca349e10d6d2 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/HDCommon.h (.../HDCommon.h) (revision c6f3b01d1b0a5e3fdf480a7ee205ca349e10d6d2) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -71,13 +71,10 @@ // **** Common Definitions **** - // **** Common Macros **** - /**@}*/ - // **** VectorCAST Definitions **** #ifdef _VECTORCAST_ Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r9302e1bd2413cbf99e80ac51aac38502d94801d9 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 9302e1bd2413cbf99e80ac51aac38502d94801d9) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -26,17 +26,17 @@ #include "OperationModes.h" #include "ModeFault.h" - /** - * @addtogroup HDFaultMode - * @{ - */ +/** + * @addtogroup HDFaultMode + * @{ + */ // ********** private data ********** // ********** private function prototypes ********** -/************************************************************************* - * @brief initFaultMode +/*********************************************************************//** + * @brief * The initFaultMode function initializes the Fault Mode module. * @details * Inputs : none @@ -47,8 +47,8 @@ { } -/************************************************************************* - * @brief transitionToFaultMode +/*********************************************************************//** + * @brief * The transitionToFaultMode function prepares for transition to fault mode. * @details * Inputs : none @@ -62,8 +62,8 @@ #endif } -/************************************************************************* - * @brief execFaultMode +/*********************************************************************//** + * @brief * The execFaultMode function executes the Fault Mode state machine. * @details * Inputs : none Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -37,17 +37,17 @@ // ********** private data ********** -static HD_POST_STATE_T postState = POST_STATE_START; -static BOOL postCompleted = FALSE; -static BOOL postPassed = FALSE; -static BOOL tempPOSTPassed = TRUE; +static HD_POST_STATE_T postState = POST_STATE_START; ///< Current state of initialize and POST mode. +static BOOL postCompleted = FALSE; ///< Flag indicates whether POST is completed. +static BOOL postPassed = FALSE; ///< Flag indicates all POST tests passed. +static BOOL tempPOSTPassed = TRUE; ///< Flag indicates all POST tests have passed so far. // ********** private function prototypes ********** static HD_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ); -/************************************************************************* - * @brief initInitAndPOSTMode +/*********************************************************************//** + * @brief * The initInitAndPOSTMode function initializes the Initialize & POST Mode module. * @details * Inputs : none @@ -62,25 +62,25 @@ tempPOSTPassed = TRUE; } -/************************************************************************* - * @brief transitionToInitAndPOSTMode +/*********************************************************************//** + * @brief * The transitionToInitAndPOSTMode function prepares for transition to * initialize & POST mode. * @details * Inputs : none - * Outputs : + * Outputs : none * @return none *************************************************************************/ void transitionToInitAndPOSTMode( void ) { } -/************************************************************************* - * @brief execInitAndPOSTMode +/*********************************************************************//** + * @brief * The execInitAndPOSTMode function executes the Initialize & POST Mode state machine. * @details - * Inputs : none - * Outputs : + * Inputs : postState + * Outputs : postState, postPassed, postCompleted * @return current state (sub-mode) *************************************************************************/ U32 execInitAndPOSTMode( void ) @@ -181,8 +181,8 @@ return postState; } -/************************************************************************* - * @brief isPOSTCompleted +/*********************************************************************//** + * @brief * The isPOSTCompleted function determines whether all HD POST have * been run and completed. If true, call the isPOSTPassed() to see final * result (pass/fail). Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -27,17 +27,17 @@ static U32 start; #endif - /** - * @addtogroup HDPostTreatmentMode - * @{ - */ +/** + * @addtogroup HDPostTreatmentMode + * @{ + */ // ********** private data ********** // ********** private function prototypes ********** -/************************************************************************* - * @brief initPostTreatmentMode +/*********************************************************************//** + * @brief * The initPostTreatmentMode function initializes the Post-Treatment Mode module. * @details * Inputs : none @@ -48,13 +48,13 @@ { } -/************************************************************************* - * @brief transitionToPostTreatmentMode +/*********************************************************************//** + * @brief * The transitionToPostTreatmentMode function prepares for transition to * post-treatment mode. * @details * Inputs : none - * Outputs : + * Outputs : none * @return none *************************************************************************/ void transitionToPostTreatmentMode( void ) @@ -71,12 +71,12 @@ #endif } -/************************************************************************* - * @brief execPostTreatmentMode +/*********************************************************************//** + * @brief * The execFaultMode function executes the Post-Treatment Mode state machine. * @details * Inputs : none - * Outputs : + * Outputs : none * @return current state (sub-mode) *************************************************************************/ U32 execPostTreatmentMode( void ) Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -27,17 +27,17 @@ static U32 start; #endif - /** - * @addtogroup HDPreTreatmentMode - * @{ - */ +/** + * @addtogroup HDPreTreatmentMode + * @{ + */ // ********** private data ********** // ********** private function prototypes ********** -/************************************************************************* - * @brief initPreTreatmentMode +/*********************************************************************//** + * @brief * The initPreTreatmentMode function initializes the Pre-Treatment Mode module. * @details * Inputs : none @@ -48,13 +48,13 @@ { } -/************************************************************************* - * @brief transitionToPreTreatmentMode +/*********************************************************************//** + * @brief * The transitionToPreTreatmentMode function prepares for transition to * pre-treatment mode. * @details * Inputs : none - * Outputs : + * Outputs : none * @return none *************************************************************************/ void transitionToPreTreatmentMode( void ) @@ -71,12 +71,12 @@ #endif } -/************************************************************************* - * @brief execPreTreatmentMode +/*********************************************************************//** + * @brief * The execFaultMode function executes the Pre-Treatment Mode state machine. * @details * Inputs : none - * Outputs : + * Outputs : none * @return current state (sub-mode) *************************************************************************/ U32 execPreTreatmentMode( void ) Index: firmware/App/Modes/ModeService.c =================================================================== diff -u -r9302e1bd2413cbf99e80ac51aac38502d94801d9 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 9302e1bd2413cbf99e80ac51aac38502d94801d9) +++ firmware/App/Modes/ModeService.c (.../ModeService.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -18,17 +18,17 @@ #include "OperationModes.h" #include "ModeService.h" - /** - * @addtogroup HDServiceMode - * @{ - */ +/** + * @addtogroup HDServiceMode + * @{ + */ // ********** private data ********** // ********** private function prototypes ********** -/************************************************************************* - * @brief initServiceMode +/*********************************************************************//** + * @brief * The initServiceMode function initializes the Service Mode module. * @details * Inputs : none @@ -39,24 +39,24 @@ { } -/************************************************************************* - * @brief transitionToServiceMode +/*********************************************************************//** + * @brief * The transitionToServiceMode function prepares for transition to service mode. * @details * Inputs : none - * Outputs : + * Outputs : none * @return none *************************************************************************/ void transitionToServiceMode( void ) { } -/************************************************************************* - * @brief execServiceMode +/*********************************************************************//** + * @brief * The execServiceMode function executes the Service Mode state machine. * @details * Inputs : none - * Outputs : + * Outputs : none * @return current state (sub-mode) *************************************************************************/ U32 execServiceMode( void ) Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -34,12 +34,12 @@ static U32 start; #endif - /** - * @addtogroup HDStandbyMode - * @{ - */ +/** + * @addtogroup HDStandbyMode + * @{ + */ - // ********** private definitions ********** +// ********** private definitions ********** // ********** private data ********** @@ -68,7 +68,8 @@ * The transitionToStandbyMode function prepares for transition to standby mode. * @details * Inputs : none - * Outputs : + * Outputs : Standby Mode module re-initialized, DG interface initialized, + * blood & dialysate pumps shut off. * @return none *************************************************************************/ void transitionToStandbyMode( void ) @@ -93,8 +94,8 @@ * @brief * The execStandbyMode function executes the Standby Mode state machine. * @details - * Inputs : none - * Outputs : + * Inputs : currentStandbyState + * Outputs : currentStandbyState * @return current state (sub-mode) *************************************************************************/ U32 execStandbyMode( void ) Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -33,10 +33,10 @@ static U32 start; #endif - /** - * @addtogroup HDTreatmentMode - * @{ - */ +/** + * @addtogroup HDTreatmentMode + * @{ + */ // ********** private definitions ********** @@ -160,8 +160,8 @@ * @brief * The execTreatmentMode function executes the Treatment Mode state machine. * @details - * Inputs : none - * Outputs : + * Inputs : currentTreatmentState + * Outputs : currentTreatmentState * @return current state (sub-mode) *************************************************************************/ U32 execTreatmentMode( void ) @@ -250,7 +250,7 @@ * the Treatment Mode state machine. * @details * Inputs : none - * Outputs : none + * Outputs : treatmentTimeMS, lastTreatmentTimeStamp * @return next treatment mode state *************************************************************************/ static TREATMENT_STATE_T handleTreatmentStartState( void ) @@ -281,7 +281,8 @@ * the Treatment Mode state machine. * @details * Inputs : none - * Outputs : none + * Outputs : treatmentTimeMS, lastTreatmentTimeStamp, dialysis sub-mode + * executed. * @return next treatment mode state *************************************************************************/ static TREATMENT_STATE_T handleTreatmentDialysisState( void ) @@ -322,7 +323,7 @@ * Treatment Mode state machine. * @details * Inputs : none - * Outputs : none + * Outputs : treatment stop sub-mode executed. * @return next treatment mode state *************************************************************************/ static TREATMENT_STATE_T handleTreatmentStopState( void ) Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -65,7 +65,7 @@ static void transitionToNewOperationMode( HD_OP_MODE_T newMode ); static void broadcastOperationMode( void ); -/************************************************************************* +/*********************************************************************//** * @brief execOperationModes * The execOperationModes function initializes the Operation Modes module. * @details @@ -99,7 +99,7 @@ initPostTreatmentMode(); } -/************************************************************************* +/*********************************************************************//** * @brief execOperationModes * The execOperationModes function executes the Operation Modes state machine. * @details @@ -176,12 +176,14 @@ broadcastOperationMode(); } -/************************************************************************* - * @brief requestNewOperationMode - * The requestNewOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The requestNewOperationMode function requests transition to a new + * operation mode. The request will be arbitrated when the state machine + * is next executed. * @details * Inputs : none - * Outputs : Initializes the Operation Modes module. + * Outputs : modeRequest[] * @return none *************************************************************************/ void requestNewOperationMode( HD_OP_MODE_T newMode ) @@ -198,26 +200,27 @@ } } -/************************************************************************* - * @brief getCurrentOperationMode - * The getCurrentOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The getCurrentOperationMode function gets the current operation mode. * @details - * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @return none + * Inputs : currentMode + * Outputs : none + * @return the current operation mode *************************************************************************/ HD_OP_MODE_T getCurrentOperationMode( void ) { return currentMode; } -/************************************************************************* - * @brief arbitrateModeRequest - * The arbitrateModeRequest function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The arbitrateModeRequest function arbitrates any pending mode transition + * requests. * @details - * Inputs : none - * Outputs : Initializes the Operation Modes module. - * @return none + * Inputs : modeRequest[] + * Outputs : modeRequest[] is reset + * @return the next operation mode (current mode if no requests pending) *************************************************************************/ static HD_OP_MODE_T arbitrateModeRequest( void ) { @@ -249,12 +252,13 @@ return reqMode; } -/************************************************************************* - * @brief transitionToNewOperationMode - * The transitionToNewOperationMode function initializes the Operation Modes module. +/*********************************************************************//** + * @brief + * The transitionToNewOperationMode function calls the transition to function + * for a new operation mode that we are transitioning to. * @details * Inputs : none - * Outputs : Initializes the Operation Modes module. + * Outputs : transition function called for new mode * @return none *************************************************************************/ static void transitionToNewOperationMode( HD_OP_MODE_T newMode ) @@ -292,7 +296,7 @@ } } -/************************************************************************* +/*********************************************************************//** * @brief * The broadcastOperationMode function sends the current operation mode at * the prescribed interval. Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -ra1daba982e3117ce45437384e770b50cfda7b7a7 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision a1daba982e3117ce45437384e770b50cfda7b7a7) @@ -30,7 +30,7 @@ // ********** private function prototypes ********** /*********************************************************************//** - * @brief initTreatmentStop + * @brief * The initTreatmentStop function initializes the Treatment Stop sub-mode * module. * @details @@ -43,7 +43,7 @@ } /*********************************************************************//** - * @brief transitionToTreatmentStop + * @brief * The transitionToTreatmentStop function prepares for transition to treatment * stop sub-mode. * @details @@ -56,7 +56,7 @@ } /*********************************************************************//** - * @brief execTreatmentStop + * @brief * The execTreatmentStop function executes the Treatment Stop sub-mode * state machine. * @details