hal_serial.dox 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 SERIAL Serial Driver
  15. * @brief Generic Serial Driver.
  16. * @details This module implements a generic full duplex serial driver. The
  17. * driver implements a @p SerialDriver interface and uses I/O Queues
  18. * for communication between the upper and the lower driver. Event
  19. * flags are used to notify the application about incoming data,
  20. * outgoing data and other I/O events.<br>
  21. * The module also contains functions that make the implementation
  22. * of the interrupt service routines much easier.
  23. * @pre In order to use the SERIAL driver the @p HAL_USE_SERIAL option
  24. * must be enabled in @p halconf.h.
  25. *
  26. *
  27. * @section serial_1 Driver State Machine
  28. * The driver implements a state machine internally, not all the driver
  29. * functionalities can be used in any moment, any transition not explicitly
  30. * shown in the following diagram has to be considered an error and shall
  31. * be captured by an assertion (if enabled).
  32. * @dot
  33. digraph example {
  34. rankdir="LR";
  35. node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true",
  36. width="0.9", height="0.9"];
  37. edge [fontname=Helvetica, fontsize=8];
  38. uninit [label="SD_UNINIT", style="bold"];
  39. stop [label="SD_STOP\nLow Power"];
  40. ready [label="SD_READY\nClock Enabled"];
  41. uninit -> stop [label=" sdInit()"];
  42. stop -> stop [label="\nsdStop()"];
  43. stop -> ready [label="\nsdStart()"];
  44. ready -> stop [label="\nsdStop()"];
  45. ready -> ready [label="\nsdStart()"];
  46. ready -> ready [label="\nAny I/O operation"];
  47. }
  48. * @enddot
  49. *
  50. * @ingroup HAL_NORMAL_DRIVERS
  51. */