Exemple #1
0
/*******************************************************************************
* Function Name: SPIM_Wakeup
********************************************************************************
*
* Summary:
*  Prepare SPIM Component to wake up.
*
* Parameters:  
*  None.
*
* Return: 
*  None.
*
* Global Variables:
*  SPIM_backup - used when non-retention registers are restored.
*  SPIM_txBufferWrite - modified every function call - resets to 
*  zero.
*  SPIM_txBufferRead - modified every function call - resets to 
*  zero.
*  SPIM_rxBufferWrite - modified every function call - resets to
*  zero.
*  SPIM_rxBufferRead - modified every function call - resets to
*  zero. 
*
* Reentrant:
*  No.
*
*******************************************************************************/
void SPIM_Wakeup(void) 
{        
    SPIM_RestoreConfig();
         
    #if (SPIM_TXBUFFERSIZE > 4u)
    
        SPIM_txBufferRead = 0u;
        SPIM_txBufferWrite = 0u;
        
    #endif /* SPIM_TXBUFFERSIZE > 4u */
    
    #if (SPIM_RXBUFFERSIZE > 4u)    
    
        SPIM_rxBufferRead = 0u;
        SPIM_rxBufferWrite = 0u;
        
    #endif /* SPIM_RXBUFFERSIZE > 4u */ 
    
    SPIM_ClearFIFO();
    
    /* Restore components block enable state */
    if (SPIM_backup.enableState != 0u)
    {
         /* Components block was enabled */
         SPIM_Enable();
    } /* Do nothing if components block was disabled */
}
Exemple #2
0
/*******************************************************************************
* Function Name: SPIM_Wakeup
********************************************************************************
*
* Summary:
*  Prepare SPIM Component to wake up.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Global Variables:
*  SPIM_backup - used when non-retention registers are restored.
*  SPIM_txBufferWrite - modified every function call - resets to
*  zero.
*  SPIM_txBufferRead - modified every function call - resets to
*  zero.
*  SPIM_rxBufferWrite - modified every function call - resets to
*  zero.
*  SPIM_rxBufferRead - modified every function call - resets to
*  zero.
*
* Reentrant:
*  No.
*
*******************************************************************************/
void SPIM_Wakeup(void) 
{
    SPIM_RestoreConfig();

    #if(SPIM_RX_SOFTWARE_BUF_ENABLED)
        SPIM_rxBufferFull  = 0u;
        SPIM_rxBufferRead  = 0u;
        SPIM_rxBufferWrite = 0u;
    #endif /* (SPIM_RX_SOFTWARE_BUF_ENABLED) */

    #if(SPIM_TX_SOFTWARE_BUF_ENABLED)
        SPIM_txBufferFull  = 0u;
        SPIM_txBufferRead  = 0u;
        SPIM_txBufferWrite = 0u;
    #endif /* (SPIM_TX_SOFTWARE_BUF_ENABLED) */

    /* Clear any data from the RX and TX FIFO */
    SPIM_ClearFIFO();

    /* Restore components block enable state */
    if(0u != SPIM_backup.enableState)
    {
        SPIM_Enable();
    }
}
Exemple #3
0
/*******************************************************************************
* Function Name: SPIM_Start
********************************************************************************
*
* Summary:
*  Initialize and Enable the SPI Master component.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Global variables:
*  SPIM_initVar - used to check initial configuration, modified on
*  first function call.
*
* Theory:
*  Enable the clock input to enable operation.
*
* Reentrant:
*  No.
*
*******************************************************************************/
void SPIM_Start(void)
{       
    if(SPIM_initVar == 0u)
    {               
        SPIM_Init();
        SPIM_initVar = 1u; 
    }                       
        
    SPIM_Enable();        
}
Exemple #4
0
/*******************************************************************************
* Function Name: SPIM_Start
********************************************************************************
*
* Summary:
*  Initialize and Enable the SPI Master component.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Global variables:
*  SPIM_initVar - used to check initial configuration, modified on
*  first function call.
*
* Theory:
*  Enable the clock input to enable operation.
*
* Reentrant:
*  No.
*
*******************************************************************************/
void SPIM_Start(void) 
{
    if(0u == SPIM_initVar)
    {
        SPIM_Init();
        SPIM_initVar = 1u;
    }

    SPIM_Enable();
}