CAN (canbus)
CANChannel
// PROTOTYPE
CANChannel(HAL_CAN_Channel channel, uint16_t rxQueueSize = 32, uint16_t txQueueSize = 32);
Create a CANChannel global object to connect to a CAN bus on the specified pins.
// SYNTAX
CANChannel can(pins, rxQueueSize, txQueueSize);
Parameters:
pins: the Photon and Electron support pinsCAN_D1_D2, and the Electron only, supports pinsCAN_C4_C5rxQueueSize(optional): the receive queue size (default 32 message)txQueueSize(optional): the transmit queue size (default 32 message)
// EXAMPLE
CANChannel can(CAN_D1_D2);
// Buffer 10 received messages and 5 transmitted messages
CANChannel can(CAN_D1_D2, 10, 5);