Пример #1
0
void uart_write_ext_wkup_func(uint8_t *bufptr, uint32_t size, void (*callback) (uint8_t))
{
    // Sanity check
    ASSERT_ERR(bufptr != NULL);
    ASSERT_ERR(size != 0);
    ASSERT_ERR(uart_env.tx.bufptr == NULL);
	
		GPIO_SetActive (EXT_WAKEUP_PORT, EXT_WAKEUP_PIN);
			
    // Prepare TX parameters
    uart_env.tx.size = size;
    uart_env.tx.bufptr = bufptr;
		uart_env.tx.callback = callback;

    /* start data transaction
     * first isr execution is done without interrupt generation to reduce
     * interrupt load
     */
    uart_thr_empty_isr();
    if (uart_env.tx.bufptr != NULL)
    {
			uart_thr_empty_setf(1);
    }
		GPIO_SetInactive (EXT_WAKEUP_PORT, EXT_WAKEUP_PIN);
}
Пример #2
0
void UART_Handler_func(void)
{
    uint32_t idd;
    idd = 0x0F & GetWord32(UART_IIR_FCR_REG);
    if(idd!=NO_INT_PEND)
    {
        switch(idd)
        {
          case UART_TIMEOUT:
            if ((uart_env.errordetect == UART_ERROR_DETECT_ENABLED) && uart_fifo_err_getf())
            {
                uart_rec_error_isr();
            }
            break;
          case RECEIVED_AVAILABLE:
            uart_rec_data_avail_isr();               
            break;

          case THR_EMPTY:
            uart_thr_empty_isr();
            break;

          default:
            break;
        }
    }

}