📄 probe_rs232c.c
字号:
/*
*********************************************************************************************************
* ProbeRS232_RxISRHandler()
*
* Description : Handle receive interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : (1) This function is empty because receive interrupts are handled by the combined receive/
* transmit interrupt handler, 'ProbeRS232_RxTxISRHandler()'.
*********************************************************************************************************
*/
void ProbeRS232_RxISRHandler (void)
{
}
/*
*********************************************************************************************************
* ProbeRS232_RxIntDis()
*
* Description : Disable receive interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : (1) The application should call this function to stop communication.
*********************************************************************************************************
*/
void ProbeRS232_RxIntDis (void)
{
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_0)
U0IER &= ~DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_1)
U1IER &= ~DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_2)
U2IER &= ~DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_3)
U3IER &= ~DEF_BIT_00;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_RxIntEn()
*
* Description : Enable receive interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : (1) The application should call this function to start communication.
*********************************************************************************************************
*/
void ProbeRS232_RxIntEn (void)
{
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_0)
U0IER |= DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_1)
U1IER |= DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_2)
U2IER |= DEF_BIT_00;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_3)
U3IER |= DEF_BIT_00;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxISRHandler()
*
* Description : Handle transmit interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : (1) This function is empty because transmit interrupts are handled by the combined receive/
* transmit interrupt handler, 'ProbeRS232_RxTxISRHandler()'.
*********************************************************************************************************
*/
void ProbeRS232_TxISRHandler (void)
{
}
/*
*********************************************************************************************************
* ProbeRS232_Tx1()
*
* Description : Transmit one byte.
*
* Argument(s) : c The byte to transmit.
*
* Return(s) : none.
*
* Caller(s) : ProbeRS232_TxHandler().
*
* Note(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_Tx1 (CPU_INT08U c)
{
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_0)
U0THR = c;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_1)
U1THR = c;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_2)
U2THR = c;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_3)
U3THR = c;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxIntDis()
*
* Description : Disable transmit interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : ProbeRS232_TxHandler().
*
* Note(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_TxIntDis (void)
{
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_0)
U0IER &= ~DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_1)
U1IER &= ~DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_2)
U2IER &= ~DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_3)
U3IER &= ~DEF_BIT_01;
#endif
}
/*
*********************************************************************************************************
* ProbeRS232_TxIntEn()
*
* Description : Enable transmit interrupts.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : ProbeRS232_TxStart().
*
* Note(s) : none.
*********************************************************************************************************
*/
void ProbeRS232_TxIntEn (void)
{
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_0)
U0IER |= DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_1)
U1IER |= DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_2)
U2IER |= DEF_BIT_01;
#endif
#if (PROBE_RS232_CFG_COMM_SEL == PROBE_RS232_UART_3)
U3IER |= DEF_BIT_01;
#endif
}
/*
*********************************************************************************************************
* ENABLE END
*
* Note(s) : See 'ENABLE Note #1'.
*********************************************************************************************************
*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -