no-OS
aducm3029_timer.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef ADUCM3029_TIMER_H
35 #define ADUCM3029_TIMER_H
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_util.h"
42 #include "no_os_timer.h"
43 #include <drivers/tmr/adi_tmr.h>
44 
45 /******************************************************************************/
46 /************************** Types Declarations *******************************/
47 /******************************************************************************/
69 };
70 
77  uint64_t old_time;
79  bool started;
81  ADI_TMR_CONFIG tmr_conf;
82 };
83 
91 };
92 
96 extern const struct no_os_timer_platform_ops aducm_timer_ops;
97 
98 #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:101
no_os_alloc.h
HFOSC_DIV64
@ HFOSC_DIV64
Definition: aducm3029_timer.h:59
aducm3029_timer_start
int32_t aducm3029_timer_start(struct no_os_timer_desc *desc)
Enable counting in the timer instance.
Definition: aducm3029_timer.c:251
no_os_timer_init_param::id
uint16_t id
Definition: no_os_timer.h:85
LFOSC_DIV1
@ LFOSC_DIV1
Definition: aducm3029_timer.h:61
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:407
aducm_timer_init_param
Definition: aducm3029_timer.h:88
LFOSC_DIV256
@ LFOSC_DIV256
Definition: aducm3029_timer.h:64
NO_OS_MHZ26_TO_US
#define NO_OS_MHZ26_TO_US(count)
Definition: aducm3029_timer.c:60
LFXTAL_DIV256
@ LFXTAL_DIV256
Definition: aducm3029_timer.h:68
aducm_timer_desc
It stores instance values specific for the ADuCM302x implementation.
Definition: aducm3029_timer.h:75
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:54
LFOSC_DIV16
@ LFOSC_DIV16
Definition: aducm3029_timer.h:62
avail_freqs
avail_freqs
It lists the available source frequencies for timer instance 1.
Definition: aducm3029_timer.h:52
HFOSC_DIV1
@ HFOSC_DIV1
Definition: aducm3029_timer.h:57
no_os_timer_init_param::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:89
LFXTAL_DIV16
@ LFXTAL_DIV16
Definition: aducm3029_timer.h:66
no_os_error.h
Error codes definition.
no_os_timer_init_param::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:87
NO_OS_HFOSC_LOAD
#define NO_OS_HFOSC_LOAD
Definition: aducm3029_timer.c:54
no_os_timer_desc::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:65
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:61
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:103
aducm_timer_desc::tmr_conf
ADI_TMR_CONFIG tmr_conf
Definition: aducm3029_timer.h:81
aducm3029_timer_stop
int32_t aducm3029_timer_stop(struct no_os_timer_desc *desc)
Stop counting the timer instance.
Definition: aducm3029_timer.c:282
LFXTAL_DIV1
@ LFXTAL_DIV1
Definition: aducm3029_timer.h:65
aducm_timer_init_param::source_freq
enum avail_freqs source_freq
Definition: aducm3029_timer.h:90
HFOSC_DIV16
@ HFOSC_DIV16
Definition: aducm3029_timer.h:58
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:314
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:424
aducm_timer_desc::old_time
uint64_t old_time
Definition: aducm3029_timer.h:77
aducm_timer_desc::started
bool started
Definition: aducm3029_timer.h:79
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:138
HFOSC_DIV256
@ HFOSC_DIV256
Definition: aducm3029_timer.h:60
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:83
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:368
LFOSC_DIV64
@ LFOSC_DIV64
Definition: aducm3029_timer.h:63
no_os_timer_desc::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:63
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:69
NULL
#define NULL
Definition: wrapper.h:64
PCLK_DIV1
@ PCLK_DIV1
Definition: aducm3029_timer.h:53
NO_OS_FREQ_1KHZ
#define NO_OS_FREQ_1KHZ
Definition: aducm3029_timer.c:56
aducm_timer_ops
const struct no_os_timer_platform_ops aducm_timer_ops
aducm3029 platform specific timer platform ops structure
Definition: aducm3029_timer.c:434
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:69
no_os_timer_init_param::extra
void * extra
Definition: no_os_timer.h:93
aducm3029_timer_remove
int32_t aducm3029_timer_remove(struct no_os_timer_desc *desc)
Remove a instance of a timer.
Definition: aducm3029_timer.c:211
aducm_timer_ops
const struct no_os_timer_platform_ops aducm_timer_ops
aducm3029 specific timer platform ops structure
Definition: aducm3029_timer.c:434
PCLK_DIV64
@ PCLK_DIV64
Definition: aducm3029_timer.h:55
PCLK_DIV256
@ PCLK_DIV256
Definition: aducm3029_timer.h:56
aducm3029_timer.h
Header file of TIMER driver for ADuCM302x.
PCLK_DIV16
@ PCLK_DIV16
Definition: aducm3029_timer.h:54
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:67
NO_OS_FREQ_1MHZ
#define NO_OS_FREQ_1MHZ
Definition: aducm3029_timer.c:58
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:104
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:389