esp_ieee802154_timer.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #include "esp_log.h"
  11. #include "esp_err.h"
  12. /**
  13. * @brief Start the IEEE802154 MAC internal timer0.
  14. *
  15. */
  16. void ieee802154_timer0_start(void);
  17. /**
  18. * @brief Stop the IEEE802154 MAC internal timer0.
  19. *
  20. */
  21. void ieee802154_timer0_stop(void);
  22. /**
  23. * @brief Set the overflow threshold to the IEEE802154 MAC internal timer0.
  24. *
  25. * @param[in] value The threshold.
  26. *
  27. * @return
  28. * ESP_OK if the threshold is valid.
  29. * ESP_ERR_INVALID_ARG if the threshold is invalid.
  30. *
  31. */
  32. esp_err_t ieee802154_timer0_set_threshold(uint32_t value);
  33. /**
  34. * @brief Get the current IEEE802154 MAC internal timer0 count.
  35. *
  36. * @return
  37. * The timer0 count.
  38. *
  39. */
  40. uint32_t ieee802154_timer0_get_value(void);
  41. /**
  42. * @brief Start the IEEE802154 MAC internal timer1.
  43. *
  44. */
  45. void ieee802154_timer1_start(void);
  46. /**
  47. * @brief Stop the IEEE802154 MAC internal timer1.
  48. *
  49. */
  50. void ieee802154_timer1_stop(void);
  51. /**
  52. * @brief Set the overflow threshold to the IEEE802154 MAC internal timer1.
  53. *
  54. * @param[in] value The threshold.
  55. *
  56. * @return
  57. * ESP_OK if the threshold is valid.
  58. * ESP_ERR_INVALID_ARG if the threshold is invalid.
  59. *
  60. */
  61. esp_err_t ieee802154_timer1_set_threshold(uint32_t value);
  62. /**
  63. * @brief Get the current IEEE802154 MAC internal timer1 count.
  64. *
  65. * @return
  66. * The timer1 count.
  67. *
  68. */
  69. uint32_t ieee802154_timer1_get_value(void);
  70. #ifdef __cplusplus
  71. }
  72. #endif