Index: firmware/App/Drivers/SafetyShutdown.c =================================================================== diff -u -rb64c49fdcf2b6d95e61e63f8e258c4e600935bbd -ref5ef16518466c92687b869cabfa16eaf3365dc0 --- firmware/App/Drivers/SafetyShutdown.c (.../SafetyShutdown.c) (revision b64c49fdcf2b6d95e61e63f8e258c4e600935bbd) +++ firmware/App/Drivers/SafetyShutdown.c (.../SafetyShutdown.c) (revision ef5ef16518466c92687b869cabfa16eaf3365dc0) @@ -1,57 +1,54 @@ -/************************************************************************** - * - * 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 "gio.h" - -#include "SafetyShutdown.h" - -// ********** private definitions ********** - -// GIO port A pin assignments for pins connected to CPLD -#define SAFETY_GIO_PORT_PIN 3U - -// CPLD pin I/O macros -#define SET_SAFETY_SHUTDOWN() gioSetBit( gioPORTB, SAFETY_GIO_PORT_PIN, PIN_SIGNAL_HIGH ) -#define CLR_SAFETY_SHUTDOWN() gioSetBit( gioPORTB, SAFETY_GIO_PORT_PIN, PIN_SIGNAL_LOW ) - -/************************************************************************* - * @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(); -} - +/************************************************************************** + * + * 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(); +}