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.

CAN2SendMessage.c<br />

Code Example: CAN1SendMessage((CAN_TX_SID(1920)) &<br />

(CAN_TX_EID_EN) & (CAN_SUB_NOR_TX_REQ),<br />

(CAN_TX_EID(12344)) & (CAN_NOR_TX_REQ),<br />

Txdata, datalen, tx_rx_no);<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 86<br />

CAN1SetFilter<br />

CAN2SetFilter<br />

2004 Microchip Technology Inc.<br />

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

the<br />

specified filter.<br />

Include: can.h<br />

Prototype: void CAN1SetFilter(char filter_no, unsigned int sid,<br />

unsigned long eid);<br />

void CAN2SetFilter(char filter_no, unsigned int sid,<br />

unsigned long eid);<br />

Arguments: filter_no The filter (0, 1, 2, 3, 4 or 5) for which new filter values<br />

have to be configured.<br />

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

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

Type of message to be received<br />

CAN_RX_EID_EN<br />

CAN_RX_EID_DIS<br />

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

CiRXFnEIDL registers.<br />

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

Return Value: None<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 to the filter specified by filter_no.<br />

Filter 0 is taken as default.<br />

Source File: CAN1SetFilter.c<br />

CAN2SetFilter.c<br />

Code Example: CAN1SetFilter(1, CAN_FILTER_SID(7) &<br />

CAN_RX_EID_EN, CAN_FILTER_EID(3));<br />

CAN1SetMask<br />

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

CAN1SetOperationMode<br />

CAN2SetOperationMode<br />

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

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

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

khoảng trống CAN2SetOperationMode (int config);<br />

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

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

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

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

CAN_MASTERCLOCK_1FCANis ngoại tệ<br />

CAN_MASTERCLOCK_0FCANis 4 ngoại tệ<br />

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

CAN_REQ_OPERMODE_NOR<br />

CAN_REQ_OPERMODE_DIS<br />

CAN_REQ_OPERMODE_LOOPBK<br />

CAN_REQ_OPERMODE_LISTENONLY<br />

CAN_REQ_OPERMODE_CONFIG<br />

CAN_REQ_OPERMODE_LISTENALL<br />

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

CAN_CAPTURE_EN<br />

CAN_CAPTURE_DIS<br />

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

Ghi chú: Chức năng này cấu hình các bit sau CiCTRL: -CSIDL,<br />

REQOP và CANCKS<br />

Source File: CAN1SetOperationMode.c<br />

CAN2SetOperationMode.c<br />

Mã số Ví dụ: CAN1SetOperationMode (CAN_IDLE_STOP &<br />

CAN_MASTERCLOCK_0 & CAN_REQ_OPERMODE_DIS &<br />

CAN_CAPTURE_DIS);<br />

CAN1SetMask (Tiếp theo)<br />

CAN2SetMask<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

DS51456B trang 88 2004 Microchip Technology Inc<br />

CAN1SetOperationModeNoWait<br />

CAN2SetOperationModeNoWait

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

Saved successfully!

Ooh no, something went wrong!