Hardware Libraries
20.1
Arria 10 SoC Hardware Manager
Main Page
Address Space
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
alt_timers.h
Go to the documentation of this file.
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: //acds/rel/20.1/embedded/ip/hps/altera_hps/hwlib/include/alt_timers.h#1 $
35
*/
36
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
414
/****************************************************************************************/
430
/****************************************************************************************/
431
432
uint32_t
alt_gpt_delay_ns
(
ALT_GPT_TIMER_t
tmr_id, uint32_t start_counter, uint32_t nanoseconds);
433
434
/****************************************************************************************/
443
/****************************************************************************************/
444
445
uint32_t
alt_gpt_cpu_gblt_delay_ns
(uint64_t nanoseconds);
446
447
/******************************************************************************/
463
uint32_t
alt_gpt_time_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
464
465
/******************************************************************************/
480
uint32_t
alt_gpt_time_microsecs_get
(
ALT_GPT_TIMER_t
tmr_id);
481
482
/******************************************************************************/
493
uint32_t
alt_gpt_curtime_get
(
ALT_GPT_TIMER_t
tmr_id);
494
495
496
/******************************************************************************/
508
uint32_t
alt_gpt_curtime_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
509
510
511
/******************************************************************************/
523
uint32_t
alt_gpt_curtime_microsecs_get
(
ALT_GPT_TIMER_t
tmr_id);
524
525
526
/******************************************************************************/
538
uint32_t
alt_gpt_curtime_nanosecs_get
(
ALT_GPT_TIMER_t
tmr_id);
539
540
541
/******************************************************************************/
554
uint32_t
alt_gpt_maxtime_get
(
ALT_GPT_TIMER_t
tmr_id);
555
556
/******************************************************************************/
569
uint32_t
alt_gpt_maxtime_millisecs_get
(
ALT_GPT_TIMER_t
tmr_id);
570
573
/******************************************************************************/
578
/******************************************************************************/
591
ALT_STATUS_CODE
alt_gpt_int_disable
(
ALT_GPT_TIMER_t
tmr_id);
592
593
/******************************************************************************/
606
ALT_STATUS_CODE
alt_gpt_int_enable
(
ALT_GPT_TIMER_t
tmr_id);
607
608
/******************************************************************************/
619
bool
alt_gpt_int_is_enabled
(
ALT_GPT_TIMER_t
tmr_id);
620
621
/******************************************************************************/
633
ALT_STATUS_CODE
alt_gpt_int_clear_pending
(
ALT_GPT_TIMER_t
tmr_id);
634
635
/******************************************************************************/
648
ALT_STATUS_CODE
alt_gpt_int_is_pending
(
ALT_GPT_TIMER_t
tmr_id);
649
650
/******************************************************************************/
663
ALT_STATUS_CODE
alt_gpt_int_if_pending_clear
(
ALT_GPT_TIMER_t
tmr_id);
666
/******************************************************************************/
673
/******************************************************************************/
702
ALT_STATUS_CODE
alt_gpt_mode_set
(
ALT_GPT_TIMER_t
tmr_id,
703
ALT_GPT_RESTART_MODE_t
mode
);
704
705
/******************************************************************************/
717
int32_t
alt_gpt_mode_get
(
ALT_GPT_TIMER_t
tmr_id);
718
724
#ifdef __cplusplus
725
}
726
#endif
/* __cplusplus */
727
#endif
/* __ALT_GPT_H__ */
include
alt_timers.h
Generated on Tue Oct 27 2020 08:37:29 for Hardware Libraries by
1.8.2