; TASKING TriCore C compiler v1.5r1 Build 322 SN 00090364
; options: -e -A1 -g -O0 -Id:\ctri\include -s -N8 -zTC112_COR1 -zTC112_COR4
;          -zTC112_COR10 -zTC112_COR13 -zTC112_COR14 -zTC112_COR16 -zTC112_COR17
	.name	"can"
	.symb	TOOL, "TASKING TriCore C compiler v1.5", 1
	.symb	TYPE, 256, "bit", 'g', 0, 1
	.symb	FILE, "can.c"
; file "can.c":
;    1 |//****************************************************************************
;    2 |// @Module        TwinCAN Controller 
;    3 |// @Filename      CAN.C
;    4 |// @Project       Test_TC1775B.dav
;    5 |//----------------------------------------------------------------------------
;    6 |// @Controller    Infineon TC1775 B-Step
;    7 |//
;    8 |// @Compiler      Tasking
;    9 |//
;   10 |// @Codegenerator 2.2
;   11 |//
;   12 |// @Description   This file contains functions that use the CAN module.
;   13 |//
;   14 |//----------------------------------------------------------------------------
;   15 |// @Date          12.06.2002 17:31:48
;   16 |//
;   17 |//****************************************************************************
;   18 |
;   19 |// USER CODE BEGIN (CAN_General,1)
;   20 |
;   21 |// USER CODE END
;   22 |
;   23 |
;   24 |
;   25 |//****************************************************************************
;   26 |// @Project Includes
;   27 |//****************************************************************************
;   28 |
;   29 |#include "MAIN.H"
	.symb	FILE, "MAIN.H"
	.symb	TYPE, 257, "uword", 'T', #18
	.symb	FILE, "TC1775BRegs.h"
	.symb	ENDF
	.symb	FILE, "IO.H"
	.symb	ENDF
	.symb	FILE, "ASC0.H"
	.symb	TYPE, 258, "ushort", 'T', #5
	.symb	ENDF
	.symb	FILE, "ASC1.H"
	.symb	ENDF
	.symb	FILE, "CAN.H"
	.symb	TYPE, 259, "ubyte", 'T', #3
	.symb	TYPE, 260, 'Z', #3, 7
	.symb	TYPE, 262, 'S', 20,\
		 "usMsgCfg", #5, 0,\
		 "uwID", #18, 2,\
		 "uwMask", #18, 6,\
		 "ubData", #260, 10,\
		 "usCounter", #5, 18
	.symb	TYPE, 263, "TCAN_SWObj", 'T', #262
	.symb	ENDF
	.symb	ENDF
;   30 |
;   31 |// USER CODE BEGIN (CAN_General,2)
;   32 |
;   33 |// USER CODE END
;   34 |
;   35 |
;   36 |//****************************************************************************
;   37 |// @Macros
;   38 |//****************************************************************************
;   39 |
;   40 |// USER CODE BEGIN (CAN_General,3)
;   41 |
;   42 |// USER CODE END
;   43 |
;   44 |
;   45 |//****************************************************************************
;   46 |// @Defines
;   47 |//****************************************************************************
;   48 |
;   49 |// Structure for a single TwinCAN object
;   50 |// A total of 31 such object structures exists
;   51 |
;   52 |struct stCanObj 
;   53 |{
;   54 |  ubyte  ubData[8];  // Message Data 0..7
;   55 |  uword  uwCANAR;    // Arbitration Register
;   56 |  uword  uwCANAMR;   // Acceptance Mask Register
;   57 |  ushort usMSGCTR;   // Message Control Register
;   58 |  ushort usCounter;  // Frame Counter
;   59 |  ushort usMSGCFG;   // Message Configuration Register
;   60 |  ushort usINP;      // Interrupt Node Pointer
;   61 |  ushort usCANFCR;   // FIFO / Gateway Control Register 
;   62 |  ushort usCANPTR;   // FIFO Pointer
;   63 |  uword  uwReserved; // Reserved
;   64 |};
;   65 |
;   66 |#define CAN_HWOBJ ((struct stCanObj volatile *) 0xF0100300)
;   67 |
;   68 |// USER CODE BEGIN (CAN_General,4)
;   69 |
;   70 |// USER CODE END
;   71 |
;   72 |
;   73 |//****************************************************************************
;   74 |// @Typedefs
;   75 |//****************************************************************************
;   76 |
;   77 |// USER CODE BEGIN (CAN_General,5)
;   78 |
;   79 |// USER CODE END
;   80 |
;   81 |
;   82 |//****************************************************************************
;   83 |// @Imported Global Variables
;   84 |//****************************************************************************
;   85 |
;   86 |// USER CODE BEGIN (CAN_General,6)
;   87 |
;   88 |// USER CODE END
;   89 |
;   90 |
;   91 |//****************************************************************************
;   92 |// @Global Variables
;   93 |//****************************************************************************
;   94 |
;   95 |// USER CODE BEGIN (CAN_General,7)
;   96 |
;   97 |// USER CODE END
;   98 |
;   99 |
;  100 |//****************************************************************************
;  101 |// @External Prototypes
;  102 |//****************************************************************************
;  103 |
;  104 |// USER CODE BEGIN (CAN_General,8)
;  105 |
;  106 |// USER CODE END
;  107 |
;  108 |
;  109 |//****************************************************************************
;  110 |// @Prototypes Of Local Functions
;  111 |//****************************************************************************
;  112 |
;  113 |// USER CODE BEGIN (CAN_General,9)
;  114 |
;  115 |// USER CODE END
;  116 |
;  117 |
;  118 |//****************************************************************************
;  119 |// @Function      void CAN_vInit(void) 
;  120 |//
;  121 |//----------------------------------------------------------------------------
;  122 |// @Description   This is the initialization function of the CAN function 
;  123 |//                library. It is assumed that the SFRs used by this library 
;  124 |//                are in its reset state. 
;  125 |//
;  126 |//----------------------------------------------------------------------------
;  127 |// @Returnvalue   None
;  128 |//
;  129 |//----------------------------------------------------------------------------
;  130 |// @Parameters    None
;  131 |//
;  132 |//----------------------------------------------------------------------------
;  133 |// @Date          12.06.2002
;  134 |//
;  135 |//****************************************************************************
;  136 |
;  137 |// USER CODE BEGIN (Init,1)
;  138 |
;  139 |// USER CODE END
;  140 |
;  141 |void CAN_vInit(void)
;  142 |{
	.sdecl	"code.can",CODE
	.sect	"code.can"
	.align	4
	.symb	LINE, 142
	.symb	TYPE, 264, 'X', 8, #1, 26, 0
	.symb	GFUN, "CAN_vInit", CAN_vInit, #264, 0, 0, 0
	.symb	ALAB, CAN_vInit, #264
CAN_vInit:
	.symb	SOFF, 0
;  143 |
;  144 |  // USER CODE BEGIN (Init,2)
;  145 |
;  146 |  // USER CODE END
;  147 |
;  148 |  ///  -----------------------------------------------------------------------
;  149 |  ///  Configuration of the Module Clock:
;  150 |  ///  -----------------------------------------------------------------------
;  151 |  ///  - enable the CAN module
;  152 |  ///  - clock divider for normal operation mode: System clock / 2 (= 20,0000 
;  153 |  ///    MHz; 50,000 ns )
;  154 |  ///  - the CAN module is stopped during sleep mode
;  155 |
;  156 |  MAIN_vResetENDINIT();
	.symb	LINE, 156
	ld.w	d4,-268435424
	mov16	d15,#-2				; -2
	and16	d4,d15
	callg	MAIN_vWriteWDTCON0
;  157 |  CAN_CLC        =  0x00000200;  // load clock control register
	.symb	LINE, 157
	mov	d15,#512
	movh.a	a15,#0xf010
	st16.w	[a15],d15
;  158 |  MAIN_vSetENDINIT();
	.symb	LINE, 158
	ld.w	d4,-268435424
	or	d4,d4,#1
	callg	MAIN_vWriteWDTCON0
;  159 |
;  160 |
;  161 |  ///  -----------------------------------------------------------------------
;  162 |  ///  Configuration of CAN Node A:
;  163 |  ///  -----------------------------------------------------------------------
;  164 |
;  165 |  ///  General Configuration of the Node A:
;  166 |  ///  - set INIT and CCE
;  167 |
;  168 |  CAN_ACR        =  0x00000041;  // load global control register
	.symb	LINE, 168
	mov16	d15,#65
	movh.a	a15,#0xf010
	lea	a15,[a15]0x200
	st16.w	[a15],d15
;  169 |  CAN_AGINP      =  0x00000000;  // load global interrupt node pointer 
	.symb	LINE, 169
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x210
	st16.w	[a15],d15
;  170 |                                 // register
;  171 |
;  172 |  ///  Configuration of the Node A Error Counter:
;  173 |  ///  - the error warning threshold value (warning level) is 96
;  174 |
;  175 |  CAN_AECNT      =  0x00600000;  // load error counter register
	.symb	LINE, 175
	movh	d15,#0x60
	movh.a	a15,#0xf010
	lea	a15,[a15]0x220
	st16.w	[a15],d15
;  176 |
;  177 |  ///  Configuration of the used CAN Port Pins:
;  178 |  ///  - P13.12 is used for CAN0 receive input signal (CAN0_RXD)
;  179 |  ///  - P13.13 is used for CAN0 transmitter output signal (CAN0_TXD)
;  180 |
;  181 |  P13_ALTSEL0   |=  0x2000;      // select alternate output function
	.symb	LINE, 181
	ld.w	d15,-268421820
	mov	d7,#8192			; 8192
	or16	d15,d7
	st.w	-268421820,d15
;  182 |  P13_DIR       |=  0x2000;      // set direction register
	.symb	LINE, 182
	ld.w	d15,-268421864
	mov	d7,#8192			; 8192
	or16	d15,d7
	st.w	-268421864,d15
;  183 |
;  184 |  ///  Configuration of the Node A Baud Rate:
;  185 |  ///  - required baud rate = 125,000 kbaud
;  186 |  ///  - real baud rate     = 125,000 kbaud
;  187 |  ///  - sample point       = 60,00 %
;  188 |  ///  - there are 5 time quanta before sample point
;  189 |  ///  - there are 4 time quanta after sample point
;  190 |  ///  - the (re)synchronization jump width is 2 time quanta
;  191 |
;  192 |  CAN_ABTR       =  0x0000344F;  // load bit timing register
	.symb	LINE, 192
	mov	d15,#13391
	movh.a	a15,#0xf010
	lea	a15,[a15]0x20c
	st16.w	[a15],d15
;  193 |
;  194 |  CAN_AFCR       =  0x00000000;  // load frame counter timing register
	.symb	LINE, 194
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x214
	st16.w	[a15],d15
;  195 |
;  196 |  ///  -----------------------------------------------------------------------
;  197 |  ///  Configuration of CAN Node B:
;  198 |  ///  -----------------------------------------------------------------------
;  199 |
;  200 |  ///  General Configuration of the Node B:
;  201 |  ///  - set INIT and CCE
;  202 |
;  203 |  CAN_BCR        =  0x00000041;  // load global control register
	.symb	LINE, 203
	mov16	d15,#65
	movh.a	a15,#0xf010
	lea	a15,[a15]0x240
	st16.w	[a15],d15
;  204 |  CAN_BGINP      =  0x00000000;  // load global interrupt node pointer 
	.symb	LINE, 204
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x250
	st16.w	[a15],d15
;  205 |                                 // register
;  206 |
;  207 |  ///  Configuration of the Node B Error Counter:
;  208 |  ///  - the error warning threshold value (warning level) is 96
;  209 |
;  210 |  CAN_BECNT      =  0x00600000;  // load error counter register
	.symb	LINE, 210
	movh	d15,#0x60
	movh.a	a15,#0xf010
	lea	a15,[a15]0x260
	st16.w	[a15],d15
;  211 |
;  212 |  ///  Configuration of the used CAN Port Pins:
;  213 |  ///  - P13.14 is used for CAN1 receive input signal (CAN1_RXD)
;  214 |  ///  - P13.15 is used for CAN1 transmitter output signal (CAN1_TXD)
;  215 |
;  216 |  P13_ALTSEL0   |=  0x8000;      // select alternate output function
	.symb	LINE, 216
	ld.w	d15,-268421820
	mov.u	d7,#32768			; 32768
	or16	d15,d7
	st.w	-268421820,d15
;  217 |  P13_DIR       |=  0x8000;      // set direction register
	.symb	LINE, 217
	ld.w	d15,-268421864
	mov.u	d7,#32768			; 32768
	or16	d15,d7
	st.w	-268421864,d15
;  218 |
;  219 |  ///  Configuration of the Node B Baud Rate:
;  220 |  ///  - required baud rate = 125,000 kbaud
;  221 |  ///  - real baud rate     = 125,000 kbaud
;  222 |  ///  - sample point       = 60,00 %
;  223 |  ///  - there are 5 time quanta before sample point
;  224 |  ///  - there are 4 time quanta after sample point
;  225 |  ///  - the (re)synchronization jump width is 2 time quanta
;  226 |
;  227 |  CAN_BBTR       =  0x0000344F;  // load bit timing register
	.symb	LINE, 227
	mov	d15,#13391
	movh.a	a15,#0xf010
	lea	a15,[a15]0x24c
	st16.w	[a15],d15
;  228 |
;  229 |  CAN_BFCR       =  0x00000000;  // load frame counter timing register
	.symb	LINE, 229
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x254
	st16.w	[a15],d15
;  230 |
;  231 |  ///  -----------------------------------------------------------------------
;  232 |  ///  Configuration of the CAN Message Objects 0 - 31:
;  233 |  ///  -----------------------------------------------------------------------
;  234 |  ///  -----------------------------------------------------------------------
;  235 |  ///  Configuration of Message Object 0:
;  236 |  ///  -----------------------------------------------------------------------
;  237 |  ///  - message object 0 is valid
;  238 |
;  239 |  CAN_MSGCTR0    =  0x00005595;  // load message control register
	.symb	LINE, 239
	mov	d15,#21909
	movh.a	a15,#0xf010
	lea	a15,[a15]0x310
	st16.w	[a15],d15
;  240 |
;  241 |  ///  - message object is used as receive object
;  242 |  ///  - standard 11-bit identifier
;  243 |  ///  - 8 valid data bytes
;  244 |  ///  - this message object works with CAN node A
;  245 |  ///  - remote monitoring is disabled
;  246 |
;  247 |  CAN_MSGCFG0    =  0x00000080;  // load message configuration register
	.symb	LINE, 247
	mov16	d15,#128
	movh.a	a15,#0xf010
	lea	a15,[a15]0x314
	st16.w	[a15],d15
;  248 |
;  249 |  ///  - acceptance mask 11-bit: 0x7FF
;  250 |  ///  - identifier 11-bit:      0x100
;  251 |
;  252 |  CAN_MSGAMR0    =  0xFFFFFFFF;  // load acceptance mask register
	.symb	LINE, 252
	mov16	d15,#-1
	movh.a	a15,#0xf010
	lea	a15,[a15]0x30c
	st16.w	[a15],d15
;  253 |  CAN_MSGAR0     =  0x04000000;  // load arbitration register
	.symb	LINE, 253
	movh	d15,#0x400
	movh.a	a15,#0xf010
	lea	a15,[a15]0x308
	st16.w	[a15],d15
;  254 |
;  255 |  CAN_MSGDR00    =  0x00000000;  // load data register 0
	.symb	LINE, 255
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x300
	st16.w	[a15],d15
;  256 |  CAN_MSGDR04    =  0x00000000;  // load data register 4
	.symb	LINE, 256
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x304
	st16.w	[a15],d15
;  257 |
;  258 |  ///  - functionality of standard message object
;  259 |
;  260 |  CAN_MSGFGCR0   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 260
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x318
	st16.w	[a15],d15
;  261 |
;  262 |  ///  -----------------------------------------------------------------------
;  263 |  ///  Configuration of Message Object 1:
;  264 |  ///  -----------------------------------------------------------------------
;  265 |  ///  - message object 1 is valid
;  266 |
;  267 |  CAN_MSGCTR1    =  0x00005595;  // load message control register
	.symb	LINE, 267
	mov	d15,#21909
	movh.a	a15,#0xf010
	lea	a15,[a15]0x330
	st16.w	[a15],d15
;  268 |
;  269 |  ///  - message object is used as transmit object
;  270 |  ///  - standard 11-bit identifier
;  271 |  ///  - 8 valid data bytes
;  272 |  ///  - this message object works with CAN node A
;  273 |  ///  - remote monitoring is disabled
;  274 |
;  275 |  CAN_MSGCFG1    =  0x00000088;  // load message configuration register
	.symb	LINE, 275
	mov16	d15,#136
	movh.a	a15,#0xf010
	lea	a15,[a15]0x334
	st16.w	[a15],d15
;  276 |
;  277 |  ///  - acceptance mask 11-bit: 0x7FF
;  278 |  ///  - identifier 11-bit:      0x200
;  279 |
;  280 |  CAN_MSGAMR1    =  0xFFFFFFFF;  // load acceptance mask register
	.symb	LINE, 280
	mov16	d15,#-1
	movh.a	a15,#0xf010
	lea	a15,[a15]0x32c
	st16.w	[a15],d15
;  281 |  CAN_MSGAR1     =  0x08000000;  // load arbitration register
	.symb	LINE, 281
	movh	d15,#0x800
	movh.a	a15,#0xf010
	lea	a15,[a15]0x328
	st16.w	[a15],d15
;  282 |
;  283 |  CAN_MSGDR10    =  0x14131211;  // load data register 0
	.symb	LINE, 283
	mov.u	d15,#0x1211
	addih	d15,d15,#0x1413
	movh.a	a15,#0xf010
	lea	a15,[a15]0x320
	st16.w	[a15],d15
;  284 |  CAN_MSGDR14    =  0x18171615;  // load data register 4
	.symb	LINE, 284
	mov.u	d15,#0x1615
	addih	d15,d15,#0x1817
	movh.a	a15,#0xf010
	lea	a15,[a15]0x324
	st16.w	[a15],d15
;  285 |
;  286 |  ///  - functionality of standard message object
;  287 |
;  288 |  CAN_MSGFGCR1   =  0x00010000;  // load FIFO/gateway control register
	.symb	LINE, 288
	movh	d15,#0x1
	movh.a	a15,#0xf010
	lea	a15,[a15]0x338
	st16.w	[a15],d15
;  289 |
;  290 |  ///  -----------------------------------------------------------------------
;  291 |  ///  Configuration of Message Object 2:
;  292 |  ///  -----------------------------------------------------------------------
;  293 |  ///  - message object 2 is valid
;  294 |
;  295 |  CAN_MSGCTR2    =  0x00005595;  // load message control register
	.symb	LINE, 295
	mov	d15,#21909
	movh.a	a15,#0xf010
	lea	a15,[a15]0x350
	st16.w	[a15],d15
;  296 |
;  297 |  ///  - message object is used as receive object
;  298 |  ///  - standard 11-bit identifier
;  299 |  ///  - 8 valid data bytes
;  300 |  ///  - this message object works with CAN node B
;  301 |  ///  - remote monitoring is disabled
;  302 |
;  303 |  CAN_MSGCFG2    =  0x00000082;  // load message configuration register
	.symb	LINE, 303
	mov16	d15,#130
	movh.a	a15,#0xf010
	lea	a15,[a15]0x354
	st16.w	[a15],d15
;  304 |
;  305 |  ///  - acceptance mask 11-bit: 0x7FF
;  306 |  ///  - identifier 11-bit:      0x200
;  307 |
;  308 |  CAN_MSGAMR2    =  0xFFFFFFFF;  // load acceptance mask register
	.symb	LINE, 308
	mov16	d15,#-1
	movh.a	a15,#0xf010
	lea	a15,[a15]0x34c
	st16.w	[a15],d15
;  309 |  CAN_MSGAR2     =  0x08000000;  // load arbitration register
	.symb	LINE, 309
	movh	d15,#0x800
	movh.a	a15,#0xf010
	lea	a15,[a15]0x348
	st16.w	[a15],d15
;  310 |
;  311 |  CAN_MSGDR20    =  0x00000000;  // load data register 0
	.symb	LINE, 311
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x340
	st16.w	[a15],d15
;  312 |  CAN_MSGDR24    =  0x00000000;  // load data register 4
	.symb	LINE, 312
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x344
	st16.w	[a15],d15
;  313 |
;  314 |  ///  - functionality of standard message object
;  315 |
;  316 |  CAN_MSGFGCR2   =  0x00020000;  // load FIFO/gateway control register
	.symb	LINE, 316
	movh	d15,#0x2
	movh.a	a15,#0xf010
	lea	a15,[a15]0x358
	st16.w	[a15],d15
;  317 |
;  318 |  ///  -----------------------------------------------------------------------
;  319 |  ///  Configuration of Message Object 3:
;  320 |  ///  -----------------------------------------------------------------------
;  321 |  ///  - message object 3 is valid
;  322 |
;  323 |  CAN_MSGCTR3    =  0x00005595;  // load message control register
	.symb	LINE, 323
	mov	d15,#21909
	movh.a	a15,#0xf010
	lea	a15,[a15]0x370
	st16.w	[a15],d15
;  324 |
;  325 |  ///  - message object is used as transmit object
;  326 |  ///  - standard 11-bit identifier
;  327 |  ///  - 8 valid data bytes
;  328 |  ///  - this message object works with CAN node B
;  329 |  ///  - remote monitoring is disabled
;  330 |
;  331 |  CAN_MSGCFG3    =  0x0000008A;  // load message configuration register
	.symb	LINE, 331
	mov16	d15,#138
	movh.a	a15,#0xf010
	lea	a15,[a15]0x374
	st16.w	[a15],d15
;  332 |
;  333 |  ///  - acceptance mask 11-bit: 0x7FF
;  334 |  ///  - identifier 11-bit:      0x100
;  335 |
;  336 |  CAN_MSGAMR3    =  0xFFFFFFFF;  // load acceptance mask register
	.symb	LINE, 336
	mov16	d15,#-1
	movh.a	a15,#0xf010
	lea	a15,[a15]0x36c
	st16.w	[a15],d15
;  337 |  CAN_MSGAR3     =  0x04000000;  // load arbitration register
	.symb	LINE, 337
	movh	d15,#0x400
	movh.a	a15,#0xf010
	lea	a15,[a15]0x368
	st16.w	[a15],d15
;  338 |
;  339 |  CAN_MSGDR30    =  0x24232221;  // load data register 0
	.symb	LINE, 339
	mov.u	d15,#0x2221
	addih	d15,d15,#0x2423
	movh.a	a15,#0xf010
	lea	a15,[a15]0x360
	st16.w	[a15],d15
;  340 |  CAN_MSGDR34    =  0x28272625;  // load data register 4
	.symb	LINE, 340
	mov.u	d15,#0x2625
	addih	d15,d15,#0x2827
	movh.a	a15,#0xf010
	lea	a15,[a15]0x364
	st16.w	[a15],d15
;  341 |
;  342 |  ///  - functionality of standard message object
;  343 |
;  344 |  CAN_MSGFGCR3   =  0x00030000;  // load FIFO/gateway control register
	.symb	LINE, 344
	movh	d15,#0x3
	movh.a	a15,#0xf010
	lea	a15,[a15]0x378
	st16.w	[a15],d15
;  345 |
;  346 |  ///  -----------------------------------------------------------------------
;  347 |  ///  Configuration of Message Object 4:
;  348 |  ///  -----------------------------------------------------------------------
;  349 |  ///  - message object 4 is not valid
;  350 |
;  351 |  CAN_MSGCTR4    =  0x00005555;  // load message control register
	.symb	LINE, 351
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x390
	st16.w	[a15],d15
;  352 |  CAN_MSGFGCR4   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 352
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x398
	st16.w	[a15],d15
;  353 |
;  354 |  ///  -----------------------------------------------------------------------
;  355 |  ///  Configuration of Message Object 5:
;  356 |  ///  -----------------------------------------------------------------------
;  357 |  ///  - message object 5 is not valid
;  358 |
;  359 |  CAN_MSGCTR5    =  0x00005555;  // load message control register
	.symb	LINE, 359
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3b0
	st16.w	[a15],d15
;  360 |  CAN_MSGFGCR5   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 360
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3b8
	st16.w	[a15],d15
;  361 |
;  362 |  ///  -----------------------------------------------------------------------
;  363 |  ///  Configuration of Message Object 6:
;  364 |  ///  -----------------------------------------------------------------------
;  365 |  ///  - message object 6 is not valid
;  366 |
;  367 |  CAN_MSGCTR6    =  0x00005555;  // load message control register
	.symb	LINE, 367
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3d0
	st16.w	[a15],d15
;  368 |  CAN_MSGFGCR6   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 368
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3d8
	st16.w	[a15],d15
;  369 |
;  370 |  ///  -----------------------------------------------------------------------
;  371 |  ///  Configuration of Message Object 7:
;  372 |  ///  -----------------------------------------------------------------------
;  373 |  ///  - message object 7 is not valid
;  374 |
;  375 |  CAN_MSGCTR7    =  0x00005555;  // load message control register
	.symb	LINE, 375
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3f0
	st16.w	[a15],d15
;  376 |  CAN_MSGFGCR7   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 376
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x3f8
	st16.w	[a15],d15
;  377 |
;  378 |  ///  -----------------------------------------------------------------------
;  379 |  ///  Configuration of Message Object 8:
;  380 |  ///  -----------------------------------------------------------------------
;  381 |  ///  - message object 8 is not valid
;  382 |
;  383 |  CAN_MSGCTR8    =  0x00005555;  // load message control register
	.symb	LINE, 383
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x410
	st16.w	[a15],d15
;  384 |  CAN_MSGFGCR8   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 384
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x418
	st16.w	[a15],d15
;  385 |
;  386 |  ///  -----------------------------------------------------------------------
;  387 |  ///  Configuration of Message Object 9:
;  388 |  ///  -----------------------------------------------------------------------
;  389 |  ///  - message object 9 is not valid
;  390 |
;  391 |  CAN_MSGCTR9    =  0x00005555;  // load message control register
	.symb	LINE, 391
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x430
	st16.w	[a15],d15
;  392 |  CAN_MSGFGCR9   =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 392
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x438
	st16.w	[a15],d15
;  393 |
;  394 |  ///  -----------------------------------------------------------------------
;  395 |  ///  Configuration of Message Object 10:
;  396 |  ///  -----------------------------------------------------------------------
;  397 |  ///  - message object 10 is not valid
;  398 |
;  399 |  CAN_MSGCTR10   =  0x00005555;  // load message control register
	.symb	LINE, 399
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x450
	st16.w	[a15],d15
;  400 |  CAN_MSGFGCR10  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 400
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x458
	st16.w	[a15],d15
;  401 |
;  402 |  ///  -----------------------------------------------------------------------
;  403 |  ///  Configuration of Message Object 11:
;  404 |  ///  -----------------------------------------------------------------------
;  405 |  ///  - message object 11 is not valid
;  406 |
;  407 |  CAN_MSGCTR11   =  0x00005555;  // load message control register
	.symb	LINE, 407
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x470
	st16.w	[a15],d15
;  408 |  CAN_MSGFGCR11  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 408
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x478
	st16.w	[a15],d15
;  409 |
;  410 |  ///  -----------------------------------------------------------------------
;  411 |  ///  Configuration of Message Object 12:
;  412 |  ///  -----------------------------------------------------------------------
;  413 |  ///  - message object 12 is not valid
;  414 |
;  415 |  CAN_MSGCTR12   =  0x00005555;  // load message control register
	.symb	LINE, 415
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x490
	st16.w	[a15],d15
;  416 |  CAN_MSGFGCR12  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 416
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x498
	st16.w	[a15],d15
;  417 |
;  418 |  ///  -----------------------------------------------------------------------
;  419 |  ///  Configuration of Message Object 13:
;  420 |  ///  -----------------------------------------------------------------------
;  421 |  ///  - message object 13 is not valid
;  422 |
;  423 |  CAN_MSGCTR13   =  0x00005555;  // load message control register
	.symb	LINE, 423
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4b0
	st16.w	[a15],d15
;  424 |  CAN_MSGFGCR13  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 424
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4b8
	st16.w	[a15],d15
;  425 |
;  426 |  ///  -----------------------------------------------------------------------
;  427 |  ///  Configuration of Message Object 14:
;  428 |  ///  -----------------------------------------------------------------------
;  429 |  ///  - message object 14 is not valid
;  430 |
;  431 |  CAN_MSGCTR14   =  0x00005555;  // load message control register
	.symb	LINE, 431
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4d0
	st16.w	[a15],d15
;  432 |  CAN_MSGFGCR14  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 432
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4d8
	st16.w	[a15],d15
;  433 |
;  434 |  ///  -----------------------------------------------------------------------
;  435 |  ///  Configuration of Message Object 15:
;  436 |  ///  -----------------------------------------------------------------------
;  437 |  ///  - message object 15 is not valid
;  438 |
;  439 |  CAN_MSGCTR15   =  0x00005555;  // load message control register
	.symb	LINE, 439
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4f0
	st16.w	[a15],d15
;  440 |  CAN_MSGFGCR15  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 440
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x4f8
	st16.w	[a15],d15
;  441 |
;  442 |  ///  -----------------------------------------------------------------------
;  443 |  ///  Configuration of Message Object 16:
;  444 |  ///  -----------------------------------------------------------------------
;  445 |  ///  - message object 16 is not valid
;  446 |
;  447 |  CAN_MSGCTR16   =  0x00005555;  // load message control register
	.symb	LINE, 447
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x510
	st16.w	[a15],d15
;  448 |  CAN_MSGFGCR16  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 448
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x518
	st16.w	[a15],d15
;  449 |
;  450 |  ///  -----------------------------------------------------------------------
;  451 |  ///  Configuration of Message Object 17:
;  452 |  ///  -----------------------------------------------------------------------
;  453 |  ///  - message object 17 is not valid
;  454 |
;  455 |  CAN_MSGCTR17   =  0x00005555;  // load message control register
	.symb	LINE, 455
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x530
	st16.w	[a15],d15
;  456 |  CAN_MSGFGCR17  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 456
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x538
	st16.w	[a15],d15
;  457 |
;  458 |  ///  -----------------------------------------------------------------------
;  459 |  ///  Configuration of Message Object 18:
;  460 |  ///  -----------------------------------------------------------------------
;  461 |  ///  - message object 18 is not valid
;  462 |
;  463 |  CAN_MSGCTR18   =  0x00005555;  // load message control register
	.symb	LINE, 463
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x550
	st16.w	[a15],d15
;  464 |  CAN_MSGFGCR18  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 464
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x558
	st16.w	[a15],d15
;  465 |
;  466 |  ///  -----------------------------------------------------------------------
;  467 |  ///  Configuration of Message Object 19:
;  468 |  ///  -----------------------------------------------------------------------
;  469 |  ///  - message object 19 is not valid
;  470 |
;  471 |  CAN_MSGCTR19   =  0x00005555;  // load message control register
	.symb	LINE, 471
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x570
	st16.w	[a15],d15
;  472 |  CAN_MSGFGCR19  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 472
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x578
	st16.w	[a15],d15
;  473 |
;  474 |  ///  -----------------------------------------------------------------------
;  475 |  ///  Configuration of Message Object 20:
;  476 |  ///  -----------------------------------------------------------------------
;  477 |  ///  - message object 20 is not valid
;  478 |
;  479 |  CAN_MSGCTR20   =  0x00005555;  // load message control register
	.symb	LINE, 479
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x590
	st16.w	[a15],d15
;  480 |  CAN_MSGFGCR20  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 480
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x598
	st16.w	[a15],d15
;  481 |
;  482 |  ///  -----------------------------------------------------------------------
;  483 |  ///  Configuration of Message Object 21:
;  484 |  ///  -----------------------------------------------------------------------
;  485 |  ///  - message object 21 is not valid
;  486 |
;  487 |  CAN_MSGCTR21   =  0x00005555;  // load message control register
	.symb	LINE, 487
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5b0
	st16.w	[a15],d15
;  488 |  CAN_MSGFGCR21  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 488
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5b8
	st16.w	[a15],d15
;  489 |
;  490 |  ///  -----------------------------------------------------------------------
;  491 |  ///  Configuration of Message Object 22:
;  492 |  ///  -----------------------------------------------------------------------
;  493 |  ///  - message object 22 is not valid
;  494 |
;  495 |  CAN_MSGCTR22   =  0x00005555;  // load message control register
	.symb	LINE, 495
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5d0
	st16.w	[a15],d15
;  496 |  CAN_MSGFGCR22  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 496
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5d8
	st16.w	[a15],d15
;  497 |
;  498 |  ///  -----------------------------------------------------------------------
;  499 |  ///  Configuration of Message Object 23:
;  500 |  ///  -----------------------------------------------------------------------
;  501 |  ///  - message object 23 is not valid
;  502 |
;  503 |  CAN_MSGCTR23   =  0x00005555;  // load message control register
	.symb	LINE, 503
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5f0
	st16.w	[a15],d15
;  504 |  CAN_MSGFGCR23  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 504
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x5f8
	st16.w	[a15],d15
;  505 |
;  506 |  ///  -----------------------------------------------------------------------
;  507 |  ///  Configuration of Message Object 24:
;  508 |  ///  -----------------------------------------------------------------------
;  509 |  ///  - message object 24 is not valid
;  510 |
;  511 |  CAN_MSGCTR24   =  0x00005555;  // load message control register
	.symb	LINE, 511
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x610
	st16.w	[a15],d15
;  512 |  CAN_MSGFGCR24  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 512
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x618
	st16.w	[a15],d15
;  513 |
;  514 |  ///  -----------------------------------------------------------------------
;  515 |  ///  Configuration of Message Object 25:
;  516 |  ///  -----------------------------------------------------------------------
;  517 |  ///  - message object 25 is not valid
;  518 |
;  519 |  CAN_MSGCTR25   =  0x00005555;  // load message control register
	.symb	LINE, 519
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x630
	st16.w	[a15],d15
;  520 |  CAN_MSGFGCR25  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 520
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x638
	st16.w	[a15],d15
;  521 |
;  522 |  ///  -----------------------------------------------------------------------
;  523 |  ///  Configuration of Message Object 26:
;  524 |  ///  -----------------------------------------------------------------------
;  525 |  ///  - message object 26 is not valid
;  526 |
;  527 |  CAN_MSGCTR26   =  0x00005555;  // load message control register
	.symb	LINE, 527
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x650
	st16.w	[a15],d15
;  528 |  CAN_MSGFGCR26  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 528
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x658
	st16.w	[a15],d15
;  529 |
;  530 |  ///  -----------------------------------------------------------------------
;  531 |  ///  Configuration of Message Object 27:
;  532 |  ///  -----------------------------------------------------------------------
;  533 |  ///  - message object 27 is not valid
;  534 |
;  535 |  CAN_MSGCTR27   =  0x00005555;  // load message control register
	.symb	LINE, 535
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x670
	st16.w	[a15],d15
;  536 |  CAN_MSGFGCR27  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 536
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x678
	st16.w	[a15],d15
;  537 |
;  538 |  ///  -----------------------------------------------------------------------
;  539 |  ///  Configuration of Message Object 28:
;  540 |  ///  -----------------------------------------------------------------------
;  541 |  ///  - message object 28 is not valid
;  542 |
;  543 |  CAN_MSGCTR28   =  0x00005555;  // load message control register
	.symb	LINE, 543
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x690
	st16.w	[a15],d15
;  544 |  CAN_MSGFGCR28  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 544
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x698
	st16.w	[a15],d15
;  545 |
;  546 |  ///  -----------------------------------------------------------------------
;  547 |  ///  Configuration of Message Object 29:
;  548 |  ///  -----------------------------------------------------------------------
;  549 |  ///  - message object 29 is not valid
;  550 |
;  551 |  CAN_MSGCTR29   =  0x00005555;  // load message control register
	.symb	LINE, 551
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6b0
	st16.w	[a15],d15
;  552 |  CAN_MSGFGCR29  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 552
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6b8
	st16.w	[a15],d15
;  553 |
;  554 |  ///  -----------------------------------------------------------------------
;  555 |  ///  Configuration of Message Object 30:
;  556 |  ///  -----------------------------------------------------------------------
;  557 |  ///  - message object 30 is not valid
;  558 |
;  559 |  CAN_MSGCTR30   =  0x00005555;  // load message control register
	.symb	LINE, 559
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6d0
	st16.w	[a15],d15
;  560 |  CAN_MSGFGCR30  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 560
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6d8
	st16.w	[a15],d15
;  561 |
;  562 |  ///  -----------------------------------------------------------------------
;  563 |  ///  Configuration of Message Object 31:
;  564 |  ///  -----------------------------------------------------------------------
;  565 |  ///  - message object 31 is not valid
;  566 |
;  567 |  CAN_MSGCTR31   =  0x00005555;  // load message control register
	.symb	LINE, 567
	mov	d15,#21845
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6f0
	st16.w	[a15],d15
;  568 |  CAN_MSGFGCR31  =  0x00000000;  // load FIFO/gateway control register
	.symb	LINE, 568
	mov16	d15,#0
	movh.a	a15,#0xf010
	lea	a15,[a15]0x6f8
	st16.w	[a15],d15
;  569 |
;  570 |
;  571 |  ///  -----------------------------------------------------------------------
;  572 |  ///  Configuration of Service Request Nodes 0 - 7:
;  573 |  ///  -----------------------------------------------------------------------
;  574 |  //   -----------------------------------------------------------------------
;  575 |  //   Start the CAN Nodes:
;  576 |  //   -----------------------------------------------------------------------
;  577 |  CAN_ACR       &= ~0x00000041;  // reset INIT and CCE
	.symb	LINE, 577
	movh.a	a15,#0xf010
	lea	a15,[a15]0x200
	ld16.w	d15,[a15]
	mov	d7,#-66				; -66
	and16	d15,d7
	movh.a	a15,#0xf010
	lea	a15,[a15]0x200
	st16.w	[a15],d15
;  578 |  CAN_BCR       &= ~0x00000041;  // reset INIT and CCE
	.symb	LINE, 578
	movh.a	a15,#0xf010
	lea	a15,[a15]0x240
	ld16.w	d15,[a15]
	mov	d7,#-66				; -66
	and16	d15,d7
	movh.a	a15,#0xf010
	lea	a15,[a15]0x240
	st16.w	[a15],d15
;  579 |
;  580 |
;  581 |  // USER CODE BEGIN (Init,3)
;  582 |
;  583 |  // USER CODE END
;  584 |
;  585 |} //  End of function CAN_vInit
	.symb	LINE, 585
	ret16
	.symb	EFUN
;  586 |
;  587 |
;  588 |//****************************************************************************
;  589 |// @Function      void CAN_vGetMsgObj(ubyte ubObjNr, TCAN_SWObj *pstObj) 
;  590 |//
;  591 |//----------------------------------------------------------------------------
;  592 |// @Description   This function fills the forwarded SW message object with 
;  593 |//                the content of the chosen HW message object.
;  594 |//                
;  595 |//                The structure of the SW message object is defined in the 
;  596 |//                header file CAN.H (see TCAN_SWObj).
;  597 |//
;  598 |//----------------------------------------------------------------------------
;  599 |// @Returnvalue   None
;  600 |//
;  601 |//----------------------------------------------------------------------------
;  602 |// @Parameters    ubObjNr: 
;  603 |//                Number of the message object to be read (0-31)
;  604 |// @Parameters    *pstObj: 
;  605 |//                Pointer on a message object to be filled by this function
;  606 |//
;  607 |//----------------------------------------------------------------------------
;  608 |// @Date          12.06.2002
;  609 |//
;  610 |//****************************************************************************
;  611 |
;  612 |// USER CODE BEGIN (GetMsgObj,1)
;  613 |
;  614 |// USER CODE END
;  615 |
;  616 |void CAN_vGetMsgObj(ubyte ubObjNr, TCAN_SWObj *pstObj)
;  617 |{
	.symb	LINE, 617
	.symb	TYPE, 267, 'P', #262
	.symb	TYPE, 265, 'X', 8, #1, 26, 2, #3, #267
	.symb	GFUN, "CAN_vGetMsgObj", CAN_vGetMsgObj, #265, 0, 16, 0
	.symb	ALAB, CAN_vGetMsgObj, #265
CAN_vGetMsgObj:
	.symb	SOFF, 16
	.symb	LTIM, "ubObjNr", 4, 0, 0x8cd
	.symb	LTIM, "pstObj", 20, 0, 0x8cd
	.symb	IDEN, "ubObjNr", 4, #3, 0, 0x80d
	.symb	IDEN, "pstObj", 20, #267, 0, 0x80d
	.symb	IDEN, "i", -8, #3, 131, 0x5
	.symb	LTIM, "pstObj", 20, 0, 0x84d
	.symb	LTIM, "pstObj", -16, 131, 0x8c5
	.symb	LTIM, "ubObjNr", 4, 0, 0x84d
	.symb	LTIM, "ubObjNr", -12, 131, 0x8c5
	nop
	sub16.a	sp,#16
;  618 |  ubyte i;
	.symb	LINE, 618
	st16.a	[sp],a4				; pstObj
	st.b	[sp]4,d4			; ubObjNr
;  619 |
;  620 |  for(i = 0; i < (CAN_HWOBJ[ubObjNr].usMSGCFG & 0x00f0) >> 4; i++)
	.symb	LINE, 620
	mov16	d15,#0				; i
	st16.b	[sp]8,d15			; i
	j	_18
_17:
	.symb	LTIM, "ubObjNr", -12, 131, 0x845
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", -16, 131, 0x845
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
	.symb	LTIM, "pstObj", 23, 0, 0x84d
;  621 |  {
;  622 |    pstObj->ubData[i] = CAN_HWOBJ[ubObjNr].ubData[i];
	.symb	LINE, 622
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld16.bu	d15,[sp]8			; i
	addsc.a	a15,a15,d15,#0
	ld16.bu	d15,[a15]
	ld16.a	a7,[sp]				; pstObj
	ld.bu	d7,[sp]8			; i
	addsc.a	a7,a7,d7,#0
	lea	a7,[a7]10
	st16.b	[a7],d15
	.symb	LINE, 620
	ld16.bu	d15,[sp]8			; i
	add16	d15,#1				; i
	st16.b	[sp]8,d15			; i
_18:
	.symb	LTIM, "ubObjNr", 7, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 7, 0, 0x84d
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
	nop
	ld16.bu	d15,[sp]8			; i
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld.bu	d7,[sp]4			; ubObjNr
	sha16	d7,#5
	addsc.a	a15,a15,d7,#0
	ld.hu	d7,[a15]20
	and	d7,d7,#240
	sha16	d7,#-4
	jlt	d15,d7,_17
;  623 |  }
;  624 |
;  625 |  if(CAN_HWOBJ[ubObjNr].usMSGCFG & 0x04)  // extended identifier
	.symb	LINE, 625
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.hu	d15,[a15]20
	and	d15,d15,#4
	jeq	d15,#0,_19
;  626 |  {
;  627 |    pstObj->uwID   = CAN_HWOBJ[ubObjNr].uwCANAR;
	.symb	LINE, 627
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.w	d15,[a15]8
	ld16.a	a7,[sp]				; pstObj
	st.w	[a7]2,d15			; pstObj
;  628 |    pstObj->uwMask = CAN_HWOBJ[ubObjNr].uwCANAMR;
	.symb	LINE, 628
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.w	d15,[a15]12
	ld16.a	a7,[sp]				; pstObj
	st.w	[a7]6,d15			; pstObj
;  629 |  }
	.symb	LINE, 629
	j	_20
_19:
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
;  630 |  else                                    // standard identifier 
;  631 |  {
;  632 |    pstObj->uwID   = CAN_HWOBJ[ubObjNr].uwCANAR >> 18;
	.symb	LINE, 632
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.w	d15,[a15]8
	sh	d15,d15,#-18
	ld16.a	a7,[sp]				; pstObj
	st.w	[a7]2,d15			; pstObj
;  633 |    pstObj->uwMask = CAN_HWOBJ[ubObjNr].uwCANAMR >> 18;
	.symb	LINE, 633
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.w	d15,[a15]12
	sh	d15,d15,#-18
	ld16.a	a7,[sp]				; pstObj
	st.w	[a7]6,d15			; pstObj
;  634 |  }
	.symb	LINE, 634
_20:
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	LTIM, "pstObj", 23, 0, 0x8cd
;  635 |
;  636 |  pstObj->usCounter = CAN_HWOBJ[ubObjNr].usCounter;
	.symb	LINE, 636
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.hu	d15,[a15]18
	ld16.a	a7,[sp]				; pstObj
	st.h	[a7]18,d15			; pstObj
;  637 |  pstObj->usMsgCfg  = CAN_HWOBJ[ubObjNr].usMSGCFG;
	.symb	LINE, 637
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]4			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.hu	d15,[a15]20
	ld16.a	a7,[sp]				; pstObj
	st16.h	[a7],d15			; pstObj
;  638 |
;  639 |} //  End of function CAN_vGetMsgObj
	.symb	LINE, 639
	ret16
	.symb	LTIM, "pstObj", 23, 0, 0x84d
	.symb	EFUN
;  640 |
;  641 |
;  642 |//****************************************************************************
;  643 |// @Function      ubyte CAN_ubNewData(ubyte ubObjNr) 
;  644 |//
;  645 |//----------------------------------------------------------------------------
;  646 |// @Description   This function checks whether the selected RECEIVE OBJECT 
;  647 |//                has received a new message. If so the function returns the 
;  648 |//                value '1'.
;  649 |//
;  650 |//----------------------------------------------------------------------------
;  651 |// @Returnvalue   1 the message object has received a new message, else 0
;  652 |//
;  653 |//----------------------------------------------------------------------------
;  654 |// @Parameters    ubObjNr: 
;  655 |//                Number of the message object (0-31)
;  656 |//
;  657 |//----------------------------------------------------------------------------
;  658 |// @Date          12.06.2002
;  659 |//
;  660 |//****************************************************************************
;  661 |
;  662 |// USER CODE BEGIN (NewData,1)
;  663 |
;  664 |// USER CODE END
;  665 |
;  666 |ubyte CAN_ubNewData(ubyte ubObjNr)
;  667 |{
	.symb	LINE, 667
	.symb	TYPE, 268, 'X', 8, #3, 26, 1, #3
	.symb	GFUN, "CAN_ubNewData", CAN_ubNewData, #268, 0, 16, 0
	.symb	ALAB, CAN_ubNewData, #268
CAN_ubNewData:
	.symb	SOFF, 16
	.symb	LTIM, "ubObjNr", 4, 0, 0x8cd
	.symb	IDEN, "ubObjNr", 4, #3, 0, 0x80d
	.symb	IDEN, "ubReturn", -12, #3, 131, 0x5
	.symb	LTIM, "ubObjNr", 4, 0, 0x84d
	.symb	LTIM, "ubObjNr", -16, 131, 0x8c5
	.symb	LTIM, "ubObjNr", -16, 131, 0x845
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
;  668 |  ubyte ubReturn;
	.symb	LINE, 668
	st16.b	[sp],d4				; ubObjNr
;  669 |
;  670 |  ubReturn = 0;
	.symb	LINE, 670
	mov16	d15,#0				; ubReturn
	st16.b	[sp]4,d15			; ubReturn
;  671 |  if((CAN_HWOBJ[ubObjNr].usMSGCTR & 0x0300) == 0x0200)  // if NEWDAT
	.symb	LINE, 671
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	ld.hu	d15,[a15]16
	mov	d7,#768				; 768
	and16	d15,d7
	mov	d7,#512				; 512
	jne	d15,d7,_21
;  672 |  {
;  673 |    ubReturn = 1;
	.symb	LINE, 673
	mov16	d15,#1				; ubReturn
	st16.b	[sp]4,d15			; ubReturn
;  674 |  }
	.symb	LINE, 674
_21:
;  675 |  return(ubReturn);
	.symb	LINE, 675
	nop
	ld.bu	d2,[sp]4			; ubReturn
;  676 |
;  677 |} //  End of function CAN_ubNewData
	.symb	LINE, 677
_22:
	ret16
	.symb	EFUN
;  678 |
;  679 |
;  680 |//****************************************************************************
;  681 |// @Function      void CAN_vTransmit(ubyte ubObjNr) 
;  682 |//
;  683 |//----------------------------------------------------------------------------
;  684 |// @Description   This function triggers the CAN controller to send the 
;  685 |//                selected message.
;  686 |//                If the selected message object is a TRANSMIT OBJECT then 
;  687 |//                this function triggers the sending of a data frame. If 
;  688 |//                however the selected message object is a RECEIVE OBJECT 
;  689 |//                this function triggers the sending of a remote frame.
;  690 |//
;  691 |//----------------------------------------------------------------------------
;  692 |// @Returnvalue   None
;  693 |//
;  694 |//----------------------------------------------------------------------------
;  695 |// @Parameters    ubObjNr: 
;  696 |//                Number of the message object (0-31)
;  697 |//
;  698 |//----------------------------------------------------------------------------
;  699 |// @Date          12.06.2002
;  700 |//
;  701 |//****************************************************************************
;  702 |
;  703 |// USER CODE BEGIN (Transmit,1)
;  704 |
;  705 |// USER CODE END
;  706 |
;  707 |void CAN_vTransmit(ubyte ubObjNr)
;  708 |{
	.symb	LINE, 708
	.symb	TYPE, 269, 'X', 8, #1, 26, 1, #3
	.symb	GFUN, "CAN_vTransmit", CAN_vTransmit, #269, 0, 16, 0
	.symb	ALAB, CAN_vTransmit, #269
CAN_vTransmit:
	.symb	SOFF, 16
	.symb	LTIM, "ubObjNr", 4, 0, 0x8cd
	.symb	IDEN, "ubObjNr", 4, #3, 0, 0x80d
	.symb	LTIM, "ubObjNr", 4, 0, 0x84d
	.symb	LTIM, "ubObjNr", -16, 131, 0x8c5
	.symb	LTIM, "ubObjNr", -16, 131, 0x845
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
	st16.b	[sp],d4				; ubObjNr
;  709 |  CAN_HWOBJ[ubObjNr].usMSGCTR = 0xe7ff;  // set TXRQ, reset CPUUPD
	.symb	LINE, 709
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	mov.u	d15,#59391			; 59391
	st.h	[a15]16,d15
;  710 |
;  711 |} //  End of function CAN_vTransmit
	.symb	LINE, 711
	ret16
	.symb	EFUN
;  712 |
;  713 |
;  714 |//****************************************************************************
;  715 |// @Function      void CAN_vReleaseObj(ubyte ubObjNr) 
;  716 |//
;  717 |//----------------------------------------------------------------------------
;  718 |// @Description   This function resets the NEWDAT flag of the selected 
;  719 |//                RECEIVE OBJECT, so that the CAN controller have access to 
;  720 |//                it. This function must be called if the function 
;  721 |//                CAN_ubNewData detects, that new data are present in the 
;  722 |//                message object and the actual data have been read by 
;  723 |//                calling the function CAN_vGetMsgObj. 
;  724 |//
;  725 |//----------------------------------------------------------------------------
;  726 |// @Returnvalue   None
;  727 |//
;  728 |//----------------------------------------------------------------------------
;  729 |// @Parameters    ubObjNr: 
;  730 |//                Number of the message object (0-31)
;  731 |//
;  732 |//----------------------------------------------------------------------------
;  733 |// @Date          12.06.2002
;  734 |//
;  735 |//****************************************************************************
;  736 |
;  737 |// USER CODE BEGIN (ReleaseObj,1)
;  738 |
;  739 |// USER CODE END
;  740 |
;  741 |void CAN_vReleaseObj(ubyte ubObjNr)
;  742 |{
	.symb	LINE, 742
	.symb	TYPE, 270, 'X', 8, #1, 26, 1, #3
	.symb	GFUN, "CAN_vReleaseObj", CAN_vReleaseObj, #270, 0, 16, 0
	.symb	ALAB, CAN_vReleaseObj, #270
CAN_vReleaseObj:
	.symb	SOFF, 16
	.symb	LTIM, "ubObjNr", 4, 0, 0x8cd
	.symb	IDEN, "ubObjNr", 4, #3, 0, 0x80d
	.symb	LTIM, "ubObjNr", 4, 0, 0x84d
	.symb	LTIM, "ubObjNr", -16, 131, 0x8c5
	.symb	LTIM, "ubObjNr", -16, 131, 0x845
	.symb	LTIM, "ubObjNr", 15, 0, 0x8cd
	.symb	LTIM, "ubObjNr", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
	st16.b	[sp],d4				; ubObjNr
;  743 |  CAN_HWOBJ[ubObjNr].usMSGCTR = 0xfdff;       // reset NEWDAT
	.symb	LINE, 743
	movh.a	a15,#0xf010			; -267386112
	lea	a15,[a15]0x300			; -267386112
	ld16.bu	d15,[sp]			; ubObjNr
	sha16	d15,#5
	addsc.a	a15,a15,d15,#0
	mov.u	d15,#65023			; 65023
	st.h	[a15]16,d15
;  744 |
;  745 |} //  End of function CAN_vReleaseObj
	.symb	LINE, 745
	ret16
	.symb	EFUN
;  746 |
;  747 |
;  748 |
;  749 |// USER CODE BEGIN (CAN_General,10)
;  750 |
;  751 |// USER CODE END
;  752 |
	.symb	ENDF
	.symb	TYPE, 271, 'X', 8, #1, 26, 1, #18
	.symb	ALAB, MAIN_vWriteWDTCON0, #271
	.global	CAN_ubNewData
	.global	CAN_vGetMsgObj
	.global	CAN_vInit
	.global	CAN_vReleaseObj
	.global	CAN_vTransmit
	.extern	(CODE) MAIN_vWriteWDTCON0
	.calls	"CAN_vInit", "MAIN_vWriteWDTCON0"
