Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::Canbus Namespace Reference

Classes

class  BusLoadEstimation
 
class  CanbusDriver
 Low level CanBus driver, with support for both peripherals (CAN1 and CAN2) on stm32f4 microcontrollers. More...
 
struct  CanMessage
 Generic struct that contains a can protocol message. More...
 
struct  CanPacket
 
class  CanProtocol
 Canbus protocol implementation. More...
 
struct  CanRXPacket
 
struct  CanRXStatus
 
struct  CanTXResult
 
struct  FilterBank
 Base class for a Canbus filter bank. More...
 
struct  ID16FilterBank
 
struct  ID32FilterBank
 
struct  Mask16FilterBank
 
struct  Mask32FilterBank
 32 Bit mask filter bank. More...
 

Enumerations

enum class  FilterMode { ID , MASK }
 
enum class  FilterScale { SINGLE32 , DUAL16 }
 
enum class  CanProtocolIdMask : uint32_t {
  PRIORITY = 0x1E000000 , PRIMARY_TYPE = 0x01F80000 , SOURCE = 0x00078000 , DESTINATION = 0x00007800 ,
  SECONDARY_TYPE = 0x00000780 , MESSAGE_INFORMATION = 0x1FFFFF80 , FIRST_PACKET_FLAG = 0x00000040 , LEFT_TO_SEND = 0x0000003F ,
  SEQUENTIAL_INFORMATION = 0x0000007F
}
 Masks of the elements composing can packets ids. More...
 
enum  CanProtocolShiftInformation : uint8_t {
  PRIORITY = 25 , PRIMARY_TYPE = 19 , SOURCE = 15 , DESTINATION = 11 ,
  SECONDARY_TYPE = 7 , FIRST_PACKET_FLAG = 6 , LEFT_TO_SEND = 0 , SEQUENTIAL_INFORMATION = 7
}
 

Functions

bool operator== (const CanMessage &lhs, const CanMessage &rhs)
 
bool operator!= (const CanMessage &lhs, const CanMessage &rhs)
 

Variables

PrintLogger l = Logging::getLogger("canbus")
 
CanbusDrivercanDrivers [2]
 

Enumeration Type Documentation

◆ CanProtocolIdMask

enum class Boardcore::Canbus::CanProtocolIdMask : uint32_t
strong

Masks of the elements composing can packets ids.

The CanProtocol allows to transmit arbitrarily sized messages over the CanBus overcoming the 8 byte limitation of each single packet.

Our CanProtocol uses the extended can packet, the 29 bits id is divided such as:

  • Priority 4 bit \
  • Primary type 6 bit |
  • Source 4 bit | 22 bits - Message informations
  • Destination 4 bit |
  • Secondary type 4 bit /
  • First packet flag 1 bit \ 7 bits - Sequential informations
  • Remaining packets 6 bit / shiftNameOfField the number of shift needed to reach that field

The id is split into 2 parts:

  • Message information: Common to every packet of a given message
  • Sequential information: Used to distinguish between packets

The sender splits into multiple packets a message that is then recomposed on the receiver end. The message informations are encoded into the packets id, therefore they have an effect on packets priorities.

Enumerator
PRIORITY 
PRIMARY_TYPE 
SOURCE 
DESTINATION 
SECONDARY_TYPE 
MESSAGE_INFORMATION 
FIRST_PACKET_FLAG 
LEFT_TO_SEND 
SEQUENTIAL_INFORMATION 

Definition at line 60 of file CanProtocolData.h.

◆ CanProtocolShiftInformation

Enumerator
PRIORITY 
PRIMARY_TYPE 
SOURCE 
DESTINATION 
SECONDARY_TYPE 
FIRST_PACKET_FLAG 
LEFT_TO_SEND 
SEQUENTIAL_INFORMATION 

Definition at line 76 of file CanProtocolData.h.

◆ FilterMode

enum class Boardcore::Canbus::FilterMode
strong
Enumerator
ID 
MASK 

Definition at line 33 of file Filters.h.

◆ FilterScale

enum class Boardcore::Canbus::FilterScale
strong
Enumerator
SINGLE32 
DUAL16 

Definition at line 39 of file Filters.h.

Function Documentation

◆ operator!=()

bool Boardcore::Canbus::operator!= ( const CanMessage lhs,
const CanMessage rhs 
)
inline

Definition at line 155 of file CanProtocolData.h.

◆ operator==()

bool Boardcore::Canbus::operator== ( const CanMessage lhs,
const CanMessage rhs 
)
inline

Definition at line 143 of file CanProtocolData.h.

Variable Documentation

◆ canDrivers

CanbusDriver * Boardcore::Canbus::canDrivers

Definition at line 37 of file CanInterrupt.cpp.

◆ l

PrintLogger Boardcore::Canbus::l = Logging::getLogger("canbus")

Definition at line 43 of file CanDriver.cpp.