예제 #1
0
//******************************************************************************
void serial_break_clear(serial_t *obj)
{
    // Configure the GPIO to output 1
    gpio_t tx_gpio;
    switch (((UARTName)(obj->uart))) {
        case UART_0:
            gpio_init_out(&tx_gpio, UART0_TX);
            break;
        case UART_1:
            gpio_init_out(&tx_gpio, UART1_TX);
            break;
        default:
            gpio_init_out(&tx_gpio, (PinName)NC);
            break;
    }

    gpio_write(&tx_gpio, 1);

    // Renable UART
    switch (((UARTName)(obj->uart))) {
        case UART_0:
            serial_pinout_tx(UART0_TX);
            break;
        case UART_1:
            serial_pinout_tx(UART1_TX);
            break;
        default:
            serial_pinout_tx((PinName)NC);
            break;
    }
}
예제 #2
0
//******************************************************************************
void serial_break_clear(serial_t *obj)
{
    // Configure TX to output 1
    usurp_pin(obj->tx, 1);
    // Return TX to UART control
    serial_pinout_tx(obj->tx);
}