|
CAN programming interface environment
Version 3.10
|
This file contains constants and structures used by CANpie FD. All functions, structures, macros and constants in CANpie FD use the prefix Cp.
| CANpie code | Nomenclature |
| Core functions | CpCore<Name> |
| CAN frame access functions | CpMsg<Name> |
| Structures | Cp<Name>_ts |
| Definitions | CP_<NAME> |
| Enumerations | eCP_<NAME> |
#include "mc_compiler.h"#include "cp_platform.h"Data Structures | |
| struct | CpTime_s |
| struct | CpCanMsg_s |
| struct | CpHdi_s |
| struct | CpStatistic_s |
| struct | CpState_s |
| #define CP_DATA_SIZE ((uint8_t) 8) |
The symbol CP_DATA_SIZE defines the maximum number of bytes that are transferred inside the data field of a CAN frame. For Classic CAN frames the maximum number of bytes is 8, for CAN FD frames the maximum number of bytes is 64.
| enum CpBitrate_e |
Fixed bit rates.
The values of the enumeration CpBitrate_e are used as parameters for the function CpCoreBitrate().
| enum CpBuffer_e |
| enum CpBufferDir_e |
Buffer direction definition.
The enumeration CpBufferDir_e is used to define the direction of a message buffer (transmit or receive). The enumeration values are used by the function CpCoreBufferConfig().
| Enumerator | |
|---|---|
| eCP_BUFFER_DIR_RCV | Message buffer direction is receive |
| eCP_BUFFER_DIR_TRM | Message buffer direction is transmit |
| enum CpCallback_e |
Callback Return Codes.
These return values are used by the callback functions that can be installed by the function CpCoreIntFunctions().
Example
| enum CpChannel_e |
Channel definition.
The physical CAN interfaces are numbered from 1 .. N (N: total number of physical CAN interfaces on the target system). The enumeration CpChannel_e lists up to 8 physical interfaces. The enumeration value eCP_CHANNEL_NONE denotes an invalid channel value.
| enum CpErr_e |
CANpie Error codes.
All functions that may cause an error condition return an error code. The CANpie error codes are in the range 0 to 127. The designer of the core functions may extend the error code table with hardware-specific error codes, which must be in the range from 128 to 255.
| enum CpErrType_e |
Error type.
These values are used as return value for the function CpCoreCanState().
| enum CpMode_e |
Mode of CAN controller.
These values are used as parameters for the function CpCoreCanMode() in order to change the state of the CAN controller.
| enum CpRpc_e |
| Enumerator | |
|---|---|
| eCP_RPC_NOOP | RPC for no operation |
| eCP_RPC_MODE | RPC for CpCoreCanMode() |
| eCP_RPC_BITRATE | RPC for CpCoreBitrate() |
| enum CpState_e |
State of CAN controller.
These values are used as return values for the function CpCoreCanState().