Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
alt_watchdog.h
1 /******************************************************************************
2 *
3 * Copyright 2013 Altera Corporation. All Rights Reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors
16 * may be used to endorse or promote products derived from this software without
17 * specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 ******************************************************************************/
32 
33 /*
34  * $Id: //depot/embedded/rel/15.0/ip/hps/altera_hps/hwlib/include/alt_watchdog.h#1 $
35  */
36 
37 #ifndef __ALT_WDOG_H__
38 #define __ALT_WDOG_H__
39 
40 #include "hwlib.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45 
83 /******************************************************************************/
84 
89 typedef enum ALT_WDOG_TIMER_e {
90  /* OSC1 Clock Group */
99 
100  /* OSC1 Clock Group */
107 
114 
124 
135 
136 /******************************************************************************/
142 typedef enum ALT_WDOG_TIMEOUT_e {
147 
152 
157 
162 
167 
172 
177 
182 
187 
192 
197 
202 
207 
212 
218 
224 
225 /******************************************************************************/
230 typedef enum ALT_WDOG_RESET_TYPE_e {
241 
254 
267 
280 
281 /******************************************************************************/
289 /******************************************************************************/
296 ALT_STATUS_CODE alt_wdog_init(void);
297 
298 /******************************************************************************/
305 ALT_STATUS_CODE alt_wdog_uninit(void);
306 
307 /******************************************************************************/
320 ALT_STATUS_CODE alt_wdog_stop(ALT_WDOG_TIMER_t tmr_id);
321 
322 /******************************************************************************/
334 ALT_STATUS_CODE alt_wdog_start(ALT_WDOG_TIMER_t tmr_id);
335 
336 /******************************************************************************/
348 
349 /******************************************************************************/
366 ALT_STATUS_CODE alt_wdog_reset(ALT_WDOG_TIMER_t tmr_id);
367 
369 /******************************************************************************/
378 /******************************************************************************/
399 ALT_STATUS_CODE alt_wdog_counter_set(ALT_WDOG_TIMER_t tmr_id,
400  uint32_t val);
401 
402 /******************************************************************************/
413 
414 /******************************************************************************/
427 
428 /******************************************************************************/
444 
445 /******************************************************************************/
461 
462 /******************************************************************************/
478 
479 /******************************************************************************/
491 ALT_STATUS_CODE alt_wdog_core_prescaler_set(uint32_t val);
492 
493 /******************************************************************************/
502 uint32_t alt_wdog_core_prescaler_get(void);
503 
504 /******************************************************************************/
518 
519 /******************************************************************************/
533 
534 
535 /******************************************************************************/
549 
551 /******************************************************************************/
560 /******************************************************************************/
574 ALT_STATUS_CODE alt_wdog_int_disable(ALT_WDOG_TIMER_t tmr_id);
575 
576 /******************************************************************************/
590 ALT_STATUS_CODE alt_wdog_int_enable(ALT_WDOG_TIMER_t tmr_id);
591 
592 /******************************************************************************/
605 
606 /******************************************************************************/
623 
624 /******************************************************************************/
636 ALT_STATUS_CODE alt_wdog_int_clear(ALT_WDOG_TIMER_t tmr_id);
637 
638 /******************************************************************************/
651 
653 #if ALTERA_INTERNAL_ONLY_DOCS
654 /******************************************************************************/
662 #else
663 /******************************************************************************/
671 #endif
672 /******************************************************************************/
706 ALT_STATUS_CODE alt_wdog_response_mode_set(ALT_WDOG_TIMER_t tmr_id,
707  ALT_WDOG_RESET_TYPE_t type);
708 
709 /******************************************************************************/
735 
736 
737 #if ALTERA_INTERNAL_ONLY_DOCS
738 
739 /******************************************************************************/
754 uint32_t alt_wdog_compcode_get(ALT_WDOG_TIMER_t tmr_id);
755 
756 /******************************************************************************/
772 uint32_t alt_wdog_ver_get(ALT_WDOG_TIMER_t tmr_id);
773 
774 #else
775 
776 /******************************************************************************/
777 /* Returns the component code of the watchdog timer module. Only valid
778  * for ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL.
779  *
780  * This is an Altera Internal Only function
781  */
782 
783 uint32_t alt_wdog_compcode_get(ALT_WDOG_TIMER_t tmr_id);
784 
785 /******************************************************************************/
786 /* Returns the version code of the watchdog timer module. Only valid for
787  * ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL.
788  *
789  * This is an Altera Internal Only function
790  */
791 
792 uint32_t alt_wdog_ver_get(ALT_WDOG_TIMER_t tmr_id);
793 
794 #endif /* ALTERA_INTERNAL_ONLY_DOCS */
795 
796 /******************************************************************************/
797 
800 #ifdef __cplusplus
801 }
802 #endif /* __cplusplus */
803 #endif /* __ALT_WDOG_H__ */