ace.c 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. *
  32. */
  33. /*!
  34. * \file arch/avr/dev/ace.c
  35. * \brief AVR TLC16C550 ACE devices.
  36. *
  37. * \verbatim
  38. * $Id: ace.c 5472 2013-12-06 00:16:28Z olereinhardt $
  39. * \endverbatim
  40. */
  41. #include <dev/tlc16c550.h>
  42. /*!
  43. * \addtogroup xgNutArchAvrAce
  44. */
  45. /*@{*/
  46. static ACEDCB dcb_ace0;
  47. static IFSTREAM ifs_ace0;
  48. /*!
  49. * \brief ACE 0 Device information structure.
  50. *
  51. * \note The interrupt handler of this driver uses a significant amount
  52. * of stack space, which may require to increase thread stacks
  53. * of all running threads. Furthermore, it requires quite some
  54. * time to execute and may degrade overall system performance.
  55. */
  56. NUTDEVICE devAce0 = {
  57. 0, /*!< Pointer to next device. */
  58. {'a', 'c', 'e', '0', 0, 0, 0, 0, 0}, /*!< Unique device name. */
  59. IFTYP_STREAM, /*!< Type of device. */
  60. 0x8c00, /*!< Base address. */
  61. 4, /*!< First interrupt number. */
  62. &ifs_ace0, /*!< Interface control block. */
  63. &dcb_ace0, /*!< Driver control block. */
  64. AceInit, /*!< Driver initialization routine. */
  65. AceIOCtl, /*!< Driver specific control function. */
  66. AceRead, /*!< Read from device. */
  67. AceWrite, /*!< Write to device. */
  68. AceWrite_P, /*!< Write to device from program space. */
  69. AceOpen, /*!< Open a device or file. */
  70. AceClose, /*!< Close a device or file. */
  71. AceSize, /*!< Request file size. */
  72. NULL, /*!< Select function, optional, not yet implemented */
  73. };
  74. static ACEDCB dcb_ace1;
  75. static IFSTREAM ifs_ace1;
  76. /*!
  77. * \brief ACE 1 Device information structure.
  78. *
  79. * \note See \ref devAce0.
  80. */
  81. NUTDEVICE devAce1 = {
  82. 0, /*!< Pointer to next device. */
  83. {'a', 'c', 'e', '1', 0, 0, 0, 0, 0}, /*!< Unique device name. */
  84. IFTYP_STREAM, /*!< Type of device. */
  85. 0x8c08, /*!< Base address. */
  86. 4, /*!< First interrupt number. */
  87. &ifs_ace1, /*!< Interface control block. */
  88. &dcb_ace1, /*!< Driver control block. */
  89. AceInit, /*!< Driver initialization routine. */
  90. AceIOCtl, /*!< Driver specific control function. */
  91. AceRead, /*!< Read from device. */
  92. AceWrite, /*!< Write to device. */
  93. AceWrite_P, /*!< Write to device from program space. */
  94. AceOpen, /*!< Open a device or file. */
  95. AceClose, /*!< Close a device or file. */
  96. AceSize, /*!< Request file size. */
  97. NULL, /*!< Select function, optional, not yet implemented */
  98. };
  99. static ACEDCB dcb_ace2;
  100. static IFSTREAM ifs_ace2;
  101. /*!
  102. * \brief ACE 2 Device information structure.
  103. *
  104. * \note See \ref devAce0.
  105. */
  106. NUTDEVICE devAce2 = {
  107. 0, /*!< Pointer to next device. */
  108. {'a', 'c', 'e', '2', 0, 0, 0, 0, 0}, /*!< Unique device name. */
  109. IFTYP_STREAM, /*!< Type of device. */
  110. 0x8c10, /*!< Base address. */
  111. 4, /*!< First interrupt number. */
  112. &ifs_ace2, /*!< Interface control block. */
  113. &dcb_ace2, /*!< Driver control block. */
  114. AceInit, /*!< Driver initialization routine. */
  115. AceIOCtl, /*!< Driver specific control function. */
  116. AceRead, /*!< Read from device. */
  117. AceWrite, /*!< Write to device. */
  118. AceWrite_P, /*!< Write to device from program space. */
  119. AceOpen, /*!< Open a device or file. */
  120. AceClose, /*!< Close a device or file. */
  121. AceSize, /*!< Request file size. */
  122. NULL, /*!< Select function, optional, not yet implemented */
  123. };
  124. static ACEDCB dcb_ace3;
  125. static IFSTREAM ifs_ace3;
  126. /*!
  127. * \brief ACE 3 Device information structure.
  128. *
  129. * \note See \ref devAce0.
  130. */
  131. NUTDEVICE devAce3 = {
  132. 0, /*!< Pointer to next device. */
  133. {'a', 'c', 'e', '3', 0, 0, 0, 0, 0}, /*!< Unique device name. */
  134. IFTYP_STREAM, /*!< Type of device. */
  135. 0x8c18, /*!< Base address. */
  136. 4, /*!< First interrupt number. */
  137. &ifs_ace3, /*!< Interface control block. */
  138. &dcb_ace3, /*!< Driver control block. */
  139. AceInit, /*!< Driver initialization routine. */
  140. AceIOCtl, /*!< Driver specific control function. */
  141. AceRead, /*!< Read from device. */
  142. AceWrite, /*!< Write to device. */
  143. AceWrite_P, /*!< Write to device from program space. */
  144. AceOpen, /*!< Open a device or file. */
  145. AceClose, /*!< Close a device or file. */
  146. AceSize, /*!< Request file size. */
  147. };
  148. /*@}*/