30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

UART_RX_OVERRUN_CLEAR ;<br />

OpenUART1(U1MODEvalue, U1STAvalue, baud);<br />

OpenUART1 (Continued)<br />

OpenUART2<br />

dsPIC Peripheral Libraries<br />

2004 Microchip Technology Inc. DS51456B-page 145<br />

ReadUART1<br />

ReadUART2<br />

Description: This function returns the content of UART receive buffer<br />

(UxRXREG)<br />

register.<br />

Include: uart.h<br />

Prototype: unsigned int ReadUART1(void);<br />

unsigned int ReadUART2(void);<br />

Arguments: None<br />

Return Value: This function returns the contents of Receive buffer (UxRXREG)<br />

register.<br />

Remarks: This function returns the contents of the Receive Buffer register.<br />

If 9 bit reception is enabled, the entire register content is returned.<br />

If 8 bit reception is enabled, then register is read and the 9th bit is<br />

masked.<br />

Source File: ReadUART1.c<br />

ReadUART2.c<br />

Code Example: unsigned int RX_data;<br />

RX_data = ReadUART1();<br />

WriteUART1<br />

WriteUART2<br />

Description: This function writes data to be transmitted into the transmit buffer<br />

(UxTXREG) register.<br />

Include: uart.h<br />

Prototype: void WriteUART1(unsigned int data);<br />

void WriteUART2(unsigned int data);<br />

Source File: # define để ReadUART1 và ReadUART2 trong uart.h<br />

putcUART1<br />

putcUART2<br />

Mô tả: Chức năng này giống hệt với WriteUART1 và WriteUART2.<br />

Source File: # define để WriteUART1 và WriteUART2 trong uart.h<br />

EnableIntU1RX<br />

EnableIntU2RX<br />

Mô tả: vĩ mô Điều này cho phép các UART nhận được gián đoạn.<br />

Bao gồm: uart.h<br />

Lập luận: Không<br />

Bình luận: vĩ mô bộ UART này Nhận Interrupt Enable bit Interrupt Enable<br />

Kiểm soát đăng ký.<br />

Mã số Ví dụ: EnableIntU2RX;<br />

EnableIntU1TX<br />

EnableIntU2TX<br />

Mô tả: vĩ mô Điều này cho phép các UART truyền gián đoạn.<br />

Bao gồm: uart.h<br />

Lập luận: Không<br />

Bình luận: vĩ mô này đặt UART Transmit Interrupt Enable bit Interrupt Enable<br />

Kiểm soát đăng ký.<br />

Mã số Ví dụ: EnableIntU2TX;<br />

DisableIntU1RX<br />

DisableIntU2RX<br />

Mô tả: vĩ mô này vô hiệu hóa các UART nhận được gián đoạn.<br />

Bao gồm: uart.h<br />

Lập luận: Không<br />

Bình luận: vĩ mô này xóa UART Nhận Interrupt Enable bit Interrupt<br />

Cho phép đăng ký kiểm soát.<br />

Mã số Ví dụ: DisableIntU1RX;<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

Arguments: data This is the data to be transmitted.<br />

Return Value: None<br />

Remarks: This function writes the data to be transmitted into the transmit buffer.<br />

DS51456B trang 148<br />

DisableIntU1TX<br />

DisableIntU2TX<br />

2004 Microchip Technology Inc<br />

If 9-bit transmission is enabled, the 9-bit value is written into the<br />

transmit buffer.<br />

If 8-bit transmission is enabled, then upper byte is masked and then<br />

written into the transmit buffer.<br />

Mô tả: vĩ mô này vô hiệu hóa các UART truyền gián đoạn.<br />

Bao gồm: uart.h<br />

Lập luận: Không<br />

Bình luận: vĩ mô này xóa UART Transmit Interrupt Enable bit Interrupt

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!