hal_sio_lld.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. * @file hal_sio_lld.c
  15. * @brief PLATFORM SIO subsystem low level driver source.
  16. *
  17. * @addtogroup SIO
  18. * @{
  19. */
  20. #include "hal.h"
  21. #if (HAL_USE_SIO == TRUE) || defined(__DOXYGEN__)
  22. /*===========================================================================*/
  23. /* Driver local definitions. */
  24. /*===========================================================================*/
  25. /*===========================================================================*/
  26. /* Driver exported variables. */
  27. /*===========================================================================*/
  28. /**
  29. * @brief SIO1 driver identifier.
  30. */
  31. #if (PLATFORM_SIO_USE_SIO1 == TRUE) || defined(__DOXYGEN__)
  32. SIODriver SIOD1;
  33. #endif
  34. /*===========================================================================*/
  35. /* Driver local variables and types. */
  36. /*===========================================================================*/
  37. /*===========================================================================*/
  38. /* Driver local functions. */
  39. /*===========================================================================*/
  40. /*===========================================================================*/
  41. /* Driver interrupt handlers. */
  42. /*===========================================================================*/
  43. /*===========================================================================*/
  44. /* Driver exported functions. */
  45. /*===========================================================================*/
  46. /**
  47. * @brief Low level SIO driver initialization.
  48. *
  49. * @notapi
  50. */
  51. void sio_lld_init(void) {
  52. #if PLATFORM_SIO_USE_SIO1 == TRUE
  53. /* Driver initialization.*/
  54. sioObjectInit(&SIOD1);
  55. #endif
  56. }
  57. /**
  58. * @brief Configures and activates the SIO peripheral.
  59. *
  60. * @param[in] siop pointer to the @p SIODriver object
  61. *
  62. * @notapi
  63. */
  64. void sio_lld_start(SIODriver *siop) {
  65. if (siop->state == SIO_STOP) {
  66. /* Enables the peripheral.*/
  67. #if PLATFORM_SIO_USE_SIO1 == TRUE
  68. if (&SIOD1 == siop) {
  69. }
  70. #endif
  71. }
  72. /* Configures the peripheral.*/
  73. }
  74. /**
  75. * @brief Deactivates the SIO peripheral.
  76. *
  77. * @param[in] siop pointer to the @p SIODriver object
  78. *
  79. * @notapi
  80. */
  81. void sio_lld_stop(SIODriver *siop) {
  82. if (siop->state == SIO_READY) {
  83. /* Resets the peripheral.*/
  84. /* Disables the peripheral.*/
  85. #if PLATFORM_SIO_USE_SIO1 == TRUE
  86. if (&SIOD1 == siop) {
  87. }
  88. #endif
  89. }
  90. }
  91. /**
  92. * @brief Control operation on a serial port.
  93. *
  94. * @param[in] siop pointer to the @p SIODriver object
  95. * @param[in] operation control operation code
  96. * @param[in,out] arg operation argument
  97. *
  98. * @return The control operation status.
  99. * @retval MSG_OK in case of success.
  100. * @retval MSG_TIMEOUT in case of operation timeout.
  101. * @retval MSG_RESET in case of operation reset.
  102. *
  103. * @notapi
  104. */
  105. msg_t sio_lld_control(SIODriver *siop, unsigned int operation, void *arg) {
  106. (void)siop;
  107. (void)operation;
  108. (void)arg;
  109. return MSG_OK;
  110. }
  111. #endif /* HAL_USE_SIO == TRUE */
  112. /** @} */