CG_systeminit.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. ** Include files
  22. *******************************************************************************
  23. */
  24. #include "CG_macrodriver.h"
  25. #include "CG_system.h"
  26. #include "CG_port.h"
  27. #include "CG_timer.h"
  28. /* Start user code for include. Do not edit comment generated here */
  29. /* End user code. Do not edit comment generated here */
  30. #include "CG_userdefine.h"
  31. /*
  32. *******************************************************************************
  33. ** Global define
  34. *******************************************************************************
  35. */
  36. /* Start user code for global. Do not edit comment generated here */
  37. /* End user code. Do not edit comment generated here */
  38. UCHAR __low_level_init(void);
  39. void systeminit(void);
  40. /*
  41. **-----------------------------------------------------------------------------
  42. **
  43. ** Abstract:
  44. ** This function initializes each macro.
  45. **
  46. ** Parameters:
  47. ** None
  48. **
  49. ** Returns:
  50. ** None
  51. **
  52. **-----------------------------------------------------------------------------
  53. */
  54. void systeminit(void)
  55. {
  56. DI(); /* disable interrupt */
  57. CG_ReadResetSource();
  58. PORT_Init();
  59. TAB0_Init();
  60. EI(); /* enable interrupt */
  61. }
  62. /*
  63. **-----------------------------------------------------------------------------
  64. **
  65. ** Abstract:
  66. ** This function initializes hardware setting.
  67. **
  68. ** Parameters:
  69. ** None
  70. **
  71. ** Returns:
  72. ** None
  73. **
  74. **-----------------------------------------------------------------------------
  75. */
  76. UCHAR __low_level_init(void)
  77. {
  78. VSWC = 0x13U;
  79. CLOCK_Init(); /* call Clock_Init function */
  80. systeminit();
  81. return MD_TRUE;
  82. }
  83. /* Start user code for adding. Do not edit comment generated here */
  84. /* End user code. Do not edit comment generated here */