can.init()
can.init(dataRate, canFD, autoRetransmit)
Initialises the CAN bus interface.
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| dataRate | number (kbps) | yes | — | Bus data rate in kbps, e.g. 125, 250, 500. |
| canFD | boolean | yes | — | Enable CAN FD framing. |
| autoRetransmit | boolean | yes | — | Enable automatic retransmission. |
Example
can.init(125, false, false); // 125 kbps, classic CAN, no auto retransmission