Index: firmware/App/Drivers/GPIO.c =================================================================== diff -u --- firmware/App/Drivers/GPIO.c (revision 0) +++ firmware/App/Drivers/GPIO.c (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -0,0 +1,93 @@ +/************************************************************************** +* +* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file GPIO.c +* +* @author (last) Vinayakam Mani +* @date (last) 29-Aug-2024 +* +* @author (original) Vinayakam Mani +* @date (original) 29-Aug-2024 +* +***************************************************************************/ + +#include "gio.h" +#include "mibspi.h" + +#include "GPIO.h" + +/** + * @addtogroup GPIO + * @{ + */ + +// ********** private definitions ********** + +#define WD_PET_GIO_PORT_PIN 1U ///< Watchdog pet GPIO pin number. +#define WD_EXP_GIO_PORT_PIN 0U ///< Watchdog expired GPIO pin number. + +#define GET_WD_EXP() ( PIN_SIGNAL_STATE_T )( gioGetBit( gioPORTB, WD_EXP_GIO_PORT_PIN ) ) ///< Get watchdog expired pin state macro. +#define TGL_WD_PET() gioToggleBit( gioPORTB, WD_PET_GIO_PORT_PIN ) ///< Macro to toggle watchdog pet 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 CLR_WD_PET() gioSetBit( gioPORTB, WD_PET_GIO_PORT_PIN, PIN_SIGNAL_LOW ) ///< Macro to set watchdog pet signal state low. + +/*********************************************************************//** + * @brief + * The toggleWatchdogPetSignal function toggles the watchdog pet output + * signal on its GPIO pin. + * @details \b Inputs: none + * @details \b Outputs: Watchdog pet output signal toggled + * @return none + *************************************************************************/ +void toggleWatchdogPetSignal( void ) +{ + TGL_WD_PET(); +} + +/*********************************************************************//** + * @brief + * The setWatchdogPetSignal function sets the watchdog pet output + * signal on its GPIO pin to HIGH. + * @details \b Inputs: none + * @details \b Outputs: Watchdog pet output signal set high + * @return none + *************************************************************************/ +void setWatchdogPetSignal( void ) +{ + SET_WD_PET(); +} + +/*********************************************************************//** + * @brief + * The clrWatchdogPetSignal function sets the watchdog pet output + * signal on its GPIO pin to LOW. + * @details \b Inputs: none + * @details \b Outputs: Watchdog pet output signal set low + * @return none + *************************************************************************/ +void clrWatchdogPetSignal( void ) +{ + CLR_WD_PET(); +} + +/*********************************************************************//** + * @brief + * The getWatchdogExpired function determines the current signal level + * on the watchdog expired pin from the CPLD. + * @details Inputs: Signal from CPLD on watchdog expired pin. + * @details Outputs: none + * @return level (LOW or HIGH) + *************************************************************************/ +PIN_SIGNAL_STATE_T getWatchdogExpired( void ) +{ + PIN_SIGNAL_STATE_T level = GET_WD_EXP(); + + return level; +} + +/**@}*/ Index: firmware/App/Drivers/GPIO.h =================================================================== diff -u --- firmware/App/Drivers/GPIO.h (revision 0) +++ firmware/App/Drivers/GPIO.h (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -0,0 +1,41 @@ +/************************************************************************** +* +* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file GPIO.h +* +* @author (last) Vinayakam Mani +* @date (last) 29-Aug-2024 +* +* @author (original) Sean +* @date (original) 29-Aug-2024 +* +***************************************************************************/ + +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#include "DDCommon.h" + +/** + * @defgroup GPIO GPIO + * @brief The GPIO unit provides definitions and GPIO pin access abstraction + * functions to provide low-level GPIO interface. + * + * @addtogroup GPIO + * @{ + */ + +// ********** public function prototypes ********** + +void toggleWatchdogPetSignal( void ); +void setWatchdogPetSignal( void ); +void clrWatchdogPetSignal( void ); +PIN_SIGNAL_STATE_T getCPLDWatchdogExpired( void ); + +/**@}*/ + +#endif Index: firmware/App/Drivers/InternalADC.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -r5d682ef4b973ca85e67ac00cc2610e2f6c378b0c --- firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -58,7 +58,8 @@ INT_ADC_POWER_SUPPLY_1_THERMISTOR, // 22 INT_ADC_MAIN_NON_ISOLATED_24_VOLTS, // 23 }; - + +/// ADC channel read to units look-up table. const F32 ADC_CHANNEL_READ_TO_UNITS[ NUM_OF_INT_ADC_CHANNELS ] = { 0.0, // - INT_ADC_NOT_USED Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -r5d682ef4b973ca85e67ac00cc2610e2f6c378b0c --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -22,7 +22,9 @@ /** * @defgroup InternalADC InternalADC - * @brief DD internal ADC module. + * @brief DD internal ADC module. This module converts all analog channel (DD + * different voltage rails, pressure, temperature) into digital value for further + * processing ( monitoring and controls). * * @addtogroup InternalADC * @{ Index: firmware/App/Drivers/PAL.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -r5d682ef4b973ca85e67ac00cc2610e2f6c378b0c --- firmware/App/Drivers/PAL.c (.../PAL.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Drivers/PAL.c (.../PAL.c) (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -7,13 +7,14 @@ * * @file PAL.c * -* @author (last) Sean +* @author (last) Vinayakam Mani * @date (last) 07-Aug-2024 * -* @author (original) Sean +* @author (original) Vinayakam Mani * @date (original) 07-Aug-2024 * ***************************************************************************/ + #include "mibspi.h" #include "reg_system.h" #include "reg_crc.h" Index: firmware/App/Drivers/PAL.h =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -r5d682ef4b973ca85e67ac00cc2610e2f6c378b0c --- firmware/App/Drivers/PAL.h (.../PAL.h) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Drivers/PAL.h (.../PAL.h) (revision 5d682ef4b973ca85e67ac00cc2610e2f6c378b0c) @@ -7,10 +7,10 @@ * * @file PAL.h * -* @author (last) Sean +* @author (last) Vinayakam Mani * @date (last) 07-Aug-2024 * -* @author (original) Sean +* @author (original) Vinayakam Mani * @date (original) 07-Aug-2024 * ***************************************************************************/