This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "CANNY 5.2 duo, CAN Gateway Driver"
[checked revision] | [checked revision] |
(→General Description) |
|||
Line 5: | Line 5: | ||
The CAN gateway driver allows you to realize individual processing of incoming CAN messages by configuring up to eight selection rules (selectors). | The CAN gateway driver allows you to realize individual processing of incoming CAN messages by configuring up to eight selection rules (selectors). | ||
− | Each rule (selector) allows you to select CAN messages by the following user-defined properties: | + | Each rule (selector) allows you to select CAN messages by the combination of following user-defined properties values: |
* CAN interface number via which the message was coming to the controller; | * CAN interface number via which the message was coming to the controller; | ||
* CAN ID of incoming message (CAN gateway selector value). | * CAN ID of incoming message (CAN gateway selector value). | ||
Line 14: | Line 14: | ||
* discard the message. | * discard the message. | ||
− | + | In case of the message modification it is performed by replacing using a bitmask any bits of the original message. You can change any CAN-message field including ID, length and bits of data. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | For all incoming CAN message that are not hit in any selector, you can assign one of the following actions: | ||
+ | * relay the message to another CAN interface of the controller "as is", without any changes; | ||
+ | * discard the message. | ||
− | + | To use the CAN gateway driver, it is necessary to specify the possible different configurations for both CAN-interfaces of the controller. | |
− | + | ||
− | + | ||
+ | When the CAN gateway driver is enabled, the diagram still can use the registers of the CAN0 Driver and the CAN1 Driver for: | ||
+ | * sending any CAN messages through any of the CAN interfaces; | ||
+ | * receive CAN messages, but only those that are hit some CAN gateway driver selector, regardless of what happens with the CAN message after its selection. | ||
− | + | Moreover, you can change CAN gateway driver configuration during operation. So you can organize some sort of the dynamic mode for your CAN gateway. | |
== Driver's registers == | == Driver's registers == |
Revision as of 15:02, 22 May 2018
Contents
General Description
Using the CAN gateway driver you can to implement the high-speed asynchronous relaying of messages between the CAN hardware interfaces with optional filtering and altering particular CAN messages.
The CAN gateway driver allows you to realize individual processing of incoming CAN messages by configuring up to eight selection rules (selectors).
Each rule (selector) allows you to select CAN messages by the combination of following user-defined properties values:
- CAN interface number via which the message was coming to the controller;
- CAN ID of incoming message (CAN gateway selector value).
When some incoming CAN message hit the selector, the CAN gateway driver perform one of the following user-defined actions:
- relay the message to another CAN interface of the controller "as is", without any changes;
- modify the message, and then relay the modified message to another CAN interface of the controller;
- discard the message.
In case of the message modification it is performed by replacing using a bitmask any bits of the original message. You can change any CAN-message field including ID, length and bits of data.
For all incoming CAN message that are not hit in any selector, you can assign one of the following actions:
- relay the message to another CAN interface of the controller "as is", without any changes;
- discard the message.
To use the CAN gateway driver, it is necessary to specify the possible different configurations for both CAN-interfaces of the controller.
When the CAN gateway driver is enabled, the diagram still can use the registers of the CAN0 Driver and the CAN1 Driver for:
- sending any CAN messages through any of the CAN interfaces;
- receive CAN messages, but only those that are hit some CAN gateway driver selector, regardless of what happens with the CAN message after its selection.
Moreover, you can change CAN gateway driver configuration during operation. So you can organize some sort of the dynamic mode for your CAN gateway.
Driver's registers
Below is a description of the permissible values of the CAN gate driver control registers, which allow setting the controller operation parameters for high-speed asynchronous relaying of messages between the CAN hardware interfaces.
Common registers of the CAN gateway driver.
Register | Expected values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
| |||||||
|
| |||||||
|
|
CAN gateway configuration registers.
Common CAN gateway driver selection registers.
Registers | Expected values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
| |||||||
|
|
CAN gateway selection registers.
The value of the selection - is a parameter which, when satisfied, selects an incoming CAN message for special processing.
Register | Expected value | ||||
---|---|---|---|---|---|
|
| ||||
|
|
The registers of the gateway driver selection masks.
The selection masks - is a group of values whose bits define the bitwise modifications to be made when the gateway retransmits a part of the message that has been accepted by the appropriate selection. If the value of the mask bit is "0", the corresponding bit of the received message will be relayed to the other interface without changes. If the value of the mask bit is "1", the corresponding bit of the received message will be replaced by a corresponding bit from the value of the Substitution Substitution
Register | Expected value | ||||||
---|---|---|---|---|---|---|---|
|
| ||||||
|
| ||||||
|
| ||||||
|
|
Registers for replacing the selections of the CAN gateway driver.
Replacement of selection - is a group of values whose bits replace the original bits in the retransmitted message that has fallen into the appropriate selection. If the value of the replacement bit is "0", the corresponding bit of the relayed message will be replaced by zero, with the replacement bit value equal to "1", the corresponding bit of the relayed message will be replaced by one. The replacement will only be applied to those bits whose selection mask value is "1".
Register | Expected value | ||||||
---|---|---|---|---|---|---|---|
|
| ||||||
|
| ||||||
|
| ||||||
|
|
Блок-схема работы контроллера в режиме CAN-шлюза
See also