/*! \file * Contains definitions for the Altera Hardware Libraries Clock Manager * Application Programming Interface */ /****************************************************************************** * * Copyright 2013 Altera Corporation. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * ******************************************************************************/ #ifndef __ALT_CLK_MGR_H__ #define __ALT_CLK_MGR_H__ #include "hwlib.h" #include "alt_clock_group.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! \addtogroup CLK_MGR The Clock Manager API * * This module defines the Clock Manager API for accessing, configuring, and * controlling the HPS clock resources. * * @{ */ /******************************************************************************/ /*! * This type definition is an opaque type definition for clock frequency values * in Hz. */ typedef uint32_t alt_freq_t; /******************************************************************************/ /*! * This type definition enumerates the names of the clock and PLL resources * managed by the Clock Manager. */ typedef enum ALT_CLK_e { /* Clock Input Pins */ ALT_CLK_IN_PIN_OSC1, /*!< \b OSC_CLK_1_HPS * External oscillator input: * * Input Pin * * Clock source to Main PLL * * Clock source to SDRAM PLL * and Peripheral PLL if selected via * register write * * Clock source for clock in safe mode */ ALT_CLK_IN_PIN_OSC2, /*!< \b OSC_CLK_2_HPS * External Oscillator input: * * Input Pin * * Optional clock source to SDRAM PLL * and Peripheral PLL if selected * * Typically used for Ethernet * reference clock */ /* FPGA Clock Sources External to HPS */ ALT_CLK_F2H_PERIPH_REF, /*