EDT PDV SDK Documentation 6.2.0
|
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... | |
Configuration Functions
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.
edt_p | The EDT open device handle. |
seconds | An integer containing the number of seconds to add to the timecode. |
EdtDev edt_spi_open | ( | const char * | edt_interface, |
int | unit, | ||
uint32_t | spi_reg_base | ||
) |
Opens the EDT SPI master.
edt_interface | String containing the type of board; "pcd", "pdv" |
unit | Board unit number. |
spi_reg_base | Sets unit spi register base address. |
This EDT device handle should be used with edt_spi_ prefixed subroutines.
See the included example program timing_test.c.
int edt_spi_close | ( | EdtDev | edt_p | ) |
Closes the SPI master EDT device handle.
edt_p | The EDT open device handle. |
int edt_set_timecode_enable | ( | EdtDev | edt_p, |
uint8_t | enable | ||
) |
Enable or disable timecode production from the MSP430.
edt_p | The EDT open device handle. |
enable | An integer containing 1 to enable timestamp production, 0 to disable it. |
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.
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.
edt_p | The EDT open device handle. |
clock_sel | An integer containing 0 for internal clock and 1 for external clock select. |
clock_hz | An 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.
void edt_set_timecode_raw | ( | EdtDev | edt_p, |
int | enable | ||
) |
Enable or disable raw timecode format from the MSP430.
edt_p | The EDT open device handle. |
enable | An 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.
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.
edt_p | The EDT open device handle. |
year | The 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.
void edt_disable_timecode_programmable_year | ( | EdtDev | edt_p | ) |
Disable the msp430 IRIG-B firmware programmable year mode.
edt_p | The 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.