hal_sio.dox 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 SIO SIO Driver
  15. * @brief Generic SIO Driver.
  16. * @details This driver abstracts a generic serial communication channel,
  17. * usually an UART, this driver is similar to Serial and UART drivers
  18. * but follows a different concept:
  19. * - Very close to HW.
  20. * - No buffering done in SW, the driver relies on the peripheral
  21. * internal FIFO, if any.
  22. * - Asynchronous, the API is always non blocking.
  23. * - Callbacks capable, operations completion and other events are
  24. * notified using callbacks.
  25. * - Very short code paths, especially in ISRs.
  26. * .
  27. * @pre In order to use the SIO driver the @p HAL_USE_SIO option
  28. * must be enabled in @p halconf.h.
  29. *
  30. * @section sio_1 Driver State Machine
  31. * The driver implements a state machine internally, not all the driver
  32. * functionalities can be used in any moment, any transition not explicitly
  33. * shown in the following diagram has to be considered an error and shall
  34. * be captured by an assertion (if enabled).
  35. * @dot
  36. digraph example {
  37. rankdir="LR";
  38. node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
  39. edge [fontname=Helvetica, fontsize=8];
  40. uninit [label="SIO_UNINIT", style="bold"];
  41. stop [label="SIO_STOP\nLow Power"];
  42. ready [label="SIO_READY\nClock Enabled"];
  43. uninit -> stop [label="\nsioInit()"];
  44. stop -> ready [label="\nsioStart()"];
  45. ready -> ready [label="\nsioStart()"];
  46. ready -> stop [label="\nsioStop()"];
  47. stop -> stop [label="\nsioStop()"];
  48. }
  49. * @enddot
  50. *
  51. * @ingroup HAL_NORMAL_DRIVERS
  52. */