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.

stored into CNPU2 register. The upper 8 bits of CNPU2<br />

register are unimplemented.<br />

Return Value: None<br />

Remarks: None<br />

Source File: ConfigCNPullups.c<br />

Code Example: ConfigCNPullups(0xFFF);<br />

ConfigIntCN<br />

Description: This function configures the CN interrupts.<br />

Include: ports.h<br />

Prototype: void ConfigIntCN(long int config);<br />

Arguments: config This is the 32-bit value for configuring the CN interrupts.<br />

The lower 24 bits contain the individual enable/disable<br />

information for the CN interrupts. Setting bit x (x = 0, 1, ...,<br />

23) would enable the CNx interrupt.<br />

The upper most byte of config contains the Interrupt Priority<br />

and Enable/Disable bits.<br />

The lower word is stored into the CNEN1register and next<br />

upper byte is stored into the CNEN2 register and the upper<br />

most byte is used for setting priority and enable/disable the<br />

CN interrupts.<br />

Return Value: None<br />

Remarks: This function clears the CN interruptflag and enables/disables the<br />

individual interrupts on CN pins.<br />

This also configures the interrupt priority and enables/disables the CN<br />

Interrupt Enable bit.<br />

Source File: ConfigIntCN.c<br />

Code Example: // This would enable CN0, CN1, CN2 and CN7 only.<br />

ConfigIntCN(CHANGE_INT_OFF & CHANGE_INT_PRI_4 &<br />

0xFF000087);<br />

dsPIC Peripheral Libraries<br />

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

3.9.2 Individual Macros<br />

EnableCN0<br />

EnableCN1<br />

EnableCN2<br />

.....................<br />

EnableCN23<br />

Description: This macro enables the individual change notification interrupt.<br />

Include: ports.h<br />

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

Mã số Ví dụ: SetPriorityInt4 (6);<br />

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

2004 Microchip Technology Inc DS51456B trang 125<br />

3.10 VÀO CHỨC NĂNG CAPTURE<br />

Phần này bao gồm một danh sách các chức năng riêng biệt cho Input Capture<br />

module và một<br />

ví dụ về việc sử dụng các chức năng. Chức năng có thể được thực hiện như các<br />

macro.<br />

3.10.1 Chức năng cá nhân<br />

CloseCapture1<br />

CloseCapture2<br />

CloseCapture3<br />

CloseCapture4<br />

CloseCapture5<br />

CloseCapture6<br />

CloseCapture7<br />

CloseCapture8<br />

Mô tả: Chức năng này sẽ tắt các mô-đun Input Capture.<br />

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

Prototype: void CloseCapture1 (void);<br />

làm mất hiệu lực CloseCapture2 (void);<br />

làm mất hiệu lực CloseCapture3 (void);<br />

làm mất hiệu lực CloseCapture4 (void);<br />

làm mất hiệu lực CloseCapture5 (void);<br />

làm mất hiệu lực CloseCapture6 (void);<br />

làm mất hiệu lực CloseCapture7 (void);<br />

làm mất hiệu lực CloseCapture8 (void);<br />

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

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

Ghi chú: Chức năng này vô hiệu hóa các Input Capture gián đoạn và sau đó tắt<br />

module.The ngắt Flagbit cũng sẽ bị xóa.<br />

Source File: CloseCapture1.c<br />

CloseCapture2.c<br />

CloseCapture3.c<br />

CloseCapture4.c<br />

CloseCapture5.c<br />

CloseCapture6.c<br />

CloseCapture7.c<br />

CloseCapture8.c

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

Saved successfully!

Ooh no, something went wrong!