Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CANSIG_PARA

Description

This structure contains the configuration informations for a signal. A signal represents a piece of information within the application (a single bit, a bitfield, a integer value, etc...).

...

Members

typedef

...

struct

...

{

...

CPU_

...

INT08U Status;

...

CPU_

...

INT08U Width;

...

CANSIG_VAL_T

...

Value;

...

CANSIG_CALLBACK

...

CallbackFct;

}

...

CANSIG_PARA;

Member

Meaning

Status

This member holds the initial status of the signal. This status will be copied to the signal status during initialization phase by calling CanSigInit().

Width

This member holds the width of the signal in bit in range 1..32 or in byte (1,2, or 4).

Note: Interpreting the width of the signal in bit or byte depends on the configuration setting ‘CANSIGCANSIG_GRANULARITY’GRANULARITY

Value

This member holds the initial value of the signal. This value will be copied to the signal value during initialization phase by calling CanSigInit().

CallbackFct

This member holds the function pointer to the callback function, which is called during a signal write or a read event. The function must have the following Prototype:

void Func (void *, CANSIG_VAL_T *, CPU_INT32UINT32U);

The first parameter is used as a pointer to the actual signal.

The second parameter is a pointer to the actual write-value. In case of a read-event it is set to 0.

The third parameter is used to identify the event type (see below).

Note: The callback-function can be en/disabled via can_cfg.h-file.

...

Interrupts are enabled when called from signal read function.

...

Additional Information:

Status

Meaning

CANSIG_UNUSED

This define holds the coding for the information: 'signal not used'. This status is the default status, before the CAN signal initialization function is called. After the CAN signal initialization, this status remains in the CAN signal interface slots, which is not configured via the configuration structure.

CANSIG_UNCHANGED

This define holds the coding for the information: 'signal is unchang’ed'. This status will be set, after a signal access with CanSigRead().

CANSIG_UPDATED

This define holds the coding for the information: 'signal is updat’ed'. This status will be set, after a signal write access with CanSigWrite() - independent from the signal value.

CANSIG_CHANGED

This define holds the coding for the information: 'signal is changed'. This status will be set, when a CanSigWrite() access changes the value of the signal.

CANSIG_ERROR

This define holds the coding for the information: 'signal error'.

CANSIG_PROT_RO

This define holds the coding for the information ‘signal write protection’. When set, CanSigWrite-function will have no effect on that signal.

CANSIG_NO_TIMESTAMP

This define holds the coding for the information ‘signal timestamp disabled‘. When set, timestamp will not be updated for that signal.

Event type Id

Meaning

CANSIG_CALLBACK_READ_ID

The callback-function is called from the signal read function.

CANSIG_CALLBACK_WRITE_ID

The callback-function is called from the signal write function.

End