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.

Code Example: char reset_state;<br />

reset_state = isWDTTO();<br />

isWDTWU<br />

Description: This function checks if Wake-up from Sleep is due to WDT timeout.<br />

Include: reset.h<br />

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

Arguments: None<br />

Return Value: This function returns the status of RCON and<br />

RCONbits<br />

If return value is ‘1’, then Wake-up from Sleep occurred due to WDT<br />

time-out.<br />

If return value is ‘0’, then Wake-up from Sleep is not due to WDT<br />

time-out.<br />

Remarks: None<br />

Source File: isWDTWU.c<br />

Code Example: char reset_state;<br />

reset_state = isWDTWU();<br />

dsPIC Peripheral Libraries<br />

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

3.8.2 Individual Macros<br />

isWU<br />

Description: This function checks if Wake-up from Sleep is due to MCLR,<br />

POR,<br />

BOR or any interrupt.<br />

Include: reset.h<br />

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

Arguments: None<br />

Return Value: This function checks if Wake-up from Sleep has occurred.<br />

If yes, it checks for the cause for wake-up.<br />

if ‘1’, wake-up is due to the occurrence of interrupt.<br />

if ‘2’, wake-up is due to MCLR.<br />

if ‘3’, wake-up is due to POR.<br />

if ‘4’, wake-up is due to BOR.<br />

If Wake-up from Sleep has not occurred, then a value of ‘0’ is returned.<br />

Remarks: None<br />

Source File: isWU.c<br />

Code Example: char reset_state;<br />

reset_state = isWU();<br />

DisableInterrupts<br />

CloseINT3<br />

CloseINT4<br />

Mô tả: Chức năng này vô hiệu hóa ngắt ngoài vào INT pin.<br />

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

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

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

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

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

làm mất hiệu lực CloseINT4 (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 ngắt INT pin và xóa<br />

tương ứng với cờ ngắt.<br />

Source File: CloseInt0.c<br />

CloseInt1.c<br />

CloseInt2.c<br />

CloseInt3.c<br />

CloseInt4.c<br />

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

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

2004 Microchip Technology Inc DS51456B trang 121<br />

ConfigINT0<br />

ConfigINT1<br />

ConfigINT2<br />

ConfigINT3<br />

ConfigINT4<br />

Mô tả: Chức năng này cấu hình ngắt INT pin.<br />

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

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

làm mất hiệu lực ConfigINT1 (int config);<br />

làm mất hiệu lực ConfigINT2 (int config);<br />

làm mất hiệu lực ConfigINT3 (int config);<br />

làm mất hiệu lực ConfigINT4 (int config);<br />

Đối số: cấu hình ngắt cạnh, ưu tiên và bật / tắt thông tin<br />

quy định dưới đây:<br />

Lựa chọn cạnh ngắt<br />

RISING_EDGE_INT<br />

FALLING_EDGE_INT<br />

Cho phép ngắt

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

Saved successfully!

Ooh no, something went wrong!