• Home • Files • Structures         • Download

CANpie configuration options


#define CP_AUTOBAUD   0
#define CP_BUFFER_MAX   0
#define CP_CAN_MSG_MACRO   0
#define CP_CAN_MSG_TIME   1
#define CP_CAN_MSG_USER   1
#define CP_CHANNEL_MAX   1
#define CP_SMALL_CODE   0
#define CP_STATISTIC   0
#define CP_TARGET   0

Detailed Description

The CANpie driver can be configured during compile time via several configuration options. They are typically defined in the cp_arch.h architecture file. The symbol CP_TARGET is used to select an existing definition scheme from this file.

If symbols are not defined, they get a default value which is assigned in the canpie.h header file.

Define Documentation

#define CP_AUTOBAUD   0

This symbol enables or disables the autobaud feature of the CAN driver (CpCoreAutobaud()).

  • 0 = disable autobaud feature (not supported by hardware)
  • 1 = enable autobaud feature

#define CP_BUFFER_MAX   0

This symbol defines the number of message buffers (mailboxes) of a CAN controller. In case the controller has no message buffers, it is also possible to emulate these. A value of 0 denotes that there are no message buffers available. This also means all buffer functions (e.g. CpCoreBufferInit(), etc.) return the error code CpErr_NOT_SUPPORTED.

#define CP_CAN_MSG_MACRO   0

This symbol defines if access to the CAN message structure CpCanMsg_s is done via macros or via functions.

  • 0 = access via functions
  • 1 = access via macros

#define CP_CAN_MSG_TIME   1

This symbol defines if the CAN message structure CpCanMsg_s has a timestamp field.

  • 0 = no timestamp field (not supported by hardware / driver)
  • 1 = include timestamp field

#define CP_CAN_MSG_USER   1

This symbol defines if the CAN message structure CpCanMsg_s has a user-defined field.

  • 0 = no user-defined field (not supported by driver)
  • 1 = include user-defined field

#define CP_CHANNEL_MAX   1

This symbol defines the total number of physical CAN interfaces supported by the driver. For a LPC2294 microcontroller the value would be 4 (4 CAN channels).

#define CP_SMALL_CODE   0

This symbol is used to control the usage of the ptsPortV parameter in the core functions during compilation time. For microcontrollers with small resources and only one CAN channel the port parameter can be omitted.

  • 0 = use ptsPortV parameter in core functions
  • 1 = do not use ptsPortV parameter in core functions

#define CP_STATISTIC   0

This symbol defines if the driver support statistic information. A value of 0 denotes that no statistic information is available. This also means that the function CpCoreStatistic() returns the error code CpErr_NOT_SUPPORTED.

  • 0 = no statistic information (not supported by driver)
  • 1 = enable statistic information

#define CP_TARGET   0

This symbol defines target controller for the CANpie driver. The value can be set in a Makefile or in the cp_cc.h file.


© MicroControl GmbH & Co. KG

CANpie - V2.00