Case-Study: Softing Can; Opening The Can Communication Channel - SimLab Allegro Hand User Manual

Table of Contents

Advertisement

A L L E G R O H A N D U S E R S M A N U A L
In this chapter, sample code demonstrating the implementation of the CAN communication interface
is provide. This is the foundation for Softing PCI CAN.

Opening the CAN Communication Channel

Code 2: Opening the CAN Communication Channel
char
ch_name[256];
sprintf_s(ch_name, 256, "CAN-ACx-PCI_%d", ch);
INIL2_initialize_channel(&hCAN[ch-1], ch_name);
L2CONFIG L2Config;
L2Config.fBaudrate = 1000.0;
L2Config.bEnableAck = 0;
L2Config.bEnableErrorframe = 0;
L2Config.s32AccCodeStd = 0;
L2Config.s32AccMaskStd = 0;
L2Config.s32AccCodeXtd = 0;
L2Config.s32AccMaskXtd = 0;
L2Config.s32OutputCtrl = GET_FROM_SCIM;
L2Config.s32Prescaler = 1;
L2Config.s32Sam = 0;
L2Config.s32Sjw = 1;
L2Config.s32Tseg1 = 4;
L2Config.s32Tseg2 = 3;
L2Config.hEvent = (void*)-1;
CANL2_initialize_fifo_mode(hCAN[ch-1], &L2Config);
Copyright 2008-2012 SimLab Co., Ltd. All rights reserved.
27

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Allegro Hand and is the answer not in the manual?

Questions and answers

Table of Contents