hal_pal.dox 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 PAL PAL Driver
  15. * @brief I/O Ports Abstraction Layer
  16. * @details This module defines an abstract interface for digital I/O ports.
  17. * Note that most I/O ports functions are just macros. The macros
  18. * have default software implementations that can be redefined in a
  19. * PAL Low Level Driver if the target hardware supports special
  20. * features like, for example, atomic bit set/reset/masking. Please
  21. * refer to the ports specific documentation for details.<br>
  22. * The @ref PAL driver has the advantage to make the access to the I/O
  23. * ports platform independent and still be optimized for the specific
  24. * architectures.<br>
  25. * Note that the PAL Low Level Driver may also offer non standard
  26. * macro and functions in order to support specific features but,
  27. * of course, the use of such interfaces would not be portable.
  28. * Such interfaces shall be marked with the architecture name inside
  29. * the function names.
  30. * @pre In order to use the PAL driver the @p HAL_USE_PAL option
  31. * must be enabled in @p halconf.h.
  32. *
  33. * @section pal_1 Implementation Rules
  34. * In implementing a PAL Low Level Driver there are some rules/behaviors that
  35. * should be respected.
  36. *
  37. * @subsection pal_1_1 Writing on input pads
  38. * The behavior is not specified but there are implementations better than
  39. * others, this is the list of possible implementations, preferred options
  40. * are on top:
  41. * -# The written value is not actually output but latched, should the pads
  42. * be reprogrammed as outputs the value would be in effect.
  43. * -# The write operation is ignored.
  44. * -# The write operation has side effects, as example disabling/enabling
  45. * pull up/down resistors or changing the pad direction. This scenario is
  46. * discouraged, please try to avoid this scenario.
  47. * .
  48. * @subsection pal_1_2 Reading from output pads
  49. * The behavior is not specified but there are implementations better than
  50. * others, this is the list of possible implementations, preferred options
  51. * are on top:
  52. * -# The actual pads states are read (not the output latch).
  53. * -# The output latch value is read (regardless of the actual pads states).
  54. * -# Unspecified, please try to avoid this scenario.
  55. * .
  56. * @subsection pal_1_3 Writing unused or unimplemented port bits
  57. * The behavior is not specified.
  58. *
  59. * @subsection pal_1_4 Reading from unused or unimplemented port bits
  60. * The behavior is not specified.
  61. *
  62. * @subsection pal_1_5 Reading or writing on pins associated to other functionalities
  63. * The behavior is not specified.
  64. *
  65. * @ingroup HAL_NORMAL_DRIVERS
  66. */