CAN_DEVCTL_SET_TIMING

Updated: April 19, 2023

Set the reference clock frequency and bit timings

Synopsis:

#include <sys/can_dcmd.h>

#define CAN_DEVCTL_SET_TIMING   __DIOT(_DCMD_MISC, CAN_CMD_CODE + 108, struct can_devctl_timing)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device
dcmd CAN_DEVCTL_SET_TIMING
dev_data_ptr A pointer to a struct can_devctl_timing
n_bytes sizeof(struct can_devctl_timing)
dev_info_ptr NULL

Description:

This command sets the reference clock frequency and bit timings. For details about the parameters, see the CAN controller reference manual for your hardware. You usually set the timing parameters when you start the driver, not at runtime.

Input:

A filled-in struct can_devctl_timing, which is defined in <sys/can_dcmd.h> as follows:

typedef struct can_devctl_timing {
    uint32_t        ref_clock_freq;     /* Reference clock frequency in Hz (don't change if '0') */
    uint16_t        bit_rate_prescaler; /* Bit rate prescaler */
    uint8_t         sync_jump_width;    /* Time quantum Sync Jump Width */
    uint8_t         time_segment_1;     /* Time quantum Time Segment 1 */
    uint8_t         time_segment_2;     /* Time quantum Time Segment 2 */
} CAN_DEVCTL_TIMING;

Output:

None.

See also:

CAN_DEVCTL_GET_INFO

devctl() in the QNX Neutrino C Library Reference

canctl in the Utilities Reference