CanFrmSet

Description

This function copies a given value with a given width into the frame at the given position. If width or position is out of range, no changes in the frame was done.

Prototype

void       CanFrmSet(CANFRM     *frm,
                     CPU_INT32U  value,
                     CPU_INT08U  width,
                     CPU_INT08U  pos);

Parameter

Meaning

frm

Pointer to CAN frame

value

Value to be inserted into CAN frame

width

Width of value in bit in range 1..32 or byte (1, 2 or 4).

Note: Interpreting width in bit or byte depends on the configuration setting CANSIG_GRANULARITY

os

Position of first bit, which is used in the can frame in range 0..63.or of first byte.

Note: Interpreting the position in bit or byte depends on the configuration setting CANSIG_GRANULARITY

Additional Information

Current limitation of this function: with data width of 1,2 or 4 byte the position range depends on the data width:

  • width is byte (1): 0..7
  • width is word (2): 0..6
  • width is long (4): 0..4