Skip to content

Commit

Permalink
Version 2.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
pierremolinaro committed Oct 1, 2021
1 parent 4ef0c1c commit 68aa8b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Binary file modified extras/acan2515.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ACAN2515
version=2.0.8
version=2.0.9
author=Pierre Molinaro
maintainer=Pierre Molinaro <[email protected]>
sentence=Driver for MCP2515 CAN Controller
Expand Down
22 changes: 13 additions & 9 deletions src/CANMessage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//··································································································
//----------------------------------------------------------------------------------------------------------------------
// Generic CAN Message
// by Pierre Molinaro
//
Expand All @@ -8,16 +8,16 @@
// https://github.com/pierremolinaro/acan2517
// https://github.com/pierremolinaro/acan2517FD
//
//··································································································
//----------------------------------------------------------------------------------------------------------------------

#ifndef GENERIC_CAN_MESSAGE_DEFINED
#define GENERIC_CAN_MESSAGE_DEFINED

//··································································································
//----------------------------------------------------------------------------------------------------------------------

#include <Arduino.h>

//··································································································
//----------------------------------------------------------------------------------------------------------------------

class CANMessage {
public : uint32_t id = 0 ; // Frame identifier
Expand All @@ -27,19 +27,23 @@ class CANMessage {
public : uint8_t len = 0 ; // Length of data (0 ... 8)
public : union {
uint64_t data64 ; // Caution: subject to endianness
uint32_t data32 [2] ; // Caution: subject to endianness
uint16_t data16 [4] ; // Caution: subject to endianness
int64_t data_s64 ; // Caution: subject to endianness
uint32_t data32 [2] ; // Caution: subject to endianness
int32_t data_s32 [2] ; // Caution: subject to endianness
float dataFloat [2] ; // Caution: subject to endianness
uint8_t data [8] = {0, 0, 0, 0, 0, 0, 0, 0} ;
uint16_t data16 [4] ; // Caution: subject to endianness
int16_t data_s16 [4] ; // Caution: subject to endianness
int8_t data_s8 [8] ;
uint8_t data [8] = {0, 0, 0, 0, 0, 0, 0, 0} ;
} ;
} ;

//··································································································
//----------------------------------------------------------------------------------------------------------------------

typedef enum {kStandard, kExtended} tFrameFormat ;
typedef enum {kData, kRemote} tFrameKind ;
typedef void (*ACANCallBackRoutine) (const CANMessage & inMessage) ;

//··································································································
//----------------------------------------------------------------------------------------------------------------------

#endif

0 comments on commit 68aa8b8

Please sign in to comment.