no-OS
stm32_timer.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef STM32_TIMER_H_
34 #define STM32_TIMER_H_
35 
36 #include <stdint.h>
37 #include "no_os_timer.h"
38 #include "stm32_hal.h"
39 
46  TIM_HandleTypeDef *htimer;
47 };
48 
55  TIM_HandleTypeDef *htimer;
56 };
57 
61 extern const struct no_os_timer_platform_ops stm32_timer_ops;
62 
63 #endif // STM32_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
stm32_timer.h
Header file for the stm32 timer driver.
stm32_timer_init_param::htimer
TIM_HandleTypeDef * htimer
Definition: stm32_timer.h:46
no_os_timer_init_param::id
uint16_t id
Definition: no_os_timer.h:85
stm32_timer_ops
const struct no_os_timer_platform_ops stm32_timer_ops
stm32 specific timer platform ops structure
Definition: stm32_timer.c:341
stm32_timer_ops
const struct no_os_timer_platform_ops stm32_timer_ops
stm32 platform specific timer platform ops structure
Definition: stm32_timer.c:341
stm32_timer_init_param
Structure holding the initialization parameters for stm32 platform specific timer parameters.
Definition: stm32_timer.h:45
stm32_timer_desc::htimer
TIM_HandleTypeDef * htimer
Definition: stm32_timer.h:55
stm32_timer_remove
int32_t stm32_timer_remove(struct no_os_timer_desc *desc)
Free the resources allocated by no_os_timer_init().
Definition: stm32_timer.c:197
stm32_timer_get_elapsed_time_nsec
int32_t stm32_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: stm32_timer.c:331
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
no_os_timer_init_param::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:89
no_os_timer_init_param::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:87
no_os_timer_desc::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:65
stm32_timer_init
int32_t stm32_timer_init(struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param)
Initialize the timer peripheral.
Definition: stm32_timer.c:134
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
stm32_timer_start
int32_t stm32_timer_start(struct no_os_timer_desc *desc)
Start a timer.
Definition: stm32_timer.c:216
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:83
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
stm32_timer_desc
stm32 platform specific timer descriptor
Definition: stm32_timer.h:53
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
no_os_timer_desc
Structure holding timer descriptor.
Definition: no_os_timer.h:57
stm32_timer_counter_set
int32_t stm32_timer_counter_set(struct no_os_timer_desc *desc, uint32_t new_val)
Set the timer counter register value.
Definition: stm32_timer.c:266
no_os_util.h
Header file of utility functions.
stm32_hal.h
errno.h
Error macro definition for ARM Compiler.
stm32_timer_count_clk_get
int32_t stm32_timer_count_clk_get(struct no_os_timer_desc *desc, uint32_t *freq_hz)
Get the timer clock frequency.
Definition: stm32_timer.c:281
stm32_timer_stop
int32_t stm32_timer_stop(struct no_os_timer_desc *desc)
Stop a timer from counting.
Definition: stm32_timer.c:233
stm32_timer_counter_get
int32_t stm32_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Get the value of the counter register for the timer.
Definition: stm32_timer.c:250
stm32_timer_count_clk_set
int32_t stm32_timer_count_clk_set(struct no_os_timer_desc *desc, uint32_t freq_hz)
Set the timer clock frequency.
Definition: stm32_timer.c:297