Public Member Functions | |
| int | frequency (int hz) |
| Set the frequency of the CAN interface. More... | |
| int | write (CANMessage msg) |
| Write a CANMessage to the bus. More... | |
| int | read (CANMessage &msg, int handle=0) |
| Read a CANMessage from the bus. More... | |
| void | reset () |
| Reset CAN interface. More... | |
| void | monitor (bool silent) |
| Puts or removes the CAN interface into silent monitoring mode. More... | |
| int | mode (Mode mode) |
| Change CAN operation to the specified mode. More... | |
| int | filter (unsigned int id, unsigned int mask, CANFormat format=CANAny, int handle=0) |
| Filter out incoming messages. More... | |
| unsigned char | rderror () |
| Detects read errors - Used to detect read overflow errors. More... | |
| unsigned char | tderror () |
| Detects write errors - Used to detect write overflow errors. More... | |
| void | attach (Callback< void()> func, IrqType type=IrqType::RxIrq) |
| Attach a function to call whenever a CAN frame received interrupt is generated. More... | |
|
inherited |
Attach a function to call whenever a CAN frame received interrupt is generated.
This function locks the deep sleep while a callback is attached
| func | A pointer to a void function, or 0 to set as none |
| type | Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, CAN::TxIrq for transmitted or aborted, CAN::EwIrq for error warning, CAN::DoIrq for data overrun, CAN::WuIrq for wake-up, CAN::EpIrq for error passive, CAN::AlIrq for arbitration lost, CAN::BeIrq for bus error) |
|
inherited |
Filter out incoming messages.
| id | the id to filter on |
| mask | the mask applied to the id |
| format | format to filter on (Default CANAny) |
| handle | message filter handle (Optional) |
|
inherited |
Set the frequency of the CAN interface.
| hz | The bus frequency in hertz |
|
inherited |
Change CAN operation to the specified mode.
| mode | The new operation mode (CAN::Normal, CAN::Silent, CAN::LocalTest, CAN::GlobalTest, CAN::SilentTest) |
|
inherited |
Puts or removes the CAN interface into silent monitoring mode.
| silent | boolean indicating whether to go into silent mode or not |
|
inherited |
Detects read errors - Used to detect read overflow errors.
|
inherited |
Read a CANMessage from the bus.
| msg | A CANMessage to read to. |
| handle | message filter handle (0 for any message) |
|
inherited |
Reset CAN interface.
To use after error overflow.
|
inherited |
Detects write errors - Used to detect write overflow errors.
|
inherited |
Write a CANMessage to the bus.
| msg | The CANMessage to write. |