no-OS
aducm3029_timer.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef ADUCM3029_TIMER_H
41 #define ADUCM3029_TIMER_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 #include <stdint.h>
47 #include "no_os_util.h"
48 #include "no_os_timer.h"
49 #include <drivers/tmr/adi_tmr.h>
50 
51 /******************************************************************************/
52 /************************** Types Declarations *******************************/
53 /******************************************************************************/
75 };
76 
83  uint64_t old_time;
85  bool started;
87  ADI_TMR_CONFIG tmr_conf;
88 };
89 
97 };
98 
103 
104 #endif /* ADUCM3029_TIMER_H */
no_os_timer_platform_ops
Structure holding timer function pointers that point to the platform specific function.
Definition: no_os_timer.h:99
HFOSC_DIV64
@ HFOSC_DIV64
Definition: aducm3029_timer.h:65
aducm3029_timer_start
int32_t aducm3029_timer_start(struct no_os_timer_desc *desc)
Enable counting in the timer instance.
Definition: aducm3029_timer.c:256
no_os_timer_init_param::id
uint16_t id
Definition: no_os_timer.h:83
LFOSC_DIV1
@ LFOSC_DIV1
Definition: aducm3029_timer.h:67
aducm3029_timer_count_clk_set
int32_t aducm3029_timer_count_clk_set(struct no_os_timer_desc *desc, uint32_t freq_hz)
Set the frequency the timer counts with.
Definition: aducm3029_timer.c:412
aducm_timer_init_param
Definition: aducm3029_timer.h:94
LFOSC_DIV256
@ LFOSC_DIV256
Definition: aducm3029_timer.h:70
NO_OS_MHZ26_TO_US
#define NO_OS_MHZ26_TO_US(count)
Definition: aducm3029_timer.c:65
LFXTAL_DIV256
@ LFXTAL_DIV256
Definition: aducm3029_timer.h:74
aducm_timer_desc
It stores instance values specific for the ADuCM302x implementation.
Definition: aducm3029_timer.h:81
no_os_timer.h
Timer control module header.
LFOSC_DIV16
@ LFOSC_DIV16
Definition: aducm3029_timer.h:68
avail_freqs
avail_freqs
It lists the available source frequencies for timer instance 1.
Definition: aducm3029_timer.h:58
HFOSC_DIV1
@ HFOSC_DIV1
Definition: aducm3029_timer.h:63
no_os_timer_init_param::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:87
aducm3029_timer_ops
const struct no_os_timer_platform_ops aducm3029_timer_ops
aducm3029 specific timer platform ops structure
Definition: aducm3029_timer.c:439
aducm3029_timer_init
int32_t aducm3029_timer_init(struct no_os_timer_desc **desc, struct no_os_timer_init_param *param)
Initialize a instance of a timer.
Definition: aducm3029_timer.c:109
LFXTAL_DIV16
@ LFXTAL_DIV16
Definition: aducm3029_timer.h:72
no_os_error.h
Error codes definition.
no_os_timer_init_param::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:85
NO_OS_HFOSC_LOAD
#define NO_OS_HFOSC_LOAD
Definition: aducm3029_timer.c:59
no_os_timer_desc::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:63
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:59
no_os_timer_platform_ops::init
int32_t(* init)(struct no_os_timer_desc **, const struct no_os_timer_init_param *)
Definition: no_os_timer.h:101
aducm_timer_desc::tmr_conf
ADI_TMR_CONFIG tmr_conf
Definition: aducm3029_timer.h:87
aducm3029_timer_stop
int32_t aducm3029_timer_stop(struct no_os_timer_desc *desc)
Stop counting the timer instance.
Definition: aducm3029_timer.c:287
LFXTAL_DIV1
@ LFXTAL_DIV1
Definition: aducm3029_timer.h:71
aducm_timer_init_param::source_freq
enum avail_freqs source_freq
Definition: aducm3029_timer.h:96
HFOSC_DIV16
@ HFOSC_DIV16
Definition: aducm3029_timer.h:64
aducm3029_timer_counter_get
int32_t aducm3029_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Get the value the timer is at.
Definition: aducm3029_timer.c:319
aducm3029_timer_get_elapsed_time_nsec
int32_t aducm3029_timer_get_elapsed_time_nsec(struct no_os_timer_desc *desc, uint64_t *elapsed_time)
Get the elapsed time in nsec for the timer.
Definition: aducm3029_timer.c:429
aducm_timer_desc::old_time
uint64_t old_time
Definition: aducm3029_timer.h:83
aducm_timer_desc::started
bool started
Definition: aducm3029_timer.h:85
no_os_timer_counter_get
int32_t no_os_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Get the value of the counter register for the timer.
Definition: no_os_timer.c:115
HFOSC_DIV256
@ HFOSC_DIV256
Definition: aducm3029_timer.h:66
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:81
aducm3029_timer_counter_set
int32_t aducm3029_timer_counter_set(struct no_os_timer_desc *desc, uint32_t new_val)
Set a new value for the timer.
Definition: aducm3029_timer.c:373
LFOSC_DIV64
@ LFOSC_DIV64
Definition: aducm3029_timer.h:69
no_os_timer_desc::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:61
NULL
#define NULL
Definition: wrapper.h:64
aducm3029_timer_ops
const struct no_os_timer_platform_ops aducm3029_timer_ops
aducm3029 platform specific timer platform ops structure
Definition: aducm3029_timer.c:439
PCLK_DIV1
@ PCLK_DIV1
Definition: aducm3029_timer.h:59
NO_OS_FREQ_1KHZ
#define NO_OS_FREQ_1KHZ
Definition: aducm3029_timer.c:61
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:67
no_os_timer_init_param::extra
void * extra
Definition: no_os_timer.h:91
aducm3029_timer_remove
int32_t aducm3029_timer_remove(struct no_os_timer_desc *desc)
Remove a instance of a timer.
Definition: aducm3029_timer.c:216
PCLK_DIV64
@ PCLK_DIV64
Definition: aducm3029_timer.h:61
PCLK_DIV256
@ PCLK_DIV256
Definition: aducm3029_timer.h:62
aducm3029_timer.h
Header file of TIMER driver for ADuCM302x.
PCLK_DIV16
@ PCLK_DIV16
Definition: aducm3029_timer.h:60
no_os_timer_desc
Structure holding timer descriptor.
Definition: no_os_timer.h:57
no_os_util.h
Header file of utility functions.
LFXTAL_DIV64
@ LFXTAL_DIV64
Definition: aducm3029_timer.h:73
NO_OS_FREQ_1MHZ
#define NO_OS_FREQ_1MHZ
Definition: aducm3029_timer.c:63
aducm3029_timer_count_clk_get
int32_t aducm3029_timer_count_clk_get(struct no_os_timer_desc *desc, uint32_t *freq_hz)
Get the frequency the timer counts with.
Definition: aducm3029_timer.c:394