Module to declare MAC Time API.
More...
|
#define | MAC_TIME_MASK 0xFFFFFFULL |
| This mask shall always be used after any mathematical operation on mac_time_t to avoid overflow.
|
|
|
typedef uint32_t | mac_time_t |
| Type of MAC time in symbols.
|
|
typedef uint32_t | mac_timestamp_t |
| Type is used to save timestamps with microsecond precision.
|
|
Module to declare MAC Time API.
The MAC Time module declares some useful macros/types and routines that deal with the MAC timer. More specifically, some convertion routines such as mac_timestamp_from_systime(), mac_time_from_us(), and mac_time_to_us() are declared here.
Converts microseconds to symbol time.
Symbol time is measured in PHY Symbol Periods (16 us).
- Parameters
-
[in] | time_us | Time in microseconds. |
- Returns
- Time in PHY Symbol Periods (16 us).
Converts symbol time to microseconds.
Symbol time is measured in PHY Symbol Periods (16 us).
- Parameters
-
[in] | time_symbol | Time in PHY Symbol Periods (16 us). |
- Returns
- Time in microseconds.
static void mac_timer_critical_start |
( |
sys_time_t |
interval_us, |
|
|
void(*)(void) |
callback |
|
) |
| |
|
inlinestatic |
Starts the critical MAC timer.
The callback function of the critical MAC timer will be called from the timer's interrupt routine. Only one critical MAC timer can run at the same time.
- Warning
- This is internal MAC functionality, needed for the realtime channel access. This function must not be used by other modules.
- Parameters
-
[in] | interval_us | Interval in microseconds, after which the callback function will be called. |
[in] | callback | Callback function to be called after the specified inteval. |
static void mac_timer_critical_stop |
( |
void |
| ) |
|
|
inlinestatic |
Stops the critical MAC timer.
After critical MAC timer is stopped with this function, its callback will not be called.
- Warning
- This is internal MAC functionality, needed for the realtime channel access. This function must not be used by other modules.
Gets timestamp from system time.
- Parameters
-
- Returns
- Time in us but smaller type size.