描述 CAN ID 的过滤器。在 86Duino 中,有 32 组 CAN 的 ID 过滤器,从外部设备进来的 CAN 资料中,过滤器可以决定要接收哪一个 CAN ID 的资料;此函式还可以配合 init_Mask(),将可接收的 CAN ID 限制在 A ~ B 的区间。如果在 sketch 中,没有呼叫 init_Mask() 也没有呼叫 init_Filt(),CAN 函式库会自动接收来自所有 CAN ID 的资料。 语法 CAN.init_Filt(num, ext, ulData) 参数 num:第几组过滤器,值的范围: 0 ~ 31 ext:传送资料的格式,有以下 4 种 CAN_STDID:标准资料帧,符合 CAN 2.0A 规范,ID 范围:0 ~ 0x7FF CAN_EXTID:扩展资料帧,使用 CAN […]
描述 CAN ID 的遮罩。在 86Duino 中,有 32 组 CAN ID 遮罩,从外部设备进来的 CAN 资料中,遮罩可以决定要接收的 CAN ID 范围(0 ~ N 区间);此函式还可以配合 init_Filt(),将 CAN ID 限制在 A ~ B 区间。如果在 sketch 中没有呼叫 init_Mask() 或 init_Filt(),CAN 函式库会自动接收来自所有 CAN ID 的资料。 语法 CAN.init_Mask(num, ext, ulData) 参数 num:第几组遮罩,值的范围: 0 ~ 31 ext:传送资料的格式,有以下 4 种: CAN_STDID:标准资料帧,符合 CAN 2.0A 规范,ID 范围:0 ~ 0x7FF […]
描述 取得从 CAN bus 上接收到的资料 ID。功能与 remoteID() 相同。(此函式移植自 Seeed Studio 的 CAN Bus 函式库。) 语法 CAN.getCanId() 参数 回传 收到的资料 ID 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 检查 CAN FIFO 内是否还有可读取的值。(此函式移植自 Seeed Studio 的 CAN Bus 函式库。注意:此函式需配合 readMsgBuf() 使用。) 语法 CAN.checkReceive(void) 参数 回传 CAN_MSGAVAIL:代表 FIFO 中有资料可读取。 CAN_NOMSG:代表 FIFO 中没有资料。 范例 See also - readMsgBuf() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public […]
描述 从 CAN bus 上读取资料。(此函式移植自 Seeed Studio 的 CAN Bus 函式库,您可依据您的习惯或喜好,改用此函式读取资料,而不使用 requestFrom() 和 read()。注意:此函式需配合 checkReceive() 使用。) 语法 CAN.readMsgBuf(&len, buf) 参数 len:unsigned char 型别的变数,用来接收被读到 buf 内的 byte 数 buf:接收资料的字元阵列 回传 CAN_OK:有读到资料(至少一笔) CAN_NOMSG:没有读到任何资料 范例 See also - init_Filt() - init_Mask() - checkReceive() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 […]
描述 传送资料给外部的 CAN device。(此函式移植自 Seeed Studio 的 CAN Bus 函式库,您可依据您的习惯或喜好,改用此函式传送资料,而不使用 beginTransmission() 和 write()。) 语法 CAN.sendMsgBuf(id, ext, len, buf) 参数 id:外部 CAN device 的 ID ext:传送的资料格式 CAN_STDID:标准资料帧,符合 CAN 2.0A 规范,ID 范围:0 ~ 0x7FF CAN_EXTID:扩展资料帧,使用 CAN 2.0B 规范,ID 范围:0 ~ 0x1FFFFFFF CAN_STDID_REMOTE:标准远端帧,符合 CAN 2.0A 规范,ID 范围:0 ~ 0x7FF CAN_EXTID_REMOTE:扩展远端帧,符合 CAN 2.0B 规范,ID 范围:0 ~ 0x1FFFFFFF len:阵列大小 buf:资料阵列 […]
描述 取得从 CAN bus 上接收到的资料 ID。 语法 CAN.remoteID() 参数 回传 收到的资料 ID See also - remoteExt() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 取得从 CAN bus 上接收到的资料格式。 语法 CAN.remoteExt() 参数 回传 收到的资料格式。有以下四种: CAN_STDID:标准资料帧 CAN_EXTID:扩展资料帧 CAN_STDID_REMOTE:标准远端帧 CAN_EXTID_REMOTE:扩展远端帧 See also - remoteID() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 检查 CAN FIFO 内是否还有可读取的值。 语法 CAN.available() 参数 回传 FIFO 内可供读取的 byte 数 范例 See also - requestFrom() - read() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 读取 CAN FIFO 中的资料。 语法 CAN.read() 参数 回传 假如 FIFO 非空,则回传 1 byte 的值,反之则回传 -1。 范例 See also - requestFrom() - available() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.