#include <CANHandler.h>
|
| | CANHandler () |
| |
| | CANHandler (PinName canRx, PinName canTx) |
| |
| void | attach (Callback< void()> func, CAN::IrqType type=CAN::IrqType::RxIrq) |
| |
| void | updateCANs (PinName canRx, PinName canTx) |
| |
| CAN * | getCAN () |
| |
| void | registerCallback (uint32_t id, std::function< void(const CANMsg *)> func) |
| | Add a callback for a specific id.
|
| |
| void | registerCallback (uint32_t start_id, uint32_t end_id, std::function< void(const CANMsg *)> func) |
| | Add a callback for multiple ids.
|
| |
| void | readAllCan () |
| | Get feedback from all CAN devices, and send to relevant callbacks.
|
| |
| bool | getFeedback (int *id, uint8_t bytes[], int canbus) |
| | Get feedback back from the motor.
|
| |
| bool | rawRead (int *id, uint8_t bytes[], int length) |
| |
| bool | rawSend (int id, int8_t bytes[], int length=8) |
| | Raw sending of CAN Messages.
|
| |
|
| static void | printMsg (CANMessage &msg) |
| | Prints a CANMessage nicely.
|
| |
◆ CANBus
| Enumerator |
|---|
| CANBUS_1 | |
| CANBUS_2 | |
| NOBUS | |
◆ CANHandler() [1/2]
| CANHandler::CANHandler |
( |
| ) |
|
|
inline |
◆ CANHandler() [2/2]
| CANHandler::CANHandler |
( |
PinName |
canRx, |
|
|
PinName |
canTx |
|
) |
| |
|
inline |
◆ attach()
| void CANHandler::attach |
( |
Callback< void()> |
func, |
|
|
CAN::IrqType |
type = CAN::IrqType::RxIrq |
|
) |
| |
|
inline |
◆ getCAN()
| CAN * CANHandler::getCAN |
( |
| ) |
|
|
inline |
◆ getFeedback()
| bool CANHandler::getFeedback |
( |
int * |
id, |
|
|
uint8_t |
bytes[], |
|
|
int |
canbus |
|
) |
| |
|
inline |
Get feedback back from the motor.
◆ printMsg()
| static void CANHandler::printMsg |
( |
CANMessage & |
msg | ) |
|
|
inlinestatic |
Prints a CANMessage nicely.
- Parameters
-
◆ rawRead()
| bool CANHandler::rawRead |
( |
int * |
id, |
|
|
uint8_t |
bytes[], |
|
|
int |
length |
|
) |
| |
|
inline |
◆ rawSend()
| bool CANHandler::rawSend |
( |
int |
id, |
|
|
int8_t |
bytes[], |
|
|
int |
length = 8 |
|
) |
| |
|
inline |
Raw sending of CAN Messages.
- Parameters
-
| id | the CAN ID you're sending to |
| bytes | the bytes you're sending (8) |
| bus | the bus you're sending the CAN messages to |
◆ readAllCan()
| void CANHandler::readAllCan |
( |
| ) |
|
|
inline |
Get feedback from all CAN devices, and send to relevant callbacks.
◆ registerCallback() [1/2]
| void CANHandler::registerCallback |
( |
uint32_t |
id, |
|
|
std::function< void(const CANMsg *)> |
func |
|
) |
| |
|
inline |
Add a callback for a specific id.
- Parameters
-
| id | CANMessage id |
| func | Callback function |
◆ registerCallback() [2/2]
| void CANHandler::registerCallback |
( |
uint32_t |
start_id, |
|
|
uint32_t |
end_id, |
|
|
std::function< void(const CANMsg *)> |
func |
|
) |
| |
|
inline |
Add a callback for multiple ids.
- Parameters
-
| stard_id | first CANMessage id |
| stard_id | last CANMessage id |
| func | Callback function |
◆ updateCANs()
| void CANHandler::updateCANs |
( |
PinName |
canRx, |
|
|
PinName |
canTx |
|
) |
| |
|
inline |
◆ can
◆ exact_
◆ exists
| bool CANHandler::exists = false |
◆ range_
The documentation for this class was generated from the following file: