⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 closeuart1.c

📁 Mplab C30编译器
💻 C
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include "uart.h"

/*********************************************************************
Function Prototype : void CloseUART1(void)
  
Include            : uart.h
 
Description        : This function disables the UART and clears the
                     interrupt enable and flag bits.  
  
Arguments          : None
 
Return Value       : None
 
Remarks            : This function first turns off the UART module and
                     then disables the UART transmit and receive interrupts.
                     The Interrupt Flag bits are also cleared.                                       
*********************************************************************/
#ifdef _UART_IRDA_V1_1

void CloseUART1(void)
{  
    U1MODEbits.UARTEN = 0;
	
    IEC0bits.U1RXIE = 0;
    IEC0bits.U1TXIE = 0;
	
    IFS0bits.U1RXIF = 0;
    IFS0bits.U1TXIF = 0;
}

#else
#warning "Does not build on this target"
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -