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.

Language Tools Libraries<br />

DS51456B-page 180<br />

3.16.2 Individual Macros<br />

EnableIntMCPWM<br />

2004 Microchip Technology Inc.<br />

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

Include: pwm.h<br />

Arguments: None<br />

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

register.<br />

Code Example: EnableIntMCPWM;<br />

DisableIntMCPWM<br />

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

Include: pwm.h<br />

Arguments: None<br />

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

Control<br />

register.<br />

Code Example: DisableIntMCPWM;<br />

SetPriorityIntMCPWM<br />

Description: This macro sets priority for PWM interrupt.<br />

Include: pwm.h<br />

Arguments: priority<br />

Remarks: This macro sets PWM Interrupt Priority bits of Interrupt Priority<br />

Control<br />

register.<br />

Code Example: SetPriorityIntMCPWM(7);<br />

EnableIntFLTA<br />

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

Include: pwm.h<br />

Arguments: None<br />

Remarks: This macro sets FLTA Interrupt Enable bit of Interrupt Enable<br />

Control<br />

register.<br />

Code Example: EnableIntFLTA;<br />

DisableIntFLTA<br />

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

Include: pwm.h<br />

Arguments: None<br />

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

Control<br />

register.<br />

config1 = (PWM_EN & PWM_PTSIDL_DIS & PWM_OP_SCALE16<br />

& PWM_IPCLK_SCALE16 &<br />

PWM_MOD_UPDN);<br />

config2 = (PWM_MOD1_COMP & PWM_PDIS4H & PWM_PDIS3H &<br />

PWM_PDIS2H & PWM_PEN1H & PWM_PDIS4L &<br />

PWM_PDIS3L & PWM_PDIS2L & PWM_PEN1L);<br />

config3 = (PWM_SEVOPS1 & PWM_OSYNC_PWM & PWM_UEN);<br />

OpenMCPWM (thời gian, sptime, config1, config2, config3);<br />

trong khi (1);<br />

}<br />

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

2004 Microchip Technology Inc DS51456B trang 183<br />

3.17 Tôi<br />

2<br />

C chức năng<br />

Phần này bao gồm một danh sách các chức năng cá nhân cho tôi<br />

2<br />

C module và một ví dụ về sử dụng<br />

các chức năng. Chức năng có thể được thực hiện như các macro.<br />

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

CloseI2C<br />

Mô tả: Chức năng này sẽ tắt thei<br />

2<br />

Cmodule<br />

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

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

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

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

Bình luận: Chức năng này vô hiệu hóa tôi<br />

2<br />

Cmodule và xóa Master và Slave<br />

Ngắt Enable và bit cờ.<br />

Source File: CloseI2C.c<br />

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

ConfigIntI2C<br />

Mô tả: Chức năng này Cấu hình tôi<br />

2<br />

CInterrupt.<br />

Bao gồm: i2c.h

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

Saved successfully!

Ooh no, something went wrong!