Skip to content

Commit

Permalink
added mISOCRCEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pierremolinaro committed Nov 1, 2018
1 parent a655435 commit a0e6859
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
Binary file removed extras
Binary file not shown.
Binary file added extras/acan2517FD.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=ACAN2517FD
version=1.0.1
version=1.0.2
author=Pierre Molinaro
maintainer=Pierre Molinaro <[email protected]>
sentence=Driver for MCP2517FD CAN Controller (CAN FD mode)
Expand Down
8 changes: 7 additions & 1 deletion src/ACAN2517FD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ uint32_t ACAN2517FD::begin (const ACAN2517FDSettings & inSettings,
if (inSettings.mTXCANIsOpenDrain) {
d |= 1 << 4 ; // TXCANOD
}
writeByteRegister (IOCON_REGISTER + 3, d); // DS20005688B, page 18
writeByteRegister (IOCON_REGISTER + 3, d); // DS20005688B, page 24
//----------------------------------- Configure ISO CRC Enable bit
d = 1 << 6 ; // PXEDIS <-- 1
if (inSettings.mISOCRCEnabled) {
d |= 1 << 5 ; // Enable ISO CRC in CAN FD Frames bit
}
writeByteRegister (IOCON_REGISTER, d); // DS20005688B, page 24
//----------------------------------- Configure C1DTC (DS20005688B, page 29)
// data = 1 << 25 ; // Enable Edge Filtering during Bus Integration state bit
// data |= 1 << 17 ; // Auto TDC
Expand Down
8 changes: 8 additions & 0 deletions src/ACAN2517FDSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ class ACAN2517FDSettings {

public: bool mTXCANIsOpenDrain = false ; // false --> Push/Pull Output, true --> Open Drain Output

//······················································································································
// ISO CRC Enable
//······················································································································

// false --> Do NOT include Stuff Bit Count in CRC Field and use CRC Initialization Vector with all zeros
// true --> Include Stuff Bit Count in CRC Field and use Non-Zero CRC Initialization Vector according to ISO 11898-1:2015
public: bool mISOCRCEnabled = true ;

//······················································································································
// CLKO pin function (default value is MCP2517FD power on setting)
//······················································································································
Expand Down

0 comments on commit a0e6859

Please sign in to comment.