• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2022 Beken Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 
16 #pragma once
17 
18 #include <driver/hal/hal_timer_types.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /**
25  * @brief Timer APIs
26  * @addtogroup bk_api_timer Timer API group
27  * @{
28  */
29 
30 /**
31  * @brief Timer defines
32  * @defgroup bk_api_timer_defs macos
33  * @ingroup bk_api_timer
34  * @{
35  */
36 
37 #define BK_ERR_TIMER_ID              (BK_ERR_TIMER_BASE - 1) /**< timer id is invalid */
38 #define BK_ERR_TIMER_NOT_INIT        (BK_ERR_TIMER_BASE - 2) /**< timer driver not init */
39 #define BK_ERR_TIMER_IS_RUNNING      (BK_ERR_TIMER_BASE - 3) /**< timer id is running */
40 #define BK_ERR_TIMER_ID_ON_DEFCONFIG     (BK_ERR_TIMER_BASE - 4) /**< timer id is error */
41 
42 /**
43  * @brief Timer interrupt service routine
44  */
45 typedef void (*timer_isr_t)(timer_id_t timer_id);
46 
47 /**
48  * @}
49  */
50 
51 /**
52  * @}
53  */
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59