CAN - Controller Area Network#

Controller Area Network API.

The Controller Area Network Interface Bus (CAN) implements a multi-master serial bus for connecting microcontrollers and devices, also known as nodes, to communicate with each other in applications without a host computer. CAN is a message-based protocol, designed originally for automotive applications, but also used in many other scenarios. The complexity of a node can range from a simple I/O device up to an embedded computer with a CAN interface and sophisticated software. The node may also be a gateway allowing a standard computer to communicate over a USB or Ethernet port to the devices on a CAN network. Devices are connected to the bus through a host processor, a CAN controller, and a CAN transceiver.

#include "em_can.h"
#include "em_cmu.h"
#include "em_gpio.h"

void CAN_sendExample(void)
{
  CMU_ClockEnable(cmuClock_HFPER, true);
  CMU_ClockEnable(cmuClock_CAN0, true);
  CMU_ClockEnable(cmuClock_GPIO, true);

  CAN_Reset(CAN_DEVICE);

  CAN_Mode_TypeDef mode = canModeInit;
  CAN_SetMode(CAN_DEVICE, mode);

  GPIO_PinModeSet($gpioPortX, $X_bit, gpioModeInput, 0);
  GPIO_PinModeSet($gpioPortY, $Y_bit, gpioModePushPull, 0);

  CAN_SetRoute(CAN_DEVICE, true, $x, $y);

  CAN_SetBitTiming(CAN_DEVICE, 100000, 1, 4, 4, 1);

  mode = canModeNormal;
  CAN_SetMode(CAN_DEVICE, mode);

  CAN_MessageObject_TypeDef message;
  message.msgNum = 1;
  message.extended = false;
  message.id = 19;
  message.dlc = 8;
  uint32_t i;
  for (i = 0; i < message.dlc; ++i) {
    message.data[i] = i;
  }

  CAN_ConfigureMessageObject(CAN_DEVICE, 0, message.msgNum, true, true, false, true);

  CAN_SendMessage(CAN_DEVICE, 0, &message, true);
}

Modules#

CAN_MessageObject_TypeDef

CAN_Init_TypeDef

Enumerations#

enum
canErrorNoError = CAN_STATUS_LEC_NONE
canErrorStuff = CAN_STATUS_LEC_STUFF
canErrorForm = CAN_STATUS_LEC_FORM
canErrorAck = CAN_STATUS_LEC_ACK
canErrorBit1 = CAN_STATUS_LEC_BIT1
canErrorBit0 = CAN_STATUS_LEC_BIT0
canErrorCrc = CAN_STATUS_LEC_CRC
canErrorUnused = CAN_STATUS_LEC_UNUSED
}

CAN Status codes.

enum
canModeNormal
canModeBasic
canModeLoopBack
canModeSilentLoopBack
canModeSilent
}

CAN peripheral mode.

Functions#

void
CAN_Init(CAN_TypeDef *can, const CAN_Init_TypeDef *init)

Initialize CAN.

uint32_t
CAN_GetClockFrequency(CAN_TypeDef *can)

Get the CAN module frequency.

bool
CAN_MessageLost(CAN_TypeDef *can, uint8_t interface, uint8_t msgNum)

Read a Message Object to find if a message was lost ; reset the 'Message Lost' flag.

void
CAN_SetRoute(CAN_TypeDef *can, bool active, uint16_t pinRxLoc, uint16_t pinTxLoc)

Set the ROUTE registers.

void
CAN_SetBitTiming(CAN_TypeDef *can, uint32_t bitrate, uint16_t propagationTimeSegment, uint16_t phaseBufferSegment1, uint16_t phaseBufferSegment2, uint16_t synchronisationJumpWidth)

Set the bitrate and its parameters.

void
CAN_SetMode(CAN_TypeDef *can, CAN_Mode_TypeDef mode)

Set the CAN operation mode.

void
CAN_SetIdAndFilter(CAN_TypeDef *can, uint8_t interface, bool useMask, const CAN_MessageObject_TypeDef *message, bool wait)

Set the ID and the filter for a specific Message Object.

void
CAN_ConfigureMessageObject(CAN_TypeDef *can, uint8_t interface, uint8_t msgNum, bool valid, bool tx, bool remoteTransfer, bool endOfBuffer, bool wait)

Configure valid, TX/RX, remoteTransfer for a specific Message Object.

void
CAN_SendMessage(CAN_TypeDef *can, uint8_t interface, const CAN_MessageObject_TypeDef *message, bool wait)

Send data from the Message Object message.

bool
CAN_ReadMessage(CAN_TypeDef *can, uint8_t interface, CAN_MessageObject_TypeDef *message)

Read data and ID from a Message Object in RAM and store it in a message.

void
CAN_AbortSendMessage(CAN_TypeDef *can, uint8_t interface, uint8_t msgNum, bool wait)

Abort sending a message.

void
CAN_ResetMessages(CAN_TypeDef *can, uint8_t interface)

Reset all Message Objects and set their data to 0.

void
CAN_Reset(CAN_TypeDef *can)

Set all CAN registers to RESETVALUE.

void
CAN_WriteData(CAN_TypeDef *can, uint8_t interface, const CAN_MessageObject_TypeDef *message)

Write data from a message to the MIRx registers.

void
CAN_SendRequest(CAN_TypeDef *can, uint8_t interface, uint8_t msgNum, bool wait)

Send a request for writing or reading RAM of the Message Object msgNum.

void
CAN_Enable(CAN_TypeDef *can, bool enable)

Enable the Host Controller to send messages.

bool
CAN_IsEnabled(CAN_TypeDef *can)

Give the communication capabilities state.

void
CAN_ReadyWait(CAN_TypeDef *can, uint8_t interface)

Waiting function.

CAN_GetLastErrorCode(CAN_TypeDef *can)

Get the last error code and clear its register.

uint32_t
CAN_HasNewdata(CAN_TypeDef *can)

Indicate which message objects have received new data.

void
CAN_StatusIntClear(CAN_TypeDef *can, uint32_t flags)

Clear one or more pending CAN status interrupts.

void
CAN_StatusIntDisable(CAN_TypeDef *can, uint32_t flags)

Disable CAN status interrupts.

void
CAN_StatusIntEnable(CAN_TypeDef *can, uint32_t flags)

Enable CAN status interrupts.

uint32_t
CAN_StatusIntGet(CAN_TypeDef *can)

Get pending CAN status interrupt flags.

uint32_t
CAN_StatusIntGetEnabled(CAN_TypeDef *can)

Get pending and enabled CAN status interrupt flags.

void
CAN_StatusIntSet(CAN_TypeDef *can, uint32_t flags)

Set one or more CAN status interrupts.

uint32_t
CAN_StatusGet(CAN_TypeDef *can)

Get CAN status.

void
CAN_StatusClear(CAN_TypeDef *can, uint32_t flags)

Clear CAN status.

uint32_t
CAN_GetErrorCount(CAN_TypeDef *can)

Get the error count.

void
CAN_MessageIntClear(CAN_TypeDef *can, uint32_t flags)

Clear one or more pending CAN message interrupts.

void
CAN_MessageIntDisable(CAN_TypeDef *can, uint32_t flags)

Disable CAN message interrupts.

void
CAN_MessageIntEnable(CAN_TypeDef *can, uint32_t flags)

Enable CAN message interrupts.

uint32_t
CAN_MessageIntGet(CAN_TypeDef *can)

Get pending CAN message interrupt flags.

uint32_t
CAN_MessageIntGetEnabled(CAN_TypeDef *can)

Get CAN message interrupt flags that are pending and enabled.

void
CAN_MessageIntSet(CAN_TypeDef *can, uint32_t flags)

Set one or more CAN message interrupts.

Macros#

#define

Default initialization of CAN_Init_TypeDef.

Enumeration Documentation#

CAN_ErrorCode_TypeDef#

CAN_ErrorCode_TypeDef

CAN Status codes.

Enumerator
canErrorNoError

No error occurred during the last CAN bus event.

canErrorStuff

More than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed.

canErrorForm

A fixed format part of a received frame has the wrong format.

canErrorAck

The message this CAN Core transmitted was not acknowledged by another node.

canErrorBit1

A wrong monitored bus value : dominant when the module wants to send a recessive.

canErrorBit0

A wrong monitored bus value : recessive when the module intends to send a dominant.

canErrorCrc

CRC check sum incorrect.

canErrorUnused

Unused.


Definition at line 58 of file platform/emlib/inc/em_can.h

CAN_Mode_TypeDef#

CAN_Mode_TypeDef

CAN peripheral mode.

Enumerator
canModeNormal

CAN peripheral in Normal mode : ready to send and receive messages.

canModeBasic

CAN peripheral in Basic mode : no use of the RAM.

canModeLoopBack

CAN peripheral in Loopback mode : input from the CAN bus is disregarded and comes from TX instead.

canModeSilentLoopBack

CAN peripheral in SilentLoopback mode : input from the CAN bus is disregarded and comes from TX instead ; no output on the CAN bus.

canModeSilent

CAN peripheral in Silent mode : no output on the CAN bus.


Definition at line 88 of file platform/emlib/inc/em_can.h

Function Documentation#

CAN_Init#

void CAN_Init (CAN_TypeDef * can, const CAN_Init_TypeDef * init)

Initialize CAN.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]init

A pointer to the CAN initialization structure.


Definition at line 93 of file platform/emlib/src/em_can.c

CAN_GetClockFrequency#

uint32_t CAN_GetClockFrequency (CAN_TypeDef * can)

Get the CAN module frequency.

Parameters
[in]can

A pointer to the CAN peripheral register block.

An internal prescaler of 2 is inside the CAN module.

Returns

  • A clock value.


Definition at line 126 of file platform/emlib/src/em_can.c

CAN_MessageLost#

bool CAN_MessageLost (CAN_TypeDef * can, uint8_t interface, uint8_t msgNum)

Read a Message Object to find if a message was lost ; reset the 'Message Lost' flag.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]msgNum

A message number of the Message Object, [1 - 32].

Returns

  • True if a message was lost, false otherwise.


Definition at line 160 of file platform/emlib/src/em_can.c

CAN_SetRoute#

void CAN_SetRoute (CAN_TypeDef * can, bool active, uint16_t pinRxLoc, uint16_t pinTxLoc)

Set the ROUTE registers.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]active

A boolean indicating whether or not to activate the ROUTE registers.

[in]pinRxLoc

A location of the RX pin.

[in]pinTxLoc

A location of the TX pin.


Definition at line 210 of file platform/emlib/src/em_can.c

CAN_SetBitTiming#

void CAN_SetBitTiming (CAN_TypeDef * can, uint32_t bitrate, uint16_t propagationTimeSegment, uint16_t phaseBufferSegment1, uint16_t phaseBufferSegment2, uint16_t synchronisationJumpWidth)

Set the bitrate and its parameters.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]bitrate

A wanted bitrate on the CAN bus.

[in]propagationTimeSegment

A value for the Propagation Time Segment.

[in]phaseBufferSegment1

A value for the Phase Buffer Segment 1.

[in]phaseBufferSegment2

A value for the Phase Buffer Segment 2.

[in]synchronisationJumpWidth

A value for the Synchronization Jump Width.

Multiple parameters need to be properly configured. See the reference manual for a detailed description. Careful : the BRP (Baud Rate Prescaler) is calculated by: 'brp = freq / (period * bitrate);'. freq is the frequency of the CAN device, period the time of transmission of a bit. The result is an uint32_t. Hence it's truncated, causing an approximation error. This error is non negligible when the period is high, the bitrate is high, and frequency is low.


Definition at line 257 of file platform/emlib/src/em_can.c

CAN_SetMode#

void CAN_SetMode (CAN_TypeDef * can, CAN_Mode_TypeDef mode)

Set the CAN operation mode.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]mode

Mode of operation : Init, Normal, Loopback, SilentLoopback, Silent, Basic.

In initialization mode, the CAN module is deactivated. Reset the messages in all other modes to be sure that there is no leftover data that needs to be configured before use.


Definition at line 329 of file platform/emlib/src/em_can.c

CAN_SetIdAndFilter#

void CAN_SetIdAndFilter (CAN_TypeDef * can, uint8_t interface, bool useMask, const CAN_MessageObject_TypeDef * message, bool wait)

Set the ID and the filter for a specific Message Object.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]useMask

A boolean to choose whether or not to use the masks.

[in]message

A Message Object.

[in]wait

If true, wait for the end of the transfer between the MIRx registers and the RAM to exit. If false, exit immediately, the transfer can still be in progress.

The initialization bit has to be 0 to use this function.


Definition at line 403 of file platform/emlib/src/em_can.c

CAN_ConfigureMessageObject#

void CAN_ConfigureMessageObject (CAN_TypeDef * can, uint8_t interface, uint8_t msgNum, bool valid, bool tx, bool remoteTransfer, bool endOfBuffer, bool wait)

Configure valid, TX/RX, remoteTransfer for a specific Message Object.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]msgNum

A message number of this Message Object, [1 - 32].

[in]valid

True if the Message Object is valid, false otherwise.

[in]tx

True if the Message Object is used for transmission, false if used for reception.

[in]remoteTransfer

True if the Message Object is used for remote transmission, false otherwise.

[in]endOfBuffer

True if it is for a single Message Object or the end of a FIFO buffer, false if the Message Object is part of a FIFO buffer and not the last.

[in]wait

If true, wait for the end of the transfer between the MIRx registers and the RAM to exit. If false, exit immediately, the transfer can still be in progress.

The initialization bit has to be 0 to use this function.


Definition at line 499 of file platform/emlib/src/em_can.c

CAN_SendMessage#

void CAN_SendMessage (CAN_TypeDef * can, uint8_t interface, const CAN_MessageObject_TypeDef * message, bool wait)

Send data from the Message Object message.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]message

A Message Object.

[in]wait

If true, wait for the end of the transfer between the MIRx registers and RAM to exit. If false, exit immediately. The transfer can still be in progress.

If the message is configured as TX and remoteTransfer = 0, calling this function will send the data of this Message Object if its parameters are correct. If the message is TX and remoteTransfer = 1, this function will set the data of message to RAM and exit. Data will be automatically sent after reception of a remote frame. If the message is RX and remoteTransfer = 1, this function will send a remote frame to the corresponding ID. If the message is RX and remoteTransfer = 0, the user shouldn't call this function. It will also send a remote frame.


Definition at line 572 of file platform/emlib/src/em_can.c

CAN_ReadMessage#

bool CAN_ReadMessage (CAN_TypeDef * can, uint8_t interface, CAN_MessageObject_TypeDef * message)

Read data and ID from a Message Object in RAM and store it in a message.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]message

A Message Object.

Read the information from RAM on this Message Object. Data and the configuration of the Message Object is read. The information is only read if the message stored in the Message Object is new and valid.

Returns

  • True if the Message Object in RAM holds a new and valid message, which was not read earlier, false otherwise.


Definition at line 668 of file platform/emlib/src/em_can.c

CAN_AbortSendMessage#

void CAN_AbortSendMessage (CAN_TypeDef * can, uint8_t interface, uint8_t msgNum, bool wait)

Abort sending a message.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]msgNum

A message number of this Message Object, [1 - 32].

[in]wait

If true, wait for the end of the transfer between the MIRx registers and the RAM to exit. If false, exit immediately. The transfer can still be in progress.

Set the TXRQST of the CTRL register to 0. Doesn't touch data or the other parameters. The user can call CAN_SendMessage() to send the object after using CAN_AbortSendMessage().


Definition at line 751 of file platform/emlib/src/em_can.c

CAN_ResetMessages#

void CAN_ResetMessages (CAN_TypeDef * can, uint8_t interface)

Reset all Message Objects and set their data to 0.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.


Definition at line 790 of file platform/emlib/src/em_can.c

CAN_Reset#

void CAN_Reset (CAN_TypeDef * can)

Set all CAN registers to RESETVALUE.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Leave the CAN device disabled.


Definition at line 822 of file platform/emlib/src/em_can.c

CAN_WriteData#

void CAN_WriteData (CAN_TypeDef * can, uint8_t interface, const CAN_MessageObject_TypeDef * message)

Write data from a message to the MIRx registers.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]message

A Message Object.


Definition at line 872 of file platform/emlib/src/em_can.c

CAN_SendRequest#

void CAN_SendRequest (CAN_TypeDef * can, uint8_t interface, uint8_t msgNum, bool wait)

Send a request for writing or reading RAM of the Message Object msgNum.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.

[in]msgNum

A message number of the Message Object, [1 - 32].

[in]wait

If true, wait for the end of the transfer between the MIRx registers and the RAM to exit. If false, exit immediately. The transfer can still be in progress.


Definition at line 918 of file platform/emlib/src/em_can.c

CAN_Enable#

void CAN_Enable (CAN_TypeDef * can, bool enable)

Enable the Host Controller to send messages.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]enable

True to enable CAN device, false to disable it. If the CAN device is enabled, it goes to normal mode (the default working mode).


Definition at line 266 of file platform/emlib/inc/em_can.h

CAN_IsEnabled#

bool CAN_IsEnabled (CAN_TypeDef * can)

Give the communication capabilities state.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Returns

  • True if the Host Controller can send messages, false otherwise.


Definition at line 281 of file platform/emlib/inc/em_can.h

CAN_ReadyWait#

void CAN_ReadyWait (CAN_TypeDef * can, uint8_t interface)

Waiting function.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]interface

Indicate which Message Interface Register to use.


Definition at line 297 of file platform/emlib/inc/em_can.h

CAN_GetLastErrorCode#

CAN_ErrorCode_TypeDef CAN_GetLastErrorCode (CAN_TypeDef * can)

Get the last error code and clear its register.

Parameters
[in]can

Pointer to CAN peripheral register block.

Returns

  • return Last error code.


Definition at line 314 of file platform/emlib/inc/em_can.h

CAN_HasNewdata#

uint32_t CAN_HasNewdata (CAN_TypeDef * can)

Indicate which message objects have received new data.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Returns

  • State of MESSAGEDATA register indicating which message objects have received new data.


Definition at line 333 of file platform/emlib/inc/em_can.h

CAN_StatusIntClear#

void CAN_StatusIntClear (CAN_TypeDef * can, uint32_t flags)

Clear one or more pending CAN status interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

Pending CAN status interrupt source(s) to clear.


Definition at line 348 of file platform/emlib/inc/em_can.h

CAN_StatusIntDisable#

void CAN_StatusIntDisable (CAN_TypeDef * can, uint32_t flags)

Disable CAN status interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN status interrupt source(s) to disable.


Definition at line 363 of file platform/emlib/inc/em_can.h

CAN_StatusIntEnable#

void CAN_StatusIntEnable (CAN_TypeDef * can, uint32_t flags)

Enable CAN status interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN status interrupt source(s) to enable.


Definition at line 378 of file platform/emlib/inc/em_can.h

CAN_StatusIntGet#

uint32_t CAN_StatusIntGet (CAN_TypeDef * can)

Get pending CAN status interrupt flags.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Note

  • This function does not clear event bits.

Returns

  • CAN interrupt source(s) pending.


Definition at line 396 of file platform/emlib/inc/em_can.h

CAN_StatusIntGetEnabled#

uint32_t CAN_StatusIntGetEnabled (CAN_TypeDef * can)

Get pending and enabled CAN status interrupt flags.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Note

  • This function does not clear event bits.

Returns

  • CAN interrupt source(s) pending and enabled.


Definition at line 414 of file platform/emlib/inc/em_can.h

CAN_StatusIntSet#

void CAN_StatusIntSet (CAN_TypeDef * can, uint32_t flags)

Set one or more CAN status interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN status interrupt source(s) to set to pending.


Definition at line 432 of file platform/emlib/inc/em_can.h

CAN_StatusGet#

uint32_t CAN_StatusGet (CAN_TypeDef * can)

Get CAN status.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Returns

  • A value of CAN register STATUS.


Definition at line 447 of file platform/emlib/inc/em_can.h

CAN_StatusClear#

void CAN_StatusClear (CAN_TypeDef * can, uint32_t flags)

Clear CAN status.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN status bits to clear.


Definition at line 462 of file platform/emlib/inc/em_can.h

CAN_GetErrorCount#

uint32_t CAN_GetErrorCount (CAN_TypeDef * can)

Get the error count.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Returns

  • Error count.


Definition at line 477 of file platform/emlib/inc/em_can.h

CAN_MessageIntClear#

void CAN_MessageIntClear (CAN_TypeDef * can, uint32_t flags)

Clear one or more pending CAN message interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

Pending CAN message interrupt source(s) to clear.


Definition at line 492 of file platform/emlib/inc/em_can.h

CAN_MessageIntDisable#

void CAN_MessageIntDisable (CAN_TypeDef * can, uint32_t flags)

Disable CAN message interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN message interrupt source(s) to disable.


Definition at line 507 of file platform/emlib/inc/em_can.h

CAN_MessageIntEnable#

void CAN_MessageIntEnable (CAN_TypeDef * can, uint32_t flags)

Enable CAN message interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN message interrupt source(s) to enable.


Definition at line 522 of file platform/emlib/inc/em_can.h

CAN_MessageIntGet#

uint32_t CAN_MessageIntGet (CAN_TypeDef * can)

Get pending CAN message interrupt flags.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Note

  • This function does not clear event bits.

Returns

  • CAN message interrupt source(s) pending.


Definition at line 540 of file platform/emlib/inc/em_can.h

CAN_MessageIntGetEnabled#

uint32_t CAN_MessageIntGetEnabled (CAN_TypeDef * can)

Get CAN message interrupt flags that are pending and enabled.

Parameters
[in]can

A pointer to the CAN peripheral register block.

Note

  • This function does not clear event bits.

Returns

  • CAN message interrupt source(s) pending and enabled.


Definition at line 558 of file platform/emlib/inc/em_can.h

CAN_MessageIntSet#

void CAN_MessageIntSet (CAN_TypeDef * can, uint32_t flags)

Set one or more CAN message interrupts.

Parameters
[in]can

A pointer to the CAN peripheral register block.

[in]flags

CAN message interrupt source(s) to set as pending.


Definition at line 576 of file platform/emlib/inc/em_can.h

Macro Definition Documentation#

CAN_INIT_DEFAULT#

#define CAN_INIT_DEFAULT
Value:
{ \
true, /** Set the CAN Device in normal mode after initialization. */ \
true, /** Reset messages during initialization. */ \
100000, /** Set bitrate to 100 000 */ \
1, /** Set the Propagation Time Segment to 1. */ \
4, /** Set the Phase Buffer Segment 1 to 4. */ \
4, /** Set the Phase Buffer Segment 2 to 4. */ \
1 /** Set the Synchronization Jump Width to 1. */ \
}

Default initialization of CAN_Init_TypeDef.

The total duration of a bit with these default parameters is 10 tq (time quantum : tq = brp/fsys, brp being the baudrate prescaler and being set according to the wanted bitrate, fsys beeing the CAN device frequency).


Definition at line 178 of file platform/emlib/inc/em_can.h