Ejemplo n.º 1
0
    /*******************************************************************************
    * Function Name: UART_2_SpiUartClearRxBuffer
    ********************************************************************************
    *
    * Summary:
    *  Clears the receive buffer and RX FIFO.
    *
    * Parameters:
    *  None
    *
    * Return:
    *  None
    *
    *******************************************************************************/
    void UART_2_SpiUartClearRxBuffer(void)
    {
        #if (UART_2_CHECK_RX_SW_BUFFER)
        {
            /* Lock from component interruption */
            UART_2_DisableInt();

            /* Flush RX software buffer */
            UART_2_rxBufferHead = UART_2_rxBufferTail;
            UART_2_rxBufferOverflow = 0u;

            UART_2_CLEAR_RX_FIFO;
            UART_2_ClearRxInterruptSource(UART_2_INTR_RX_ALL);

            #if (UART_2_CHECK_UART_RTS_CONTROL_FLOW)
            {
                /* Enable RX Not Empty interrupt source to continue receiving
                * data into software buffer.
                */
                UART_2_INTR_RX_MASK_REG |= UART_2_INTR_RX_NOT_EMPTY;
            }
            #endif

            /* Release lock */
            UART_2_EnableInt();
        }
        #else
        {
            UART_2_CLEAR_RX_FIFO;
        }
        #endif
    }
Ejemplo n.º 2
0
/*******************************************************************************
* Function Name: UART_2_Stop
********************************************************************************
*
* Summary:
*  Disables the SCB component and its interrupt.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void UART_2_Stop(void)
{
#if(UART_2_SCB_IRQ_INTERNAL)
    UART_2_DisableInt();
#endif /* (UART_2_SCB_IRQ_INTERNAL) */

    UART_2_CTRL_REG &= (uint32) ~UART_2_CTRL_ENABLED;  /* Disable scb IP */

#if(UART_2_SCB_IRQ_INTERNAL)
    UART_2_ClearPendingInt();
#endif /* (UART_2_SCB_IRQ_INTERNAL) */

    UART_2_ScbModeStop(); /* Calls scbMode specific Stop function */
}
Ejemplo n.º 3
0
    /*******************************************************************************
    * Function Name: UART_2_SpiUartClearTxBuffer
    ********************************************************************************
    *
    * Summary:
    *  Clears the transmit buffer and TX FIFO.
    *
    * Parameters:
    *  None
    *
    * Return:
    *  None
    *
    *******************************************************************************/
    void UART_2_SpiUartClearTxBuffer(void)
    {
        #if (UART_2_CHECK_TX_SW_BUFFER)
        {
            /* Lock from component interruption */
            UART_2_DisableInt();

            /* Flush TX software buffer */
            UART_2_txBufferHead = UART_2_txBufferTail;

            UART_2_INTR_TX_MASK_REG &= (uint32) ~UART_2_INTR_TX_NOT_FULL;
            UART_2_CLEAR_TX_FIFO;
            UART_2_ClearTxInterruptSource(UART_2_INTR_TX_ALL);

            /* Release lock */
            UART_2_EnableInt();
        }
        #else
        {
            UART_2_CLEAR_TX_FIFO;
        }
        #endif
    }