예제 #1
0
파일: SPIM.c 프로젝트: 777string/reload-pro
/*******************************************************************************
* Function Name: SPIM_Stop
********************************************************************************
*
* Summary:
*  Disable the SPI Master component.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Theory:
*  Disable the clock input to enable operation.
*
*******************************************************************************/
void SPIM_Stop(void) 
{
    uint8 enableInterrupts;

    enableInterrupts = CyEnterCriticalSection();
    SPIM_TX_STATUS_ACTL_REG &= ((uint8) ~SPIM_INT_ENABLE);
    SPIM_RX_STATUS_ACTL_REG &= ((uint8) ~SPIM_INT_ENABLE);
    CyExitCriticalSection(enableInterrupts);

    #if(0u != SPIM_INTERNAL_CLOCK)
        SPIM_IntClock_Disable();
    #endif /* (0u != SPIM_INTERNAL_CLOCK) */

    SPIM_DisableTxInt();
    SPIM_DisableRxInt();
}
예제 #2
0
파일: SPIM.c 프로젝트: harishree7/projects
/*******************************************************************************
* Function Name: SPIM_Stop
********************************************************************************
*
* Summary:
*  Disable the SPI Master component.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Theory:
*  Disable the clock input to enable operation.
*
*******************************************************************************/
void SPIM_Stop(void) 
{
    uint8 enableInterrupts = 0u;    
    
    enableInterrupts = CyEnterCriticalSection();
    
    SPIM_TX_STATUS_ACTL_REG &= ~SPIM_INT_ENABLE;
    SPIM_RX_STATUS_ACTL_REG &= ~SPIM_INT_ENABLE;
    
    CyExitCriticalSection(enableInterrupts);
    
    #if(SPIM_InternalClockUsed)    
        SPIM_IntClock_Disable();        
    #endif /* SPIM_InternalClockUsed */
    
    #if(SPIM_InternalTxInterruptEnabled)    
        CyIntDisable(SPIM_TX_ISR_NUMBER);        
    #endif /* SPIM_InternalTxInterruptEnabled */
    
    #if(SPIM_InternalRxInterruptEnabled)    
        CyIntDisable(SPIM_RX_ISR_NUMBER);        
    #endif /* SPIM_InternalRxInterruptEnabled */
}