1 /*
2 *******************************************************************************
3 * Copyright(C) NEC Electronics Corporation 2010
4 * All rights reserved by NEC Electronics Corporation.
5 * This program should be used on your own responsibility.
6 * NEC Electronics Corporation assumes no responsibility for any losses
7 * incurred by customers or third parties arising from the use of this file.
8 *
9 * This device driver was created by Applilet3 for V850ES/Jx3
10 * 32-Bit Single-Chip Microcontrollers
11 * Filename:	CG_systeminit.c
12 * Abstract:	This file implements system initializing function.
13 * APIlib:	Applilet3 for V850ES/Jx3 V2.01 [20 Apr 2010]
14 * Device:	uPD70F3746
15 * Compiler:	IAR Systems ICCV850
16 * Creation date:	6/26/2010
17 *******************************************************************************
18 */
19 
20 /*
21 *******************************************************************************
22 ** Include files
23 *******************************************************************************
24 */
25 #include "CG_macrodriver.h"
26 #include "CG_system.h"
27 #include "CG_port.h"
28 #include "CG_timer.h"
29 /* Start user code for include. Do not edit comment generated here */
30 /* End user code. Do not edit comment generated here */
31 #include "CG_userdefine.h"
32 
33 /*
34 *******************************************************************************
35 **  Global define
36 *******************************************************************************
37 */
38 /* Start user code for global. Do not edit comment generated here */
39 /* End user code. Do not edit comment generated here */
40 
41 UCHAR __low_level_init(void);
42 void systeminit(void);
43 /*
44 **-----------------------------------------------------------------------------
45 **
46 **  Abstract:
47 **	This function initializes each macro.
48 **
49 **  Parameters:
50 **	None
51 **
52 **  Returns:
53 **	None
54 **
55 **-----------------------------------------------------------------------------
56 */
systeminit(void)57 void systeminit(void)
58 {
59 	DI();	/* disable interrupt */
60 	CG_ReadResetSource();
61 	PORT_Init();
62 	TAB0_Init();
63 	EI();	/* enable interrupt */
64 }
65 /*
66 **-----------------------------------------------------------------------------
67 **
68 **  Abstract:
69 **	This function initializes hardware setting.
70 **
71 **  Parameters:
72 **	None
73 **
74 **  Returns:
75 **	None
76 **
77 **-----------------------------------------------------------------------------
78 */
__low_level_init(void)79 UCHAR __low_level_init(void)
80 {
81 	VSWC = 0x13U;
82 	CLOCK_Init();	/* call Clock_Init function */
83 	systeminit();
84 
85 	return MD_TRUE;
86 }
87 
88 /* Start user code for adding. Do not edit comment generated here */
89 /* End user code. Do not edit comment generated here */
90