Always-On Timer Device Interface Functions More...
#include <stdbool.h>
#include <stdint.h>
#include "sw/device/lib/base/macros.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/device/lib/dif/dif_base.h"
#include "sw/device/lib/dif/autogen/dif_aon_timer_autogen.h"
Go to the source code of this file.
Always-On Timer Device Interface Functions
Definition in file dif_aon_timer.h.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_clear_wakeup_cause | ( | const dif_aon_timer_t * | aon | ) |
Clear Always-On Timer wakeup cause.
Clears WKUP_CAUSE register
aon | An Always-On Timer handle. |
Definition at line 119 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_wakeup_get_count | ( | const dif_aon_timer_t * | aon, |
uint32_t * | count | ||
) |
Retrieves Always-On Timer (wake-up timer) tick count.
aon | An Always-On Timer handle. | |
[out] | count | Current timer tick count. |
Definition at line 127 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_wakeup_is_enabled | ( | const dif_aon_timer_t * | aon, |
bool * | is_enabled | ||
) |
Checks whether this Always-On Timer (wake-up timer) is enabled.
aon | An Always-On Timer handle. | |
[out] | is_enabled | Out-param for the enabled state. |
Definition at line 105 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_wakeup_restart | ( | const dif_aon_timer_t * | aon | ) |
Restarts Always-On Timer (wake-up timer).
Clears the counter and restarts the timer using the existing configuration.
aon | An Always-On Timer handle. |
Definition at line 94 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_wakeup_start | ( | const dif_aon_timer_t * | aon, |
uint32_t | threshold, | ||
uint32_t | prescaler | ||
) |
Starts Always-On Timer (wake-up timer).
This operation starts the wake-up timer with the provided configuration. Note that the timer is stopped and counter cleared, before the timer is started with the new configuration.
aon | An Always-On Timer handle. |
threshold | Threshold in ticks. |
prescaler | 12 bit pre-scaler to enable very long timeouts (one tick every N + 1 clock cycles, where N is the pre-scaler value). |
Definition at line 60 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_wakeup_stop | ( | const dif_aon_timer_t * | aon | ) |
Stops Always-On Timer (wake-up timer).
Stops the timer. Configuration is not touched, and can be restarted via dif_aon_timer_wakeup_restart
.
aon | An Always-On Timer handle. |
Definition at line 84 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_get_count | ( | const dif_aon_timer_t * | aon, |
uint32_t * | count | ||
) |
Retrieves Always-On Timer (watchdog timer) tick count.
aon | An Always-On Timer handle. | |
[out] | count | Current timer tick count. |
Definition at line 220 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_is_enabled | ( | const dif_aon_timer_t * | aon, |
bool * | is_enabled | ||
) |
Checks whether this Always-On Timer (watchdog timer) is enabled.
aon | An Always-On Timer handle. | |
[out] | is_enabled | Out-param for the enabled state. |
Definition at line 206 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_is_locked | ( | const dif_aon_timer_t * | aon, |
bool * | is_locked | ||
) |
Checks whether this Always-On Timer (watchdog timer) is locked.
aon | An Always-On Timer handle. | |
[out] | is_locked | Out-param for the locked state. |
Definition at line 251 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_lock | ( | const dif_aon_timer_t * | aon | ) |
Locks Always-On Timer (watchdog timer).
The watchdog configuration will be locked until the next reset. This means that this timer cannot be stopped, restarted or reconfigured, however the count can be cleared via dif_aon_timer_watchdog_pet
.
aon | An Always-On Timer handle. |
Definition at line 241 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_pet | ( | const dif_aon_timer_t * | aon | ) |
Clears Always-On Timer (watchdog timer).
This function must be called periodically to satisfy "Bite" and "Bark" thresholds. The semantics of this function are similar to dif_aon_timer_watchdog_restart
, however it does not write to the control register, and is guaranteed to succeed even when the watchdog is locked.
aon | An Always-On Timer handle. |
Definition at line 231 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_restart | ( | const dif_aon_timer_t * | aon | ) |
Restarts Always-On Timer (watchdog timer).
Clears the counter and restarts the timer using the existing configuration.
aon | An Always-On Timer handle. |
Definition at line 191 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_start | ( | const dif_aon_timer_t * | aon, |
uint32_t | bark_threshold, | ||
uint32_t | bite_threshold, | ||
bool | pause_in_sleep, | ||
bool | lock | ||
) |
Starts Always-On Timer (watchdog timer).
This operation starts the watchdog timer with the provided configuration. Note that the timer is stopped and counter cleared, before the timer is started with the new configuration.
aon | An Always-On Timer handle. |
bark_threshold | "Bark" threshold in ticks. |
bite_threshold | "Bite" threshold in ticks. |
pause_in_sleep | Watchdog is paused when device is in one of the low power modes. |
lock | Lock access to watchdog configuration registers. |
Definition at line 138 of file dif_aon_timer.c.
OT_WARN_UNUSED_RESULT dif_result_t dif_aon_timer_watchdog_stop | ( | const dif_aon_timer_t * | aon | ) |
Stops Always-On Timer (watchdog timer).
Stops the timer. Configuration is not touched, and can be restarted via dif_aon_timer_watchdog_restart
.
aon | An Always-On Timer handle. |
Definition at line 177 of file dif_aon_timer.c.