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.

DCI_INT_PRI_4<br />

DCI_INT_PRI_5<br />

DCI_INT_PRI_6<br />

DCI_INT_PRI_7<br />

Return Value: None<br />

Remarks: This function clears the Interrupt Flag (DCIIF) bit and then sets the<br />

interrupt priority and enables/disables the interrupt.<br />

Source File: ConfigIntDCI.c<br />

Code Example: ConfigIntDCI(DCI_INT_PRI_6& DCI_INT_ENABLE);<br />

DataRdyDCI<br />

Description: This function returns the status of DCI receive buffers.<br />

Include: dci.h<br />

Prototype: char DataRdyDCI(void);<br />

Arguments: None<br />

Return Value: If the value of RFUL is ‘1’, then ‘1’ is returned, indicating that<br />

the data is<br />

ready to be read from the receive buffers.<br />

If the value of RFUL is ‘0’, then ‘0’ is returned, indicating that the<br />

receive buffers are empty.<br />

Remarks: This function returns the status of the DCISTAT bit. This bit<br />

indicates whether the data is available in the receive buffers.<br />

Source File: DataRdyDCI.c<br />

Code Example: while(!DataRdyDCI());<br />

OpenDCI<br />

Description: This function configures the DCI.<br />

Include: dci.h<br />

Prototype: void OpenDCI(unsigned int config1,<br />

unsigned int config2,<br />

unsigned int config3,<br />

unsigned int trans_mask,<br />

unsigned int recv_mask)<br />

Arguments: config1 This contains the parameters to be configured in<br />

the DCION1 register as defined below:<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DCI_DIS_SLOT_1<br />

DCI_DIS_SLOT_0<br />

DCI_EN_SLOT_ALL<br />

DCI_DIS_SLOT_ALL<br />

Trở lại giá trị: Không<br />

Bình luận: thói quen này cấu hình các thông số sau:<br />

1. DCICON1 đăng ký:<br />

Bit cho phép,<br />

Khung chế độ Sync,<br />

Giải thích dữ liệu,<br />

Hướng mẫu đồng hồ,<br />

Đồng hồ mẫu,<br />

Cạnh kiểm soát,<br />

Dẫn đầu ra Đồng bộ khung kiểm soát,<br />

Truyền liên tục / Nhận chế độ,<br />

Chế độ Van cân bằng.<br />

2. DCICON2 đăng ký:<br />

Khung Sync phát điện điều khiển,<br />

Kích thước bit dữ liệu Word,<br />

Đệm bit lượng kiểm soát.<br />

3. DCICON3 đăng ký: Clock Generator kiểm soát bit<br />

4. TSCON đăng ký: Truyền khe thời gian Enable bit kiểm soát.<br />

5. RSCON đăng ký: Nhận Giờ Khe cắm Enable bit kiểm soát.<br />

Source File: OpenDCI.c<br />

Mã số Ví dụ: DCICON1value = DCI_EN &<br />

DCI_IDLE_CON &<br />

DCI_DIGI_LPBACK_EN &<br />

DCI_SCKD_OUP &<br />

DCI_SAMP_CLK_FAL &<br />

DCI_FSD_OUP &<br />

DCI_TX_LASTVAL_UNF &<br />

DCI_SDO_TRISTAT &<br />

DCI_DJST_OFF &<br />

DCI_FSM_ACLINK_16BIT;<br />

DCICON2value = DCI_BUFF_LEN_4 &<br />

DCI_FRAME_LEN_2 &<br />

DS51456B-page 152<br />

Module On/Off<br />

DCI_EN<br />

2004 Microchip Technology Inc.<br />

DCI_DATA_WORD_16;<br />

DCICON3value = 0x02;<br />

RSCONvalue = DCI_EN_SLOT_ALL &

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

Saved successfully!

Ooh no, something went wrong!