rport.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef _CFG_RPORT_H_
  2. #define _CFG_RPORT_H_
  3. /*
  4. * Copyright (C) 2004 by Jan Dubiec. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY JAN DUBIEC AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JAN DUBIEC
  23. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * $Log: rport.h,v $
  33. * Revision 1.1 2004/03/16 16:56:21 haraldkipp
  34. * Added Jan Dubiec's H8/300 port.
  35. *
  36. */
  37. /*!
  38. * \file cfg/rport.h
  39. * \brief RPort hardware specification.
  40. */
  41. /*!
  42. * \addtogroup xgRPortCfg
  43. */
  44. /*@{*/
  45. #include <h83068f.h>
  46. /*!
  47. * Low level sensing interrupt; Very important!
  48. * High poriority;
  49. * CKE1-0 in SCR, default setting;
  50. * C/A# in SMR, default setting;
  51. * P95DDR, default setting:
  52. * P9DDR = B_1100_0000;
  53. * SCI1.SMR.BIT.CA = 0;
  54. */
  55. #define NutInitSysIrq() \
  56. INTC.ISCR.BIT.IRQ0SC = 0; \
  57. INTC.IPRA.BIT._IRQ0 = 0;
  58. /**
  59. * IO base address of RTL chip.
  60. */
  61. #define NIC_IO_BASE (0x800000UL + 0x300UL)
  62. /**
  63. * Check Nic Int is set or not
  64. */
  65. #define NicIntIsEnabled() (INTC.IER.BIT.IRQ0E == 1)
  66. /**
  67. * Disable Nic Interruption
  68. */
  69. #define NicDisableInt() INTC.IER.BIT.IRQ0E = 0
  70. /**
  71. * Enable Nic Interruption
  72. */
  73. #define NicEnableInt() INTC.IER.BIT.IRQ0E = 1
  74. /**
  75. * Switch MCU data bus (area 4) into 16 bit mode
  76. */
  77. #define NicMcu16bitBus() BSC.ABWCR.BIT.ABW4 = 0
  78. /**
  79. * Switch MCU data bus (area 4) into 8 bit mode
  80. */
  81. #define NicMcu8bitBus() BSC.ABWCR.BIT.ABW4 = 1
  82. /**
  83. * interruption signal handler of RTL_SIGNAL_BIT.
  84. */
  85. #define RTL_SIGNAL sig_INT0
  86. /*@}*/
  87. #endif /* #ifndef _CFG_RPORT_H_ */