Пример #1
0
/*
 *  シリアルI/Oポートへの文字送信
 */
BOOL
uart_snd_chr(SIOPCB *siopcb, char c)
{
    if(siopcb->siopinib->pmc_pcer == 0){
        while(!uart_putready(siopcb));
        uart_putchar(siopcb, c);
        return(TRUE);
    }
    else if (uart_putready(siopcb)){
        uart_putchar(siopcb, c);
        return(TRUE);
    }
    return(FALSE);
}
Пример #2
0
void bluetooth_uart_isr() {
//#ifdef DEBUG
//    printf("[bluetooth] Enter ISR.");
//#endif

    // RX
	if(rx_size > 0) {
		while (rx_size > 0 && uart_getready(p_uart)) {
			*rx_ptr++ = p_uart->RBR_THR;
			rx_size--;
		}
		if (rx_size == 0) {
#if defined(DEBUG)
			syslog(LOG_DEBUG, "[bluetooth] Finished receiving a block.");
#endif
			assert(rx_cb != NULL);
			rx_cb();
		}
	} else {
		p_uart->IER &= ~0x1;
	}

    // TX
    while(tx_size > 0 && uart_putready(p_uart)) {
        p_uart->RBR_THR = *tx_ptr++;
        if(--tx_size == 0) {
#if defined(DEBUG)
        	syslog(LOG_DEBUG, "[bluetooth] Finished sending a block.");
#endif
            p_uart->IER &= ~0x2;
            assert(tx_cb != NULL);
            tx_cb();
        }
    }
}
Пример #3
0
/*                                                                             
 *  シリアルI/Oポートへの文字送信                                            
 */
BOOL
uart_snd_chr(SIOPCB *siopcb, INT chr)
{
    if(uart_putready(siopcb)){
        uart_putchar(siopcb, (UB) chr);
        return(TRUE);
    }
    return(FALSE);
}
Пример #4
0
/*
 *  シリアルI/Oポートへの文字送信
 */
bool_t
sio_snd_chr(SIOPCB *siopcb, char c)
{    
    if (uart_putready(siopcb)){
        uart_putchar(siopcb, c);
        return(true);
    }
    return(false);
}
Пример #5
0
/*
 *  シリアルI/Oポートへの文字送信
 */
BOOL
uart_snd_chr(SIOPCB *siopcb, char c)
{
    if (uart_putready(siopcb)){
        uart_putchar(siopcb, c);
        return(TRUE);
    }
    return(FALSE);
}
Пример #6
0
/*
 *  シリアルI/Oポートへの文字送信
 */
bool_t
uart_send(uart_t *p_uart, char c)
{
	if (uart_putready(p_uart)){
	//while(!uart_putready(p_uart));{
        p_uart->RBR_THR = c;
		return(true);
	}
	return(false);
}
Пример #7
0
/*
 *  sio port send char
 */
bool_t
sio_snd_chr(SIOPCB *siopcb, char_t c)
{    
	if (uart_putready(siopcb->p_siopinib->regs)) {
		uart_putchar(siopcb->p_siopinib->regs, c);
		return true;
	} else {
		return false;
	}
}
Пример #8
0
static void
uart_tx_isr_siop(SIOPCB *siopcb)
{
    if (uart_putready(siopcb)) {
        /*
         *  送信可能コールバックルーチンを呼び出す.
         */
        uart_ierdy_snd(siopcb->exinf);
    }
}
Пример #9
0
/*
 *  SIOの割込みハンドラ
 */
void
sio_handler(void)
{
	SIOPCB *p_siopcb = get_siopcb((x_prc_index() + 1));
	if (uart_getready(p_siopcb)) {
		/*
		 *  受信通知コールバックルーチンを呼び出す.
		 */
		sio_irdy_rcv(p_siopcb->exinf);
	}
	if (uart_putready(p_siopcb)) {
		/*
		 *  送信可能コールバックルーチンを呼び出す.
		 */
		sio_irdy_snd(p_siopcb->exinf);
	}
}
Пример #10
0
void
sio_handler1(void)
{
    SIOPCB *p_siopcb = &(siopcb_table[0]);
    
    if (uart_getready(p_siopcb)) {
        /*
         *  受信通知コールバックルーチンを呼び出す.
         */
        sio_irdy_rcv(p_siopcb->exinf);
    }
    if (uart_putready(p_siopcb)) {
        /*
         *  送信可能コールバックルーチンを呼び出す.
         */
        sio_irdy_snd(p_siopcb->exinf);
    }    
}
Пример #11
0
/*                                                                            
 *  シリアルI/Oポートに対する割込み処理                                       
 */
static void
uart_isr_siop(SIOPCB *siopcb)
{
    /*
     * エッジ割込みのため割込み処理前にACK
     */
    intc_ack_interrupt(1 << (UARTINTLVL - 1));
    
    if (uart_getready(siopcb)) {
        /*
         *  受信通知コールバックルーチンを呼び出す.
         */
        uart_ierdy_rcv(siopcb->exinf);
    }

    if (uart_putready(siopcb)) {
        /*
         *  送信可能コールバックルーチンを呼び出す.
         */
        uart_ierdy_snd(siopcb->exinf);
    }
}
Пример #12
0
/*
 *  the polling output of uart
 */
void
emstartkit_putc(DW_APB_UART_STRUCT_PTR regs, char_t c)
{
	while (!uart_putready(regs));
	uart_putchar(regs, c);
}