closeuart1.c

来自「Mplab C30编译器」· C语言 代码 · 共 38 行

C
38
字号
#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 + =
减小字号Ctrl + -
显示快捷键?