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.

CAN2SetMask<br />

Description: This function sets the acceptance mask values (SID and EID) for<br />

the<br />

specified mask.<br />

Include: can.h<br />

Prototype: void CAN1SetMask(char mask_no, unsigned int sid,<br />

unsigned long eid);<br />

void CAN2SetMask(char mask_no, unsigned int sid,<br />

unsigned long eid);<br />

Arguments: mask_no The mask (‘0’ or ‘1’) for which mask values have to be<br />

configured.<br />

sid The 16-bit value to be written into CiRXMnSID registers.<br />

CAN_MASK_SID(x) xis the required SID value.<br />

Match/ignore message typespecified in filter<br />

CAN_MATCH_FILTER_TYPE<br />

CAN_IGNORE_FILTER_TYPE<br />

eid The 32-bit value to be written into CiRXMnEIDH and<br />

CiRXMnEIDL registers.<br />

CAN_MASK_EID(x) xis the required EID value.<br />

Return Value: None<br />

dsPIC Peripheral Libraries<br />

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

Remarks: This function writes the 16-bit value of sidinto the CiRXFnSID<br />

register<br />

and or the 32-bit value of eidinto the CiRXFnEIDH and CiRXFnEIDL<br />

registers corresponding tothe mask specified by mask_no.<br />

Filter 0 is taken as default.<br />

Source File: CAN1SetMask.c<br />

CAN2SetMask.c<br />

Code Example: CAN1SetMask(1, CAN_MASK_SID(7) &<br />

CAN_MATCH_FILTER_TYPE, CAN_MASK_EID(3));<br />

CAN1SetOperationMode<br />

CAN2SetOperationMode<br />

Description: This function configures the CAN module<br />

Include: can.h<br />

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

void CAN2SetOperationMode(unsigned int config);<br />

Arguments: config The 16-bit value to be loaded into CiCTRL register, the<br />

combination of the following defines.<br />

CAN_IDLE_CONCAN On in Idle mode<br />

Mô tả: Chức năng này hủy bỏ các truyền cấp phát và cấu hình CAN<br />

mô-đun<br />

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

Prototype: void CAN1SetOperationModeNoWait (<br />

int config);<br />

khoảng trống CAN2SetOperationModeNoWait (<br />

int config);<br />

Đối số: cấu hình giá trị 16-bit được loadedinto CiCTRL đăng ký,<br />

sự kết hợp của các định nghĩa sau đây.<br />

CAN_IDLE_CON_NO_WAITCAN Mở ở chế độ nhàn rỗi<br />

CAN_IDLE_STOP_NO_WAITCAN Dừng ở chế độ nhàn rỗi<br />

CAN_MASTERCLOCK_1_NO_WAITFCANis ngoại tệ<br />

CAN_MASTERCLOCK_0_NO_WAITFCANis 4 ngoại tệ<br />

CAN phương thức hoạt động<br />

CAN_REQ_OPERMODE_NOR_NO_WAIT<br />

CAN_REQ_OPERMODE_DIS_NO_WAIT<br />

CAN_REQ_OPERMODE_LOOPBK_NO_WAIT<br />

CAN_REQ_OPERMODE_LISTENONLY_NO_WAIT<br />

CAN_REQ_OPERMODE_CONFIG_NO_WAIT<br />

CAN_REQ_OPERMODE_LISTENALL_NO_WAIT<br />

THỂ Chụp Bật / Tắt<br />

CAN_CAPTURE_EN_NO_WAIT<br />

CAN_CAPTURE_DIS_NO_WAIT<br />

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

Ghi chú: Chức năng này đặt bit Abort do đó bắt đầu hủy bỏ tất cả các cấp phát<br />

truyền và cấu hình các bit sau CiCTRL: -CSIDL,<br />

REQOP và CANCKS<br />

Source File: CAN1SetOperationModeNoWait.c<br />

CAN2SetOperationModeNoWait.c<br />

Mã số Ví dụ: CAN1SetOperationModeNoWait (CAN_IDLE_CON &<br />

CAN_MASTERCLOCK_1 & CAN_REQ_OPERMODE_LISTEN &<br />

CAN_CAPTURE_DIS_NO_WAIT);<br />

CAN1SetRXMode<br />

CAN2SetRXMode<br />

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

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

Prototype: void CAN1SetRXMode (char buffno, int<br />

config);<br />

khoảng trống CAN2SetRXMode (char buffno, int

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

Saved successfully!

Ooh no, something went wrong!