|
at24cm0x 1.0
at24cm0x driver library
|
Header file with declarations and macros for systick utility. More...
#include <util/atomic.h>

Go to the source code of this file.
Data Structures | |
| struct | SYSTICK_Timer_t |
| Represents a SysTick software timer instance. More... | |
Typedefs | |
| typedef enum SYSTICK_Timer_Status_t | SYSTICK_Timer_Status |
| Alias for enum SYSTICK_Timer_Status_t representing SysTick timer states. | |
| typedef struct SYSTICK_Timer_t | SYSTICK_Timer |
| Alias for struct SYSTICK_Timer_t representing a SysTick software timer. | |
Enumerations | |
| enum | SYSTICK_Timer_Status_t { SYSTICK_Timer_Running = 0 , SYSTICK_Timer_Expired } |
| Represents the current status of the SysTick timer. More... | |
Functions | |
| void | systick_init (void) |
| Initializes the SysTick timer module. | |
| void | systick_reset (void) |
| Resets the SysTick timer value. | |
| void | systick_tick (void) |
| Increments the SysTick timer tick counter. | |
| unsigned int | systick_current (void) |
| Returns the current SysTick tick counter value. | |
| void | systick_timer_set (SYSTICK_Timer *timer, unsigned int delay_ticks) |
| Sets and starts a SysTick software timer. | |
| SYSTICK_Timer_Status | systick_timer_elapsed (SYSTICK_Timer *timer) |
| Checks whether a SysTick software timer has expired. | |
| unsigned int | systick_timer_remaining (SYSTICK_Timer *timer) |
| Returns the remaining time before a SysTick timer expires. | |
| void | systick_timer_wait (unsigned int ticks) |
| Blocks execution for a specified number of SysTick ticks. | |
| void | systick_timer_wait_ms (unsigned int ms) |
| void | systick_timer_wait_us (unsigned int us) |
| void | systick_timer_cancel (SYSTICK_Timer *timer) |
| Cancels a running SysTick software timer. | |
Header file with declarations and macros for systick utility.
This file provides function prototypes, type definitions, and constants for handling systicks on systems.
| typedef struct SYSTICK_Timer_t SYSTICK_Timer |
Alias for struct SYSTICK_Timer_t representing a SysTick software timer.
| typedef enum SYSTICK_Timer_Status_t SYSTICK_Timer_Status |
Alias for enum SYSTICK_Timer_Status_t representing SysTick timer states.
Represents the current status of the SysTick timer.
This enumeration defines the possible states of the SysTick timer. It indicates whether the timer is still counting down or if it has reached zero (expired).
| Enumerator | |
|---|---|
| SYSTICK_Timer_Running | Timer is currently running. |
| SYSTICK_Timer_Expired | Timer has expired. |
| unsigned int systick_current | ( | void | ) |
Returns the current SysTick tick counter value.
This function reads the current value of the internal SysTick tick counter (systick_tick_value) in an atomic operation to prevent race conditions during concurrent access from interrupts. The returned value represents the elapsed system ticks since the last reset or initialization of the SysTick module.

| void systick_init | ( | void | ) |
Initializes the SysTick timer module.
This function initializes the SysTick timer by resetting its internal state and preparing it for subsequent use. It calls systick_reset() to ensure the timer starts from a known default state.
Typically, this function should be called once during system initialization before any SysTick-based timing operations are performed.

| void systick_reset | ( | void | ) |
Resets the SysTick timer value.
This function clears the internal SysTick tick counter by setting systick_tick_value to zero. It ensures that the timer restarts counting from the beginning, which is useful during initialization or when restarting time measurements.

| void systick_tick | ( | void | ) |
Increments the SysTick timer tick counter.
This function increases the internal systick_tick_value by one. It should be called periodically—typically from the SysTick interrupt service routine—to maintain an accurate system tick counter used for software timing and scheduling operations.
| void systick_timer_cancel | ( | SYSTICK_Timer * | timer | ) |
Cancels a running SysTick software timer.
This function stops a SysTick timer by setting its status to SYSTICK_Timer_Expired, effectively marking it as completed regardless of its current tick count. Once canceled, the timer will be considered expired and will no longer count down or trigger expiration checks.
| [in,out] | timer | Pointer to the SysTick timer instance to cancel. |
| SYSTICK_Timer_Status systick_timer_elapsed | ( | SYSTICK_Timer * | timer | ) |
Checks whether a SysTick software timer has expired.
This function determines if the specified SYSTICK_Timer instance has reached its expiration tick value. If the current SysTick count has passed the timer's expire value, the timer status is updated to SYSTICK_Timer_Expired. Otherwise, the timer remains in the running state.
| [in,out] | timer | Pointer to the SysTick timer instance to check. |


| unsigned int systick_timer_remaining | ( | SYSTICK_Timer * | timer | ) |
Returns the remaining time before a SysTick timer expires.
This function calculates the number of SysTick ticks remaining until the specified SYSTICK_Timer instance reaches its expiration value. If the timer has already expired, its status is updated to SYSTICK_Timer_Expired, and the function returns zero.
| [in,out] | timer | Pointer to the SysTick timer instance to query. |

| void systick_timer_set | ( | SYSTICK_Timer * | timer, |
| unsigned int | delay_ticks ) |
Sets and starts a SysTick software timer.
This function initializes a given SYSTICK_Timer instance by setting its expiration tick value relative to the current SysTick count. The timer is configured to expire after the specified number of delay_ticks and marked as running.
| [in,out] | timer | Pointer to the SysTick timer instance to configure. |
| [in] | delay_ticks | Number of SysTick ticks after which the timer should expire. |


| void systick_timer_wait | ( | unsigned int | ticks | ) |
Blocks execution for a specified number of SysTick ticks.
This function creates a temporary SYSTICK_Timer instance and waits until it expires. The function blocks program execution by polling the timer status in a busy-wait loop, using a NOP instruction for each iteration to prevent compiler optimization and reduce power consumption on some architectures.
| [in] | ticks | The number of SysTick ticks to wait before returning. |

| void systick_timer_wait_ms | ( | unsigned int | ms | ) |

| void systick_timer_wait_us | ( | unsigned int | us | ) |