app_tim.h
Go to the documentation of this file.
1
52 #ifndef _APP_TIM_H_
53 #define _APP_TIM_H_
54
55 #include "gr55xx_hal.h"
56 #include "app_drv_error.h"
57
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61
62 #ifdef HAL_TIMER_MODULE_ENABLED
63
71 typedef enum
72 {
73 APP_TIM_ID_0,
74 APP_TIM_ID_1,
75 APP_TIM_ID_MAX
76 } app_tim_id_t;
77
81 typedef enum
82 {
83 APP_TIM_EVT_ERROR,
84 APP_TIM_EVT_DONE
85 } app_tim_evt_t;
95 typedef struct
96 {
97 app_tim_id_t id;
98 timer_init_t init;
99 } app_tim_params_t;
100
104 typedef void (*app_tim_evt_handler_t)(app_tim_evt_t *p_evt);
105
108 /* Exported functions --------------------------------------------------------*/
124 uint16_t app_tim_init(app_tim_params_t *p_params, app_tim_evt_handler_t evt_handler);
125
135 uint16_t app_tim_deinit(app_tim_id_t id);
136
146 uint16_t app_tim_start(app_tim_id_t id);
147
157 uint16_t app_tim_stop(app_tim_id_t id);
158
168 timer_handle_t *app_tim_get_handle(app_tim_id_t id);
169
172 #endif
173
174 #ifdef __cplusplus
175 }
176 #endif
177
178 #endif
179
app_tim_id_t
app_tim_id_t
TIM module Enumerations definition.
Definition: app_tim.h:72
APP_TIM_ID_MAX
@ APP_TIM_ID_MAX
Definition: app_tim.h:75
app_tim_stop
uint16_t app_tim_stop(app_tim_id_t id)
Stops the TIM counter in interrupt mode.
app_tim_params_t::init
timer_init_t init
Definition: app_tim.h:98
app_tim_params_t::id
app_tim_id_t id
Definition: app_tim.h:97
_timer_init
TIMER init Structure definition.
Definition: gr55xx_hal_tim.h:98
APP_TIM_ID_1
@ APP_TIM_ID_1
Definition: app_tim.h:74
APP_TIM_EVT_ERROR
@ APP_TIM_EVT_ERROR
Definition: app_tim.h:83
app_tim_evt_t
app_tim_evt_t
TIM event Enumerations definition.
Definition: app_tim.h:82
app_tim_params_t
TIM parameters structure definition.
Definition: app_tim.h:96
APP_TIM_ID_0
@ APP_TIM_ID_0
Definition: app_tim.h:73
app_tim_start
uint16_t app_tim_start(app_tim_id_t id)
Starts the TIM counter in interrupt mode.
app_tim_deinit
uint16_t app_tim_deinit(app_tim_id_t id)
De-initialize the APP TIM DRIVER peripheral.
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_tim_init
uint16_t app_tim_init(app_tim_params_t *p_params, app_tim_evt_handler_t evt_handler)
Initialize the APP TIM DRIVER according to the specified parameters in the app_tim_params_t and app_t...
_timer_handle
TIMER handle Structure definition.
Definition: gr55xx_hal_tim.h:113
app_tim_evt_handler_t
void(* app_tim_evt_handler_t)(app_tim_evt_t *p_evt)
TIM event callback definition.
Definition: app_tim.h:104
app_tim_get_handle
timer_handle_t * app_tim_get_handle(app_tim_id_t id)
Return the TIM handle.
app_drv_error.h
Header file of app driver error code.
APP_TIM_EVT_DONE
@ APP_TIM_EVT_DONE
Definition: app_tim.h:84