TR-mbed 1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CANHandler Class Reference

#include <CANHandler.h>

Public Types

enum  CANBus { CANBUS_1 , CANBUS_2 , NOBUS }
 

Public Member Functions

 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 ()
 
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[])
 Raw sending of CAN Messages.
 

Static Public Member Functions

static void printMsg (CANMessage &msg)
 Prints a CANMessage nicely.
 

Public Attributes

CAN can
 
bool exists = false
 

Member Enumeration Documentation

◆ CANBus

Enumerator
CANBUS_1 
CANBUS_2 
NOBUS 

Constructor & Destructor Documentation

◆ CANHandler() [1/2]

CANHandler::CANHandler ( )
inline

◆ CANHandler() [2/2]

CANHandler::CANHandler ( PinName  canRx,
PinName  canTx 
)
inline

Member Function Documentation

◆ 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
msg

◆ rawRead()

bool CANHandler::rawRead ( int id,
uint8_t  bytes[],
int  length 
)
inline

◆ rawSend()

bool CANHandler::rawSend ( int  id,
int8_t  bytes[] 
)
inline

Raw sending of CAN Messages.

Parameters
idthe CAN ID you're sending to
bytesthe bytes you're sending (8)
busthe bus you're sending the CAN messages to

◆ updateCANs()

void CANHandler::updateCANs ( PinName  canRx,
PinName  canTx 
)
inline

Member Data Documentation

◆ can

CAN CANHandler::can

◆ exists

bool CANHandler::exists = false

The documentation for this class was generated from the following file: