flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
config.c File Reference
#include "config.h"
#include <stdbool.h>
#include "ptp_core.h"

Go to the source code of this file.

Macros

#define CONFIG_LOG_DEF   (0x01)
 Default logging.
 
#define CONFIG_LOG_INFO   (0x02)
 General info logging.
 
#define CONFIG_LOG_CORR   (0x04)
 Correction field logging.
 
#define CONFIG_LOG_TIMESTAMPS   (0x08)
 Timestamp logging.
 
#define CONFIG_LOG_LOCKED   (0x10)
 Inform the user if the clock diverges or locks.
 
#define CONFIG_LOG_BMCA   (0x20)
 Peek BMCA state changes.
 
#define CONFIG_LOG_ALL   (0x3F)
 All logging options packed.
 

Functions

void ptp_store_config (PtpConfig *pConfig)
 
void ptp_load_config (const PtpConfig *pConfig)
 
void ptp_load_config_from_dump (const void *pDump)
 

Macro Definition Documentation

◆ CONFIG_LOG_ALL

#define CONFIG_LOG_ALL   (0x3F)

All logging options packed.

Definition at line 20 of file config.c.

◆ CONFIG_LOG_BMCA

#define CONFIG_LOG_BMCA   (0x20)

Peek BMCA state changes.

Definition at line 19 of file config.c.

◆ CONFIG_LOG_CORR

#define CONFIG_LOG_CORR   (0x04)

Correction field logging.

Definition at line 16 of file config.c.

◆ CONFIG_LOG_DEF

#define CONFIG_LOG_DEF   (0x01)

Default logging.

Definition at line 14 of file config.c.

◆ CONFIG_LOG_INFO

#define CONFIG_LOG_INFO   (0x02)

General info logging.

Definition at line 15 of file config.c.

◆ CONFIG_LOG_LOCKED

#define CONFIG_LOG_LOCKED   (0x10)

Inform the user if the clock diverges or locks.

Definition at line 18 of file config.c.

◆ CONFIG_LOG_TIMESTAMPS

#define CONFIG_LOG_TIMESTAMPS   (0x08)

Timestamp logging.

Definition at line 17 of file config.c.

Function Documentation

◆ ptp_load_config()

void ptp_load_config ( const PtpConfig pConfig)

Load flexPTP configuration from a PTP config object.

Parameters
pConfigpointer to an existing PtpConfig object, providing the retained configuration

Definition at line 41 of file config.c.

◆ ptp_load_config_from_dump()

void ptp_load_config_from_dump ( const void *  pDump)

Load PTP-engine configuration from binary dump (i.e. from unaligned address)

Parameters
pDumppointer to config dump

Definition at line 78 of file config.c.

◆ ptp_store_config()

void ptp_store_config ( PtpConfig pConfig)

Store flexPTP configuration to an existing location.

Parameters
pConfigpointer to an existing PtpConfig object to where the configuration will be saved

Definition at line 28 of file config.c.