![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
Go to the source code of this file.
Macros | |
#define | LOG_INTERVAL_LOOKUP_OFFSET (6) |
Index associated with the 1s logarithmic interval. | |
Functions | |
uint16_t | ptp_logi2ms (int8_t logi) |
int8_t | ptp_ms2logi (uint16_t ms) |
uint64_t | FLEXPTP_ntohll (uint64_t in) |
uint64_t | FLEXPTP_htonll (uint64_t in) |
Variables | |
static uint16_t | sLogIntervalMs [] = { 15, 31, 62, 125, 250, 500, 1000, 2000, 4000, 8000, 0 } |
#define LOG_INTERVAL_LOOKUP_OFFSET (6) |
Index associated with the 1s logarithmic interval.
Definition at line 6 of file format_utils.c.
uint64_t FLEXPTP_htonll | ( | uint64_t | in | ) |
Function to swap byte order, convert LE representation to BE. The naming complies with other flexPTP host->network conversion function namings.
in | value in BE representation |
Definition at line 35 of file format_utils.c.
uint64_t FLEXPTP_ntohll | ( | uint64_t | in | ) |
Function to swap byte order, convert BE representation to LE. The naming complies with other flexPTP network->host conversion function namings.
in | value in BE representation |
Definition at line 30 of file format_utils.c.
uint16_t ptp_logi2ms | ( | int8_t | logi | ) |
Convert logarithmic interval designator code to a milliseconds value. Input must be in the inclusive range of [-6, 3].
The function emulates the execution of the following computation: 2^(n) * 1000
logi | PTP-defined logarithmic interval code |
Definition at line 14 of file format_utils.c.
int8_t ptp_ms2logi | ( | uint16_t | ms | ) |
Convert millisecond period value to PTP-defined logarithmic interval designator code. Input must be a value from the following set: (15, 31, 62, 125, 250, 500, 1000, 2000, 4000, 8000).
This function mimics the following computation: round(log2(T/1000))
ms | period in milliseconds. Values of above valid input set must be respected. |
Definition at line 19 of file format_utils.c.
|
static |
Lookup table for log msg. period to ms conversion (ms values are floor-rounded).
Definition at line 11 of file format_utils.c.