hal_ioblock.dox 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @defgroup IO_BLOCK Abstract I/O Block Device
  15. * @ingroup HAL_BLOCKS
  16. *
  17. * @section io_block_1 Driver State Machine
  18. * The drivers implementing this interface shall implement the following
  19. * state machine internally. Not all the driver functionalities can be used
  20. * in any moment, any transition not explicitly shown in the following
  21. * diagram has to be considered an error and shall be captured by an
  22. * assertion (if enabled).
  23. * @if LATEX_PDF
  24. * @dot
  25. digraph example {
  26. size="5, 7";
  27. rankdir="LR";
  28. node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
  29. edge [fontname=Sans, fontsize=8];
  30. stop [label="BLK_STOP\nLow Power"];
  31. uninit [label="BLK_UNINIT", style="bold"];
  32. active [label="BLK_ACTIVE\nClock Enabled"];
  33. connecting [label="BLK_CONN.ING\nConnecting"];
  34. disconnecting [label="BLK_DISC.ING\nDisconnecting"];
  35. ready [label="BLK_READY\nCard Ready"];
  36. reading [label="BLK_READING\nReading"];
  37. writing [label="BLK_WRITING\nWriting"];
  38. uninit -> stop [label=" blkInit()", constraint=false];
  39. stop -> stop [label="\nblkStop()"];
  40. stop -> active [label="\nblkStart()"];
  41. active -> stop [label="\nblkStop()"];
  42. active -> active [label="\nblkStart()\nblkDisconnect()"];
  43. active -> connecting [label="\nblkConnect()"];
  44. connecting -> ready [label="\nconnection\nsuccessful"];
  45. connecting -> ready [label="\nblkConnect()", dir="back"];
  46. connecting -> active [label="\nconnection\nfailed"];
  47. disconnecting -> ready [label="\nblkDisconnect()", dir="back"];
  48. active -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
  49. ready -> reading [label="\nblkRead()"];
  50. reading -> ready [label="\nread finished\nread error"];
  51. ready -> writing [label="\nblkWrite()"];
  52. writing -> ready [label="\nwrite finished\nwrite error"];
  53. }
  54. * @enddot
  55. * @else
  56. * @dot
  57. digraph example {
  58. rankdir="LR";
  59. node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
  60. edge [fontname=Sans, fontsize=8];
  61. stop [label="BLK_STOP\nLow Power"];
  62. uninit [label="BLK_UNINIT", style="bold"];
  63. active [label="BLK_ACTIVE\nClock Enabled"];
  64. connecting [label="BLK_CONN.ING\nConnecting"];
  65. disconnecting [label="BLK_DISC.ING\nDisconnecting"];
  66. ready [label="BLK_READY\nCard Ready"];
  67. reading [label="BLK_READING\nReading"];
  68. writing [label="BLK_WRITING\nWriting"];
  69. syncing [label="BLK_SYNCING\nSynchronizing"];
  70. uninit -> stop [label=" blkInit()", constraint=false];
  71. stop -> stop [label="\nblkStop()"];
  72. stop -> active [label="\nblkStart()"];
  73. active -> stop [label="\nblkStop()"];
  74. active -> active [label="\nblkStart()\nblkDisconnect()"];
  75. active -> connecting [label="\nblkConnect()"];
  76. connecting -> ready [label="\nconnection\nsuccessful"];
  77. connecting -> ready [label="\nblkConnect()", dir="back"];
  78. connecting -> active [label="\nconnection\nfailed"];
  79. disconnecting -> ready [label="\nblkDisconnect()", dir="back"];
  80. active -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
  81. ready -> reading [label="\nblkRead()"];
  82. reading -> ready [label="\nread finished\nread error"];
  83. ready -> writing [label="\nblkWrite()"];
  84. writing -> ready [label="\nwrite finished\nwrite error"];
  85. ready -> syncing [label="\nblkSync()"];
  86. syncing -> ready [label="\nsynchronization finished"];
  87. }
  88. * @enddot
  89. * @endif
  90. */