app_dual_tim.h
Go to the documentation of this file.
1
51 #ifndef _APP_DUAL_TIM_H_
52 #define _APP_DUAL_TIM_H_
53
54 #include "gr55xx_hal.h"
55 #include "app_drv_error.h"
56
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60
61 #ifdef HAL_DUAL_TIMER_MODULE_ENABLED
62
70 typedef enum
71 {
72 APP_DUAL_TIM_ID_0,
73 APP_DUAL_TIM_ID_1,
74 APP_DUAL_TIM_ID_MAX
75 } app_dual_tim_id_t;
76
80 typedef enum
81 {
82 APP_DUAL_TIM_EVT_ERROR,
83 APP_DUAL_TIM_EVT_DONE
84 } app_dual_tim_evt_t;
94 typedef struct
95 {
96 app_dual_tim_id_t id;
97 dual_timer_init_t init;
98 } app_dual_tim_params_t;
99
103 typedef void (*app_dual_tim_evt_handler_t)(app_dual_tim_evt_t *p_evt);
104
107 /* Exported functions --------------------------------------------------------*/
123 uint16_t app_dual_tim_init(app_dual_tim_params_t *p_params, app_dual_tim_evt_handler_t evt_handler);
124
134 uint16_t app_dual_tim_deinit(app_dual_tim_id_t id);
135
145 uint16_t app_dual_tim_start(app_dual_tim_id_t id);
146
156 uint16_t app_dual_tim_stop(app_dual_tim_id_t id);
157
169 uint16_t app_dual_tim_set_params(app_dual_tim_params_t *p_params, app_dual_tim_id_t id);
170
182 uint16_t app_dual_tim_set_background_reload(app_dual_tim_id_t id, uint32_t reload_value);
183
193 dual_timer_handle_t *app_dual_tim_get_handle(app_dual_tim_id_t id);
194
197 #endif
198
199 #ifdef __cplusplus
200 }
201 #endif
202
203 #endif
204
APP_DUAL_TIM_EVT_ERROR
@ APP_DUAL_TIM_EVT_ERROR
Definition: app_dual_tim.h:82
app_dual_tim_params_t
DUAL_TIM parameters structure definition.
Definition: app_dual_tim.h:95
app_dual_tim_evt_t
app_dual_tim_evt_t
DUAL_TIM event Enumerations definition.
Definition: app_dual_tim.h:81
app_dual_tim_set_params
uint16_t app_dual_tim_set_params(app_dual_tim_params_t *p_params, app_dual_tim_id_t id)
Set the APP DUAL TIM according to the specified parameters.
app_dual_tim_params_t::init
dual_timer_init_t init
Definition: app_dual_tim.h:97
app_dual_tim_get_handle
dual_timer_handle_t * app_dual_tim_get_handle(app_dual_tim_id_t id)
Return the DUAL TIM handle.
app_dual_tim_params_t::id
app_dual_tim_id_t id
Definition: app_dual_tim.h:96
app_dual_tim_set_background_reload
uint16_t app_dual_tim_set_background_reload(app_dual_tim_id_t id, uint32_t reload_value)
Set the APP DUAL TIM background reload value The background reload value contains the value from whic...
app_dual_tim_evt_handler_t
void(* app_dual_tim_evt_handler_t)(app_dual_tim_evt_t *p_evt)
APP_DUAL_TIM event callback definition.
Definition: app_dual_tim.h:103
_dual_timer_handle
DUAL_TIMER handle Structure definition.
Definition: gr55xx_hal_dual_tim.h:119
app_dual_tim_id_t
app_dual_tim_id_t
APP_DUAL_TIM module Enumerations definition.
Definition: app_dual_tim.h:71
APP_DUAL_TIM_ID_1
@ APP_DUAL_TIM_ID_1
Definition: app_dual_tim.h:73
APP_DUAL_TIM_ID_0
@ APP_DUAL_TIM_ID_0
Definition: app_dual_tim.h:72
_dual_timer_init
DUAL TIMER init Structure definition.
Definition: gr55xx_hal_dual_tim.h:98
APP_DUAL_TIM_ID_MAX
@ APP_DUAL_TIM_ID_MAX
Definition: app_dual_tim.h:74
APP_DUAL_TIM_EVT_DONE
@ APP_DUAL_TIM_EVT_DONE
Definition: app_dual_tim.h:83
app_dual_tim_stop
uint16_t app_dual_tim_stop(app_dual_tim_id_t id)
Stops the DUAL TIM counter in interrupt mode.
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_dual_tim_start
uint16_t app_dual_tim_start(app_dual_tim_id_t id)
Starts the DUAL TIM counter in interrupt mode.
app_dual_tim_deinit
uint16_t app_dual_tim_deinit(app_dual_tim_id_t id)
De-initialize the APP DUAL TIM DRIVER peripheral.
app_drv_error.h
Header file of app driver error code.
app_dual_tim_init
uint16_t app_dual_tim_init(app_dual_tim_params_t *p_params, app_dual_tim_evt_handler_t evt_handler)
Initialize the APP DUAL TIM DRIVER according to the specified parameters in the app_dual_tim_params_t...