EDT PDV SDK Documentation 6.2.0
Configuration Functions

Functions

void edt_set_timecode_seconds_offset (EdtDev edt_p, uint32_t seconds)
 Set a seconds offset for timecode production. More...
 
EdtDev edt_spi_open (const char *edt_interface, int unit, uint32_t spi_reg_base)
 Opens the EDT SPI master. More...
 
int edt_spi_close (EdtDev edt_p)
 Closes the SPI master EDT device handle. More...
 
int edt_set_timecode_enable (EdtDev edt_p, uint8_t enable)
 Enable or disable timecode production from the MSP430. More...
 
void edt_set_msp430_clock (EdtDev edt_p, int clock_sel, int clock_hz)
 Select an internal or external clock source for the MSP430 and state the clock rate. More...
 
void edt_set_timecode_raw (EdtDev edt_p, int enable)
 Enable or disable raw timecode format from the MSP430. More...
 
void edt_enable_timecode_programmable_year (EdtDev edt_p, uint16_t year)
 Enable the msp430 IRIG-B firmware programmable year mode and set the year. More...
 
void edt_disable_timecode_programmable_year (EdtDev edt_p)
 Disable the msp430 IRIG-B firmware programmable year mode. More...
 

Detailed Description

Configuration Functions

Function Documentation

◆ edt_set_timecode_seconds_offset()

void edt_set_timecode_seconds_offset ( EdtDev  edt_p,
uint32_t  seconds 
)

Set a seconds offset for timecode production.

The timecodes produced by the MSP430 are normally one to two seconds later than the PPS signal due to timestamp decoding and datpath transmission. This function sets a firmware variable to the number of seconds to add to the timestamp to align it with the current PPS.

See the included example program timing_test.c.

Parameters
edt_pThe EDT open device handle.
secondsAn integer containing the number of seconds to add to the timecode.

◆ edt_spi_open()

EdtDev edt_spi_open ( const char *  edt_interface,
int  unit,
uint32_t  spi_reg_base 
)

Opens the EDT SPI master.

Parameters
edt_interfaceString containing the type of board; "pcd", "pdv"
unitBoard unit number.
spi_reg_baseSets unit spi register base address.
Returns
A pointer to the EdtDev structure if successful or NULL if the open fails or the device is not attached to the SPI master on the timing board.

This EDT device handle should be used with edt_spi_ prefixed subroutines.

See the included example program timing_test.c.

◆ edt_spi_close()

int edt_spi_close ( EdtDev  edt_p)

Closes the SPI master EDT device handle.

Parameters
edt_pThe EDT open device handle.
Returns
The value from edt_close().

◆ edt_set_timecode_enable()

int edt_set_timecode_enable ( EdtDev  edt_p,
uint8_t  enable 
)

Enable or disable timecode production from the MSP430.

Parameters
edt_pThe EDT open device handle.
enableAn integer containing 1 to enable timestamp production, 0 to disable it.
Returns
0 for success, -1 for failure.

Packet communication with the MSP430 requires the timestamp production must be disabled before the packets, then reenabled when packet communication is complete.

See the included example program timing_test.c.

◆ edt_set_msp430_clock()

void edt_set_msp430_clock ( EdtDev  edt_p,
int  clock_sel,
int  clock_hz 
)

Select an internal or external clock source for the MSP430 and state the clock rate.

Parameters
edt_pThe EDT open device handle.
clock_selAn integer containing 0 for internal clock and 1 for external clock select.
clock_hzAn integer stating the number of Hertz for the selected clock.

The MSP430 normally uses an internal 16 Mhz system clock. This clock can be set to 1 Mhz, 4 Mhz, 8 Mhz, 12 Mhz or 16 Mhz by using the third argument. An external clock can also be specified along with its stated clock rate.

When an external clock is selected and no clock signal is available on XIN (P26), a clock fault condition is triggered which resets the system clock back to the default internal 16 Mhz clock.

See the included example program timing_test.c.

◆ edt_set_timecode_raw()

void edt_set_timecode_raw ( EdtDev  edt_p,
int  enable 
)

Enable or disable raw timecode format from the MSP430.

Parameters
edt_pThe EDT open device handle.
enableAn integer containing 1 to enable raw timestamp format, 0 to disable it.

The timecodes produced by the MSP430 are normally UNIX time: the number of seconds since January 1, 1970. By enabling raw timecode production, the raw fields from the IRIG-B timecode frame are produced instead. The numbers are sent in a struct ts_raw_t defined in libedt_timing.h.

See the included example program timing_test.c.

◆ edt_enable_timecode_programmable_year()

void edt_enable_timecode_programmable_year ( EdtDev  edt_p,
uint16_t  year 
)

Enable the msp430 IRIG-B firmware programmable year mode and set the year.

Parameters
edt_pThe EDT open device handle.
yearThe year >= 2000.

Enable the msp430 IRIG-B firmware programmable year mode and set the year. The IRIG-B spec does not provide the year of the timestamp. This function enables the user to set the year to be used when computing the timestamp.

By default, the CONTROL FIELD of the IRIG-B signal is assumed to provide the current year since 2000. When this is not the case this function enables the programmed year mode and sets the year to the second argument.

The year argument must be >= 2000. This value is stored in a firmware variable in the MSP430 and included in the timestamps produced by the IRIG-B signal. When the "days" field of the IRIG-B signal rolls over to 1, the year is incremented by 1.

See the included example program timing_test.c.

◆ edt_disable_timecode_programmable_year()

void edt_disable_timecode_programmable_year ( EdtDev  edt_p)

Disable the msp430 IRIG-B firmware programmable year mode.

Parameters
edt_pThe EDT open device handle.

Disable the msp430 IRIG-B firmware programmable year mode. Successive timestamps will obtain the year information from the CONTROL FIELD of the IRIG-B signal.

See the included example program timing_test.c.