hal_st.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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_st.h
  15. * @brief ST Driver macros and structures.
  16. * @details This header is designed to be include-able without having to
  17. * include other files from the HAL.
  18. *
  19. * @addtogroup ST
  20. * @{
  21. */
  22. #ifndef HAL_ST_H
  23. #define HAL_ST_H
  24. /*===========================================================================*/
  25. /* Driver constants. */
  26. /*===========================================================================*/
  27. /*===========================================================================*/
  28. /* Driver pre-compile time settings. */
  29. /*===========================================================================*/
  30. /*===========================================================================*/
  31. /* Derived constants and error checks. */
  32. /*===========================================================================*/
  33. /*===========================================================================*/
  34. /* Driver data structures and types. */
  35. /*===========================================================================*/
  36. #include "hal_st_lld.h"
  37. /*===========================================================================*/
  38. /* Driver macros. */
  39. /*===========================================================================*/
  40. /**
  41. * @name Macro Functions
  42. * @{
  43. */
  44. /**
  45. * @brief Returns the time counter value.
  46. * @note This functionality is only available in free running mode, the
  47. * behaviour in periodic mode is undefined.
  48. *
  49. * @return The counter value.
  50. *
  51. * @api
  52. */
  53. #define stGetCounter() st_lld_get_counter()
  54. /**
  55. * @brief Determines if the alarm is active.
  56. *
  57. * @return The alarm status.
  58. * @retval false if the alarm is not active.
  59. * @retval true is the alarm is active
  60. *
  61. * @api
  62. */
  63. #define stIsAlarmActive() st_lld_is_alarm_active()
  64. /** @} */
  65. /*===========================================================================*/
  66. /* External declarations. */
  67. /*===========================================================================*/
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. void stInit(void);
  72. void stStartAlarm(systime_t abstime);
  73. void stStopAlarm(void);
  74. void stSetAlarm(systime_t abstime);
  75. systime_t stGetAlarm(void);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* HAL_ST_H */
  80. /** @} */