Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
Main Page
Address Space
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
alt_timers.h
Go to the documentation of this file.
1
5
/******************************************************************************
6
*
7
* Copyright 2013 Altera Corporation. All Rights Reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions are met:
11
*
12
* 1. Redistributions of source code must retain the above copyright notice,
13
* this list of conditions and the following disclaimer.
14
*
15
* 2. Redistributions in binary form must reproduce the above copyright notice,
16
* this list of conditions and the following disclaimer in the documentation
17
* and/or other materials provided with the distribution.
18
*
19
* 3. Neither the name of the copyright holder nor the names of its contributors
20
* may be used to endorse or promote products derived from this software without
21
* specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*
35
******************************************************************************/
36
37
/*
38
* $Id: //depot/embedded/rel/15.0/ip/hps/altera_hps/hwlib/include/alt_timers.h#1 $
39
*/
40
41
#ifndef __ALT_GPT_H__
42
#define __ALT_GPT_H__
43
44
#include <stdint.h>
45
#include <stdbool.h>
46
#include "hwlib.h"
47
48
#ifdef __cplusplus
49
extern
"C"
50
{
51
#endif
/* __cplusplus */
52
53
54
/******************************************************************************/
73
/******************************************************************************/
78
typedef
enum
ALT_GPT_TIMER_e
79
{
87
ALT_GPT_CPU_GLOBAL_TMR
,
88
94
ALT_GPT_CPU_PRIVATE_TMR
,
95
106
ALT_GPT_CPU_WDTGPT_TMR
,
107
108
/* Peripheral Timers */
109
/* OSC1 Clock Group */
114
ALT_GPT_OSC1_TMR0
,
115
120
ALT_GPT_OSC1_TMR1
,
121
122
/* L4_SP Clock Group */
127
ALT_GPT_SP_TMR0
,
128
133
ALT_GPT_SP_TMR1
134
135
}
ALT_GPT_TIMER_t
;
136
137
142
typedef
enum
ALT_GPT_RESTART_MODE_e
143
{
159
ALT_GPT_RESTART_MODE_ONESHOT
,
160
170
ALT_GPT_RESTART_MODE_PERIODIC
171
172
}
ALT_GPT_RESTART_MODE_t
;
173
174
175
/******************************************************************************/
183
/******************************************************************************/
187
ALT_STATUS_CODE
alt_gpt_all_tmr_uninit
(
void
);
188
189
/******************************************************************************/
193
ALT_STATUS_CODE
alt_gpt_all_tmr_init
(
void
);
194
195
/******************************************************************************/
207
ALT_STATUS_CODE
alt_gpt_tmr_stop
(
ALT_GPT_TIMER_t
tmr_id);
208
209
/******************************************************************************/
221
ALT_STATUS_CODE
alt_gpt_tmr_start
(
ALT_GPT_TIMER_t
tmr_id);
222
223
/******************************************************************************/
236
ALT_STATUS_CODE
alt_gpt_tmr_is_running
(
ALT_GPT_TIMER_t
tmr_id);
237
238
/******************************************************************************/
253
ALT_STATUS_CODE
alt_gpt_tmr_reset
(
ALT_GPT_TIMER_t
tmr_id);
254
255
257
/******************************************************************************/
265
/******************************************************************************/
287
ALT_STATUS_CODE
alt_gpt_counter_set
(
ALT_GPT_TIMER_t
tmr_id,
288
uint32_t val);
289
290
/******************************************************************************/
305
uint32_t
alt_gpt_counter_get
(
ALT_GPT_TIMER_t
tmr_id);
306
307
/******************************************************************************/
328
uint32_t
alt_gpt_reset_value_get
(
ALT_GPT_TIMER_t
tmr_id);
329
330
/******************************************************************************/
347
uint32_t
alt_gpt_maxcounter_get
(
ALT_GPT_TIMER_t
tmr_id);
348
349
/******************************************************************************/
366
ALT_STATUS_CODE
alt_gpt_prescaler_set
(
ALT_GPT_TIMER_t
tmr_id,
367
uint32_t val);
368
369
/******************************************************************************/
383
uint32_t
alt_gpt_prescaler_get
(
ALT_GPT_TIMER_t
tmr_id);
384
385
/******************************************************************************/
397
uint32_t
alt_gpt_freq_get
(
ALT_GPT_TIMER_t
tmr_id);
398
399
/******************************************************************************/
411
uint32_t
alt_gpt_time_get
(
ALT_GPT_TIMER_t
tmr_id);
412
413
/******************************************************************************/
429
uint32_t
alt_gpt_time_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
430
431
/******************************************************************************/
446
uint32_t
alt_gpt_time_microsecs_get
(
ALT_GPT_TIMER_t
tmr_id);
447
448
/******************************************************************************/
459
uint32_t
alt_gpt_curtime_get
(
ALT_GPT_TIMER_t
tmr_id);
460
461
462
/******************************************************************************/
474
uint32_t
alt_gpt_curtime_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
475
476
477
/******************************************************************************/
489
uint32_t
alt_gpt_curtime_microsecs_get
(
ALT_GPT_TIMER_t
tmr_id);
490
491
492
/******************************************************************************/
504
uint32_t
alt_gpt_curtime_nanosecs_get
(
ALT_GPT_TIMER_t
tmr_id);
505
506
507
/******************************************************************************/
520
uint32_t
alt_gpt_maxtime_get
(
ALT_GPT_TIMER_t
tmr_id);
521
522
/******************************************************************************/
535
uint32_t
alt_gpt_maxtime_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
536
539
/******************************************************************************/
544
/******************************************************************************/
557
ALT_STATUS_CODE
alt_gpt_int_disable
(
ALT_GPT_TIMER_t
tmr_id);
558
559
/******************************************************************************/
572
ALT_STATUS_CODE
alt_gpt_int_enable
(
ALT_GPT_TIMER_t
tmr_id);
573
574
/******************************************************************************/
585
bool
alt_gpt_int_is_enabled
(
ALT_GPT_TIMER_t
tmr_id);
586
587
/******************************************************************************/
599
ALT_STATUS_CODE
alt_gpt_int_clear_pending
(
ALT_GPT_TIMER_t
tmr_id);
600
601
/******************************************************************************/
614
ALT_STATUS_CODE
alt_gpt_int_is_pending
(
ALT_GPT_TIMER_t
tmr_id);
615
616
/******************************************************************************/
629
ALT_STATUS_CODE
alt_gpt_int_if_pending_clear
(
ALT_GPT_TIMER_t
tmr_id);
632
/******************************************************************************/
639
/******************************************************************************/
668
ALT_STATUS_CODE
alt_gpt_mode_set
(
ALT_GPT_TIMER_t
tmr_id,
669
ALT_GPT_RESTART_MODE_t
mode);
670
671
/******************************************************************************/
683
int32_t
alt_gpt_mode_get
(
ALT_GPT_TIMER_t
tmr_id);
684
690
#ifdef __cplusplus
691
}
692
#endif
/* __cplusplus */
693
#endif
/* __ALT_GPT_H__ */
include
alt_timers.h
Generated on Tue Sep 8 2015 13:35:04 for Altera HWLIB by
1.8.2