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 
102 extern const struct no_os_timer_platform_ops aducm_timer_ops;
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:107
no_os_alloc.h
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:257
no_os_timer_init_param::id
uint16_t id
Definition: no_os_timer.h:91
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:413
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:66
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.
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
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:95
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:93
NO_OS_HFOSC_LOAD
#define NO_OS_HFOSC_LOAD
Definition: aducm3029_timer.c:60
no_os_timer_desc::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:71
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:67
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:109
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:288
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:320
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:430
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:144
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:89
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:374
LFOSC_DIV64
@ LFOSC_DIV64
Definition: aducm3029_timer.h:69
no_os_timer_desc::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:69
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
NULL
#define NULL
Definition: wrapper.h:64
PCLK_DIV1
@ PCLK_DIV1
Definition: aducm3029_timer.h:59
NO_OS_FREQ_1KHZ
#define NO_OS_FREQ_1KHZ
Definition: aducm3029_timer.c:62
aducm_timer_ops
const struct no_os_timer_platform_ops aducm_timer_ops
aducm3029 platform specific timer platform ops structure
Definition: aducm3029_timer.c:440
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:75
no_os_timer_init_param::extra
void * extra
Definition: no_os_timer.h:99
aducm3029_timer_remove
int32_t aducm3029_timer_remove(struct no_os_timer_desc *desc)
Remove a instance of a timer.
Definition: aducm3029_timer.c:217
aducm_timer_ops
const struct no_os_timer_platform_ops aducm_timer_ops
aducm3029 specific timer platform ops structure
Definition: aducm3029_timer.c:440
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:63
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:64
aducm3029_timer_init
int32_t aducm3029_timer_init(struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param)
Initialize a instance of a timer.
Definition: aducm3029_timer.c:110
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:395