FdDriverOpenH (FUN)ΒΆ

FUNCTION FdDriverOpenH : CAA.HANDLE

Opens a CAN FD interface and allocates memory from heap. Please note that not all hardware supports every baud rate combination. If a baud rate is not supported or if the interface cannot be opened due to different reasons, the function returns CAA.gc_hINVALID. The function can be called several times on the same interface, so that multiple parts of a program can work on it. You can set uiNominalBaudrate and uiDataBaudrate to 0 if the interface is already opened or if the default baudrate from configuration file should be used. See following section in configuration file:

[CmpCAACanL2]
PersistentBaudrate=1
Net.0.DefaultBaudrate=500
Net.0.DefaultDataBaudrate=4000

Example

See Write.

InOut:

Scope

Name

Type

Comment

Return

FdDriverOpenH

CAA.HANDLE

handle of CAN FD interface or CAA.gc_hINVALID if failed.

Input

usiNetId

USINT

number of FD-capable CAN interface [0..n]

uiNominalBaudrate

UINT

Baud rate used for arbitration. Unit: kBit/s

uiDataBaudrate

UINT

Baud rate used for data phase. If > 0 then bitrate switching is enabled. Unit: kBit/s

xSupport29Bits

BOOL

FALSE: only 11-Bit IDs, TRUE: support also 29-Bit

ctMessages

CAA.COUNT

number of FD transmit messages which should be allocated

peError

POINTER TO ERROR

optional pointer to error enum