Documentation
¶
Index ¶
- Constants
- type Clock
- func (c *Clock) AdjustTime(t unix.Timex) error
- func (c *Clock) Close()
- func (c *Clock) ConfigurePeriodicOutput(channel uint32, config PeriodicOutputConfig) error
- func (c *Clock) GetAlarms() int
- func (c *Clock) GetCrossTimestampingSupport() bool
- func (c *Clock) GetExternalTimestampChannels() int
- func (c *Clock) GetMaxFrequencyAdjustment() int
- func (c *Clock) GetName() string
- func (c *Clock) GetPin(index int) (*Pin, error)
- func (c *Clock) GetPins() int
- func (c *Clock) GetPpsCallbackSupport() bool
- func (c *Clock) GetProgrammablePeriodicSignals() int
- func (c *Clock) GetSystemOffset(samples int) ([]SystemOffsetMeasurement, error)
- func (c *Clock) GetSystemOffsetExtended(samples int) ([]SystemOffsetMeasurementExtended, error)
- func (c *Clock) GetSystemOffsetPrecise(samples int) (SystemOffsetMeasurementPrecise, error)
- func (c *Clock) GetTime() (time.Time, error)
- func (c *Clock) OnExternalTimestampEvent(cb ExternalTimestampEventCallback)
- func (c *Clock) RequestExternalTimestamp(channel int, flags ExternalTimestampFlag) error
- func (c *Clock) SetPPSEnabled(enabled bool) error
- func (c *Clock) SetTime(t time.Time) error
- type ExternalTimestampEventCallback
- type ExternalTimestampFlag
- type PeriodicOutputConfig
- type Pin
- type PinFunction
- type SystemOffsetMeasurement
- type SystemOffsetMeasurementExtended
- type SystemOffsetMeasurementPrecise
Constants ¶
const ( ExternalTimestampEnable = ExternalTimestampFlag(1 << 0) ExternalTimestampRisingEdge = ExternalTimestampFlag(1 << 1) ExternalTimestampFallingEdge = ExternalTimestampFlag(1 << 2) ExternalTimestampStrict = ExternalTimestampFlag(1 << 3) ExternalTimestampBothEdges = ExternalTimestampRisingEdge | ExternalTimestampFallingEdge )
const ( PinFunctionNone = PinFunction(0) PinFunctionExternalTimestamp = PinFunction(1) PinFunctionPerOut = PinFunction(2) PinFunctionPhySync = PinFunction(3) )
const MaxSamples = 25
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
func (*Clock) AdjustTime ¶
AdjustTime gradually adjusts the system clock. The amount of time by which the clock is to be adjusted is specified in the structure passes as argument. If the adjustment parameter is positive, then the system clock is sped up by some small percentage (i.e., by adding a small amount of time to the clock value in each second) until the adjustment has been completed. If the adjustment parameter is negative, then the clock is slowed down in a similar fashion. Internally, this function calls into the clock_adjtime(3) syscall. Refer the manpage for more information.
func (*Clock) ConfigurePeriodicOutput ¶
func (c *Clock) ConfigurePeriodicOutput(channel uint32, config PeriodicOutputConfig) error
func (*Clock) GetCrossTimestampingSupport ¶
func (*Clock) GetExternalTimestampChannels ¶
GetExternalTimestampChannels return the number of external time stamp channels.
func (*Clock) GetMaxFrequencyAdjustment ¶
GetMaxAdj returns the maximum frequency adjustment in parts per billon.
func (*Clock) GetPpsCallbackSupport ¶
GetPpsCallbackSupport returns whether the clock supports a PPS callback.
func (*Clock) GetProgrammablePeriodicSignals ¶
GetProgrammablePeriodicSignals return the number of programmable periodic signals.
func (*Clock) GetSystemOffset ¶
func (c *Clock) GetSystemOffset(samples int) ([]SystemOffsetMeasurement, error)
func (*Clock) GetSystemOffsetExtended ¶
func (c *Clock) GetSystemOffsetExtended(samples int) ([]SystemOffsetMeasurementExtended, error)
func (*Clock) GetSystemOffsetPrecise ¶
func (c *Clock) GetSystemOffsetPrecise(samples int) (SystemOffsetMeasurementPrecise, error)
func (*Clock) OnExternalTimestampEvent ¶
func (c *Clock) OnExternalTimestampEvent(cb ExternalTimestampEventCallback)
OnExternalTimestampEvent sets the callback function for external time stamp events that are configure through RequestExternalTimestamp().
func (*Clock) RequestExternalTimestamp ¶
func (c *Clock) RequestExternalTimestamp(channel int, flags ExternalTimestampFlag) error
func (*Clock) SetPPSEnabled ¶
type ExternalTimestampFlag ¶
type ExternalTimestampFlag int
type PeriodicOutputConfig ¶
type PeriodicOutputConfig struct { // The period in which the output is supposed to fire. Period time.Duration // Configures the periodic output channel with a fixed absolute start time. // AbsoluteStartTime and PhaseOffset are mutually exclusive. AbsoluteStartTime *time.Time // Configures the periodic output channel with a phase offset. // The signal should start toggling at an unspecified integer multiple of the given period, plus the value given in the phase parameter. // The start time should be "as soon as possible". // AbsoluteStartTime and PhaseOffset are mutually exclusive. PhaseOffset *time.Duration // Optional, determines the 'on' time of the signal. Must be lower than the period. DutyCycle *time.Duration // Only run once OneShot bool }
type Pin ¶
type Pin struct {
// contains filtered or unexported fields
}
func (*Pin) GetChannel ¶
func (*Pin) GetFunction ¶
func (p *Pin) GetFunction() PinFunction
func (*Pin) SetFunction ¶
func (p *Pin) SetFunction(function PinFunction, channel uint32) error
type PinFunction ¶
type PinFunction uint32