Enables packet timestamping and starts the system clock running. \param ui32Base is the base address of the controller. This function is used to enable the system clock used to timestamp Ethernet frames and to enable that timestamping. \return None.
| 3321 | // |
| 3322 | //***************************************************************************** |
| 3323 | void |
| 3324 | EMACTimestampEnable(uint32_t ui32Base) |
| 3325 | { |
| 3326 | // |
| 3327 | // Parameter sanity check. |
| 3328 | // |
| 3329 | ASSERT(ui32Base == EMAC0_BASE); |
| 3330 | |
| 3331 | // |
| 3332 | // Enable IEEE 1588 timestamping. |
| 3333 | // |
| 3334 | HWREG(ui32Base + EMAC_O_TIMSTCTRL) |= EMAC_TIMSTCTRL_TSEN; |
| 3335 | |
| 3336 | // |
| 3337 | // If necessary, initialize the timestamping system. This bit self-clears |
| 3338 | // once the system time is loaded. Only do this if initialization is not |
| 3339 | // currently ongoing. |
| 3340 | // |
| 3341 | if(!(HWREG(ui32Base + EMAC_O_TIMSTCTRL) & EMAC_TIMSTCTRL_TSINIT)) |
| 3342 | { |
| 3343 | HWREG(ui32Base + EMAC_O_TIMSTCTRL) |= EMAC_TIMSTCTRL_TSINIT; |
| 3344 | } |
| 3345 | } |
| 3346 | |
| 3347 | //***************************************************************************** |
| 3348 | // |