/************************************************************************** * * Copyright (c) 2019-2020 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 SafetyShutdown.c * * @date 20-Sep-2019 * @author S. Nash * * @brief Controller for the safety shutdown signal. * **************************************************************************/ #include "mibspi.h" #include "SafetyShutdown.h" // ********** private definitions ********** // pin I/O macros #define SAFETY_SPI1_PORT_MASK 0x00000010 // (CS[4] - re-purposed as output GPIO) #define SET_SAFETY_SHUTDOWN() {mibspiREG1->PC3 |= SAFETY_SPI1_PORT_MASK;} #define CLR_SAFETY_SHUTDOWN() {mibspiREG1->PC3 &= ~SAFETY_SPI1_PORT_MASK;} /************************************************************************* * @brief initSafetyShutdown * The initSafetyShutdown function initializes the Buttons module. * @details * Inputs : none * Outputs : Safety Shutdown module signal output set to initial state. * @param none * @return none *************************************************************************/ void initSafetyShutdown( void ) { CLR_SAFETY_SHUTDOWN(); } /************************************************************************* * @brief activateSafetyShutdown * The activateSafetyShutdown function activates the safety shutdown signal. * @details * Inputs : none * Outputs : Safety Shutdown signal output set to active state. * @param none * @return none *************************************************************************/ void activateSafetyShutdown( void ) { SET_SAFETY_SHUTDOWN(); }