Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
MCP2515Can::Buffer Class Reference

CAN TX and RX buffer structure. More...

Inheritance diagram for MCP2515Can::Buffer:
MCP2515Can::BufferRead MCP2515Can::BufferWrite

Public Member Functions

void build_struct_can_frame (struct can_frame *can_frame)
 Take the contents of the Buffer and fill in a can_frame structure.
 
void * get_payload ()
 Get a pointer to the buffer payload.
 

Static Public Attributes

static const size_t TRANSFER_SIZE = 14
 The SPI transfer size in bytes of a buffer transfer.
 

Protected Member Functions

 Buffer (struct can_frame *can_frame, uint8_t command)
 Constructor.
 
 Buffer (uint8_t command)
 Constructor.
 

Protected Attributes

uint8_t pad_ [2]
 force the data to 32/64-bit allign
 
uint8_t command_
 the transaction command
 
uint8_t sidh_
 standard identifier high byte
 
struct { 
 
   uint8_t   eid_: 2 
 extended identifier bits 16 and 17 More...
 
   uint8_t   unused1_: 1 
 unused bit More...
 
   uint8_t   exide_: 1 
 extended identifer enable More...
 
   uint8_t   srr_: 1 
 standard frame RTR More...
 
   uint8_t   sid_: 3 
 standard identifier low bits More...
 
};  
 
uint8_t eid8_
 extended identifier high byte
 
uint8_t eid0_
 extended identifier low byte
 
struct { 
 
   uint8_t   dlc_: 4 
 data length code More...
 
   uint8_t   unused3_: 2 
 unused bits More...
 
   uint8_t   rtr_: 1 
 remote transmit request bit More...
 
   uint8_t   unused4_: 1 
 unused bit More...
 
};  
 
union { 
 
   uint64_t   data64_ 
 64-bit data More...
 
   uint8_t   data_ [8] 
 all 8 data bytes More...
 
};  
 

Detailed Description

CAN TX and RX buffer structure.

Definition at line 382 of file MCP2515Can.hxx.

Constructor & Destructor Documentation

◆ Buffer() [1/2]

MCP2515Can::Buffer::Buffer ( struct can_frame *  can_frame,
uint8_t  command 
)
inlineprotected

Constructor.

Parameters
can_framereference to a can_frame metadata structure.
commandcorresponding command for the buffer

Definition at line 432 of file MCP2515Can.hxx.

◆ Buffer() [2/2]

MCP2515Can::Buffer::Buffer ( uint8_t  command)
inlineprotected

Constructor.

Parameters
commandcorresponding command for the buffer

Definition at line 462 of file MCP2515Can.hxx.

Member Function Documentation

◆ build_struct_can_frame()

void MCP2515Can::Buffer::build_struct_can_frame ( struct can_frame *  can_frame)
inline

Take the contents of the Buffer and fill in a can_frame structure.

Parameters
can_frameCAN frame structure to fill in

Definition at line 392 of file MCP2515Can.hxx.

◆ get_payload()

void * MCP2515Can::Buffer::get_payload ( )
inline

Get a pointer to the buffer payload.

Returns
pointer to the buffer payload

Definition at line 421 of file MCP2515Can.hxx.

Member Data Documentation

◆ command_

uint8_t MCP2515Can::Buffer::command_
protected

the transaction command

Definition at line 468 of file MCP2515Can.hxx.

◆ data64_

uint64_t MCP2515Can::Buffer::data64_

64-bit data

Definition at line 489 of file MCP2515Can.hxx.

◆ data_

uint8_t MCP2515Can::Buffer::data_[8]

all 8 data bytes

Definition at line 490 of file MCP2515Can.hxx.

◆ dlc_

uint8_t MCP2515Can::Buffer::dlc_

data length code

Definition at line 482 of file MCP2515Can.hxx.

◆ eid0_

uint8_t MCP2515Can::Buffer::eid0_
protected

extended identifier low byte

Definition at line 479 of file MCP2515Can.hxx.

◆ eid8_

uint8_t MCP2515Can::Buffer::eid8_
protected

extended identifier high byte

Definition at line 478 of file MCP2515Can.hxx.

◆ eid_

uint8_t MCP2515Can::Buffer::eid_

extended identifier bits 16 and 17

Definition at line 472 of file MCP2515Can.hxx.

◆ exide_

uint8_t MCP2515Can::Buffer::exide_

extended identifer enable

Definition at line 474 of file MCP2515Can.hxx.

◆ pad_

uint8_t MCP2515Can::Buffer::pad_[2]
protected

force the data to 32/64-bit allign

Definition at line 467 of file MCP2515Can.hxx.

◆ rtr_

uint8_t MCP2515Can::Buffer::rtr_

remote transmit request bit

Definition at line 484 of file MCP2515Can.hxx.

◆ sid_

uint8_t MCP2515Can::Buffer::sid_

standard identifier low bits

Definition at line 476 of file MCP2515Can.hxx.

◆ sidh_

uint8_t MCP2515Can::Buffer::sidh_
protected

standard identifier high byte

Definition at line 469 of file MCP2515Can.hxx.

◆ srr_

uint8_t MCP2515Can::Buffer::srr_

standard frame RTR

Definition at line 475 of file MCP2515Can.hxx.

◆ TRANSFER_SIZE

const size_t MCP2515Can::Buffer::TRANSFER_SIZE = 14
static

The SPI transfer size in bytes of a buffer transfer.

Definition at line 386 of file MCP2515Can.hxx.

◆ unused1_

uint8_t MCP2515Can::Buffer::unused1_

unused bit

Definition at line 473 of file MCP2515Can.hxx.

◆ unused3_

uint8_t MCP2515Can::Buffer::unused3_

unused bits

Definition at line 483 of file MCP2515Can.hxx.

◆ unused4_

uint8_t MCP2515Can::Buffer::unused4_

unused bit

Definition at line 485 of file MCP2515Can.hxx.


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