1.4.3.7 PAL_PLC_GetPhyTime Function
C
uint32_t PAL_PLC_GetPhyTime(PAL_PLC_HANDLE handle);
Summary
Gets the internal timer reference from PLC transceiver in microseconds.
Description
The PLC transceiver has an internal 32-bit counter which is used as time reference for all time calculations in the PLC PHY layer. This counter is internally configured to be increased each microsecond. This function allows to use this counter as an accurate time reference for upper layers.
Precondition
PAL_PLC_HandleGet must have been called to obtain a valid PLC PAL handle.
Parameters
Param | Description |
---|---|
handle | A valid handle, returned from PAL_PLC_HandleGet. |
Returns
Internal timer reference from PLC transceiver in microseconds.
Example
// 'palPlcHandle', returned from the PAL_PLC_HandleGet uint32_t plcTimerRef; plcTimerRef = PAL_PLC_GetPhyTime(palPlcHandle);
Remarks
This function requires an SPI transaction to retrieve the time from the PLC transceiver, so potential jitter in different SPI accesses may impact the accuracy.