NetBurner 3.5.6
PDF Version
IEEE1588Timer Class Reference

#include <IEEE1588Timer.h>

Public Member Functions

bool init ()
 
uint32_t getCurrentTime (EthernetVars &ev)
 
void enablePPSCapture ()
 
void markValidTime (uint8_t index, uint32_t ntpTime)
 
uint32_t getConsecutiveValidSeconds () const
 
void updateConsecutiveSeconds (uint32_t currentTimeTick)
 
void resetConsecutiveSeconds ()
 
uint32_t getPPSLoop () const
 
uint32_t getPPSCapture (uint8_t index) const
 

Static Public Member Functions

static void PPS_1588_TimeCapIsr ()
 
static uint32_t ring_diff_forward (uint32_t a, uint32_t b)
 

Detailed Description

IEEE1588Timer class - Encapsulates 1588 timer functionality for GPS PPS synchronization

This class manages the hardware 1588 timer on the ethernet controller for precise time synchronization with GPS PPS signals. It provides methods to:

  • Initialize the 1588 timer hardware
  • Capture PPS edges with precise timestamps
  • Track GPS time synchronization validity
  • Calculate precise NTP timestamps

Member Function Documentation

◆ enablePPSCapture()

void IEEE1588Timer::enablePPSCapture ( )

Enable PPS capture on channel 2 Configures interrupt handling for PPS edge detection

◆ getConsecutiveValidSeconds()

uint32_t IEEE1588Timer::getConsecutiveValidSeconds ( ) const
inline

Get count of consecutive valid GPS seconds

Returns
Number of consecutive seconds with valid GPS time

◆ getCurrentTime()

uint32_t IEEE1588Timer::getCurrentTime ( EthernetVars & ev)

Get current 1588 timer value

Parameters
evReference to ethernet variables structure
Returns
Current 1588 timer count

◆ getPPSCapture()

uint32_t IEEE1588Timer::getPPSCapture ( uint8_t index) const
inline

Access PPS capture arrays for timestamp calculation These methods provide read-only access to internal arrays for use by NtpTimeStamp::SetFrom method

◆ getPPSLoop()

uint32_t IEEE1588Timer::getPPSLoop ( ) const
inline

Get current PPS loop index

Returns
Current ring buffer write index

◆ init()

bool IEEE1588Timer::init ( )

Initialize the 1588 timer hardware Sets up the timer with proper clock source and enables PPS capture

Returns
true if initialization successful, false on error

◆ markValidTime()

void IEEE1588Timer::markValidTime ( uint8_t index,
uint32_t ntpTime )

Mark a GPS time as valid for a specific PPS capture Called by GPS processing when GPRMC message provides valid time

Parameters
indexRing buffer index for the PPS capture
ntpTimeNTP timestamp corresponding to this PPS

◆ PPS_1588_TimeCapIsr()

void IEEE1588Timer::PPS_1588_TimeCapIsr ( )
static

Static ISR handler for PPS capture interrupt This must be static to be used as C-style function pointer

◆ resetConsecutiveSeconds()

void IEEE1588Timer::resetConsecutiveSeconds ( )
inline

Reset consecutive seconds tracking Called when GPS synchronization is lost

◆ ring_diff_forward()

static uint32_t IEEE1588Timer::ring_diff_forward ( uint32_t a,
uint32_t b )
inlinestatic

Utility functions for ring buffer arithmetic These are used for calculating time differences in wrap-around scenarios

◆ updateConsecutiveSeconds()

void IEEE1588Timer::updateConsecutiveSeconds ( uint32_t currentTimeTick)

Update consecutive seconds tracking Called when new valid GPS time is received

Parameters
currentTimeTickCurrent OS tick count

The documentation for this class was generated from the following files: