30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Prototype: unsigned int ReadDCI(unsigned char buffer);<br />

Arguments: bufferThis is the DCI buffer number to be read.<br />

Return Value: None<br />

Remarks: This function returns the contents ofDCI receive buffer pointed by the<br />

buffer.<br />

Source File: ReadDCI.c<br />

Code Example: unsigned int DCI_buf0;<br />

DCI_buf0 = ReadDCI(0);<br />

WriteDCI<br />

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

buffer.<br />

Include: dci.h<br />

Prototype: void WriteDCI(unsigned int data_out,<br />

unsigned char buffer);<br />

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

buffer This is the DCI buffer number to be written.<br />

Return Value: None<br />

Remarks: This function loads the transmit buffer specified by the bufferwith<br />

data_out.<br />

Source File: WriteDCI.c<br />

Code Example: unsigned int DCI_tx0 = 0x60;<br />

WriteDCI(DCI_tx0, 0);<br />

dsPIC Peripheral Libraries<br />

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

3.13.2 Individual Macros<br />

EnableIntDCI<br />

Description: This macro enables the DCI interrupt.<br />

Include: dci.h<br />

Arguments: None<br />

Remarks: This macro sets DCI Interrupt Enablebit of Interrupt Enable Control<br />

register.<br />

Code Example: EnableIntDCI;<br />

DisableIntDCI<br />

Description: This macro disables the DCI interrupt.<br />

Include: dci.h<br />

Arguments: None<br />

Remarks: This macro clears DCI Interrupt Enable bit of Interrupt Enable<br />

Control<br />

register.<br />

OpenDCI (DCICON1value, DCICON2value, DCICON3value,<br />

TSCONvalue, RSCONvalue);<br />

dsPIC Thư viện ngoại vi<br />

2004 Microchip Technology Inc DS51456B trang 157<br />

/ * Load truyền đệm và truyền cùng * /<br />

i = 0;<br />

trong khi (i

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

Saved successfully!

Ooh no, something went wrong!