Пример #1
0
static void ks8695uart_start_tx(struct uart_port *port)
{
	if (!tx_enabled(port)) {
		enable_irq(KS8695_IRQ_UART_TX);
		tx_enable(port, 1);
	}
}
Пример #2
0
static void ks8695uart_stop_tx(struct uart_port *port)
{
	if (tx_enabled(port)) {
		disable_irq(KS8695_IRQ_UART_TX);
		tx_enable(port, 0);
	}
}
Пример #3
0
static void ks8695uart_stop_tx(struct uart_port *port)
{
	if (tx_enabled(port)) {
		/* use disable_irq_nosync() and not disable_irq() to avoid self
		 * imposed deadlock by not waiting for irq handler to end,
		 * since this ks8695uart_stop_tx() is called from interrupt context.
		 */
		disable_irq_nosync(KS8695_IRQ_UART_TX);
		tx_enable(port, 0);
	}
}
Пример #4
0
static int ks8695uart_startup(struct uart_port *port)
{
	int retval;

	set_irq_flags(KS8695_IRQ_UART_TX, IRQF_VALID | IRQF_NOAUTOEN);
	tx_enable(port, 0);
	rx_enable(port, 1);
	ms_enable(port, 1);

	/*
	 * Allocate the IRQ
	 */
	retval = request_irq(KS8695_IRQ_UART_TX, ks8695uart_tx_chars, IRQF_DISABLED, "UART TX", port);
	if (retval)
		goto err_tx;

	retval = request_irq(KS8695_IRQ_UART_RX, ks8695uart_rx_chars, IRQF_DISABLED, "UART RX", port);
	if (retval)
		goto err_rx;

	retval = request_irq(KS8695_IRQ_UART_LINE_STATUS, ks8695uart_rx_chars, IRQF_DISABLED, "UART LineStatus", port);
	if (retval)
		goto err_ls;

	retval = request_irq(KS8695_IRQ_UART_MODEM_STATUS, ks8695uart_modem_status, IRQF_DISABLED, "UART ModemStatus", port);
	if (retval)
		goto err_ms;

	return 0;

err_ms:
	free_irq(KS8695_IRQ_UART_LINE_STATUS, port);
err_ls:
	free_irq(KS8695_IRQ_UART_RX, port);
err_rx:
	free_irq(KS8695_IRQ_UART_TX, port);
err_tx:
	return retval;
}
Пример #5
0
void
call_transmit_if_needed (void)
{
  NVIC_DisableIRQ (TIMER_32_0_IRQn);

  if (transmit_call) {
    DBG (DBG_LEVEL_INFO, "Transmitting station ID (%s)", CALL_STRING);
    tx_enable ();
    while (!tx_is_ready ());
    morse_send (CALL_STRING, strlen (CALL_STRING));
    systick_delay (CALL_POST_DELAY_MS);
    tx_disable ();

    transmit_call = false;

    Chip_TIMER_Reset (LPC_TIMER32_0);
    Chip_TIMER_ClearMatch(LPC_TIMER32_0, 0);
    Chip_TIMER_SetMatch (LPC_TIMER32_0, 0, CALL_INTERVAL_SEC);
    NVIC_ClearPendingIRQ (TIMER_32_0_IRQn);
  }

  NVIC_EnableIRQ (TIMER_32_0_IRQn);
}
static void tx_start(struct uart_regs *uart, int ints)
{
  if(ints)
    tx_enable(uart);
}