CG_port.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_port.c
  12. * Abstract: This file implements device driver for PORT module.
  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_port.h"
  26. /* Start user code for include. Do not edit comment generated here */
  27. /* End user code. Do not edit comment generated here */
  28. #include "CG_userdefine.h"
  29. /*
  30. *******************************************************************************
  31. ** Global define
  32. *******************************************************************************
  33. */
  34. /* Start user code for global. Do not edit comment generated here */
  35. /* End user code. Do not edit comment generated here */
  36. /*
  37. **-----------------------------------------------------------------------------
  38. **
  39. ** Abstract:
  40. ** This function initializes setting for Port I/O.
  41. **
  42. ** Parameters:
  43. ** None
  44. **
  45. ** Returns:
  46. ** None
  47. **
  48. **-----------------------------------------------------------------------------
  49. */
  50. void PORT_Init(void)
  51. {
  52. PDLH = _10_Pn4_OUTPUT_1;
  53. PMDLH = _01_PMn0_MODE_UNUSED | _02_PMn1_MODE_UNUSED | _04_PMn2_MODE_UNUSED | _08_PMn3_MODE_UNUSED | _00_PMn4_MODE_OUTPUT | _20_PMn5_MODE_UNUSED | _40_PMn6_MODE_UNUSED | _80_PMn7_MODE_UNUSED;
  54. PMCDLH = _00_PMCn4_OPER_PORT;
  55. }
  56. void led_on(void)
  57. {
  58. PDLH = _10_Pn4_OUTPUT_1;
  59. }
  60. void led_off(void)
  61. {
  62. PDLH = _00_Pn4_OUTPUT_0;
  63. }
  64. /* Start user code for adding. Do not edit comment generated here */
  65. /* End user code. Do not edit comment generated here */