/* * シリアル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); }
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(); } } }
/* * シリアルI/Oポートへの文字送信 */ BOOL uart_snd_chr(SIOPCB *siopcb, INT chr) { if(uart_putready(siopcb)){ uart_putchar(siopcb, (UB) chr); return(TRUE); } return(FALSE); }
/* * シリアルI/Oポートへの文字送信 */ bool_t sio_snd_chr(SIOPCB *siopcb, char c) { if (uart_putready(siopcb)){ uart_putchar(siopcb, c); return(true); } return(false); }
/* * シリアルI/Oポートへの文字送信 */ BOOL uart_snd_chr(SIOPCB *siopcb, char c) { if (uart_putready(siopcb)){ uart_putchar(siopcb, c); return(TRUE); } return(FALSE); }
/* * シリアル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); }
/* * 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; } }
static void uart_tx_isr_siop(SIOPCB *siopcb) { if (uart_putready(siopcb)) { /* * 送信可能コールバックルーチンを呼び出す. */ uart_ierdy_snd(siopcb->exinf); } }
/* * 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); } }
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); } }
/* * シリアル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); } }
/* * 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); }