Embedded Peripherals IP User Guide

ID 683130
Date 10/24/2025
Public
Document Table of Contents
1. Introduction 2. Avalon® -ST Serial Peripheral Interface Core 3. SPI Core 4. SPI Agent/JTAG to Avalon® Host Bridge Cores 5. Intel eSPI Agent Core 6. eSPI to LPC Bridge Core 7. Ethernet MDIO Core 8. Intel FPGA 16550 Compatible UART Core 9. UART Core 10. Lightweight UART Core 11. JTAG UART Core 12. Intel FPGA Avalon® Mailbox Core 13. Intel FPGA Avalon® Mutex Core 14. Intel FPGA Avalon® I2C (Host) Core 15. Intel FPGA I2C Agent to Avalon® -MM Host Bridge Core 16. EPCS/EPCQA Serial Flash Controller Core 17. Intel FPGA Serial Flash Controller Core 18. Intel FPGA Serial Flash Controller II Core 19. Intel FPGA Generic QUAD SPI Controller Core 20. Intel FPGA Generic QUAD SPI Controller II Core 21. Interval Timer Core 22. Intel FPGA Avalon FIFO Memory Core 23. On-Chip Memory (RAM and ROM) Intel FPGA IP 24. On-Chip Memory II (RAM or ROM) Intel FPGA IP 25. PIO Core 26. PLL Cores 27. DMA Controller Core 28. Modular Scatter-Gather DMA Core 29. Scatter-Gather DMA Controller Core 30. Video Sync Generator and Pixel Converter Cores 31. Intel FPGA Interrupt Latency Counter Core 32. Performance Counter Unit Core 33. Vectored Interrupt Controller Core 34. System ID Peripheral Core 35. Intel FPGA GMII to RGMII Converter Core 36. HPS GMII to RGMII Adapter IP 37. Intel FPGA MII to RMII Converter Core 38. HPS GMII to TSE 1000BASE-X/SGMII PCS Bridge Core IP 39. Intel FPGA HPS EMAC to Multi-rate PHY GMII Adapter Core 40. Intel FPGA MSI to GIC Generator Core 41. Cache Coherency Translator IP 42. Altera ACE5-Lite Cache Coherency Translator

21.6. HAL APIs and Macros

The Interval Timer IP core has two operating modes, System Clock and Timestamp Clock. These settings are controlled by selecting the timer_0 option for hal.sys_clk_timer and hal.timestamp_timer while generating the BSP drivers. When timer_0 is chosen as the System Clock, then it cannot be used as a timestamp clock and vice versa.

Table 270.  alt_timestamp_start
Prototype int alt_timestamp_start(void)
Parameters -
Returns The return value is 0 upon success and -1 if timestamp device has not been registered.
Description Initialize the timestamp feature.
Table 271.  alt_timestamp
Prototype alt_timestamp_type alt_timestamp (void)
Parameters -
Returns This function returns the current timestamp count. It returns -1 if the timer has run full.
Description Returns the current timestamp count.
Table 272.  alt_timestamp_freq
Prototype alt_u32 alt_timestamp_freq(void)
Parameters -
Returns This function returns the number of timestamp ticks per second. This will be 0 if no timestamp device has been registered.
Description Returns the number of timestamp ticks per second.

IORD_ALTERA_AVALON_TIMER_CONTROL(base)

This macro can be used to read the control register value of the Timer core. From Control register the user can read ITO – whether Interrupt is enabled or not and CONT bit - counter runs continuously or not; for more information, refer to the control register.

IOWR_ALTERA_AVALON_TIMER_CONTROL(base, data)

The user can start or stop the timer by setting the START or STOP bits in the control register and can enable or disable interrupts by toggling the ITO bit; for more information, refer to the control register.

IORD_ALTERA_AVALON_TIMER_STATUS(base)

The status register has two defined bits. TO (timeout) bit is set to 1 when the internal counter reaches zero. RUN bit reads as 1 when the internal counter is running; otherwise, this bit reads as 0. More details in the control register.

IOWR_ALTERA_AVALON_TIMER_STATUS(base, data)

In Status Register only TO bit is writeable. Write 0 or 1 to the status register to clear the TO bit. More details in the control register.

IORD_ALTERA_AVALON_TIMER_PERIOD(base)

Reading the Period register returns the currently configured timeout period. In system clock mode, the register is loaded with a default value, while in timestamp mode, it defaults to the full-scale value, which can be modified by the user at runtime. For more details, refer to the Period register.

IOWR_ALTERA_AVALON_TIMER_PERIOD(base, data)

Using this macro, the user can write the new timeout value into the Period register. When the hardware is configured with Writeable period disabled, writing to the period registers cause the counter to reset to the fixed Timeout Period specified at system generation time. For more details, refer to the Period register.