CAN communication library for RP2040/2350 PIO.
This library was made possible thanks to Kevin O'Connor's PIO-based CAN implementation (https://github.com/KevinOConnor/can2040).
- RP2040
- RP2350
#include <RP2040PIO_CAN.h>
void setup() {
Serial.begin(115200);
CAN.setRX(4);
CAN.setTX(5);
CAN.begin(CanBitRate::BR_1000k);
}if (CAN.available()) {
CanMsg msg = CAN.read();
Serial.println(msg.getStandardId());
}CanMsg msg;
msg.id = CanStandardId(0x01);
msg.data_length = 4;
msg.data[0] = 0x23;
msg.data[1] = 0x45;
msg.data[2] = 0x67;
msg.data[3] = 0x89;
CAN.write(msg);GNU General Public License v3.0