?? probe_rs232c.c
字號(hào):
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_RxTxISRHandler (void)
{
volatile CPU_INT08U rx_data;
volatile CPU_INT08U lsr;
volatile CPU_INT08U iir;
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
iir = U0IIR & 0x0F;
while (iir != 1) {
switch (iir) {
case 2: /* Transmitted character? */
ProbeRS232_TxHandler();
break;
case 4: /* Received a character? */
lsr = U0LSR;
rx_data = U0RBR;
ProbeRS232_RxHandler(rx_data); /* Call the generic Rx handler */
break;
default:
break;
}
iir = U0IIR & 0x0F;
}
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
iir = U1IIR & 0x0F;
while (iir != 1) {
switch (iir) {
case 2: /* Transmitted character? */
ProbeRS232_TxHandler();
break;
case 4: /* Received a character? */
lsr = U1LSR;
rx_data = U1RBR;
ProbeRS232_RxHandler(rx_data); /* Call the generic Rx handler */
break;
default:
break;
}
iir = U1IIR & 0x0F;
}
#endif
VICVectAddr = 0x00000000L; /* Clear the vector address register */
}
/*
*********************************************************************************************************
* ProbeRS232_RxISRHandler()
*
* Description: Handle Rx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*
* Note(s) : This function is empty because Rx interrupts are handled by ProbeRS232_RxTxISRHandler()
*********************************************************************************************************
*/
void ProbeRS232_RxISRHandler (void)
{
}
/*
*********************************************************************************************************
* ProbeRS232_RxIntDis()
*
* Description: Disable Rx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_RxIntDis (void)
{
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
U0IER &= ~DEF_BIT_00;
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
U1IER &= ~DEF_BIT_00;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_RxIntEn()
*
* Description: Enable Rx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_RxIntEn (void)
{
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
U0IER |= DEF_BIT_00;
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
U1IER |= DEF_BIT_00;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxISRHandler()
*
* Description: Handle Tx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*
* Note(s) : This function is empty because Tx interrupts are handled by ProbeRS232_RxTxISRHandler()
*********************************************************************************************************
*/
void ProbeRS232_TxISRHandler (void)
{
}
/*
*********************************************************************************************************
* ProbeRS232_Tx1()
*
* Description: Transmit one byte.
*
* Argument(s): c The byte to transmit.
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_Tx1 (CPU_INT08U c)
{
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
U0THR = c;
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
U1THR = c;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxIntDis()
*
* Description: Disable Tx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_TxIntDis (void)
{
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
U0IER &= ~DEF_BIT_01;
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
U1IER &= ~DEF_BIT_01;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxIntEn()
*
* Description: Enable Tx interrupts.
*
* Argument(s): none.
*
* Return(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_TxIntEn (void)
{
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_0)
U0IER |= DEF_BIT_01;
#endif
#if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
U1IER |= DEF_BIT_01;
#endif
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -