1 /*
2  * ==========================================================
3  *
4  *    Copyright (C) 2020 QuickLogic Corporation
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  * 		http://www.apache.org/licenses/LICENSE-2.0
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  *    File      : eoss3_hal_pmu_timer.h
16  *    Purpose   : This file contains macros, structures and APIs to
17  *             for M4 peripheral timer
18  *
19  *
20  * ===========================================================
21  *
22  */
23 
24 #ifndef HAL_INC_EOSS3_HAL_PMU_TIMER_H_
25 #define HAL_INC_EOSS3_HAL_PMU_TIMER_H_
26 
27 #include <stdint.h>
28 #include <stddef.h>
29 
30 #include "test_types.h"
31 #include "eoss3_hal_def.h"
32 
33 typedef struct __PMU_Timer_HandleTypeDef
34 {
35      UINT32_t   timerReload_val;
36      void (*timer_callback) (void *args);
37 }PMU_Timer_HandleTypeDef;
38 
39 #define MAX_TIMER_COUNT  1
40 #define MSEC_PER_TICK   1.953125f
41 
42 HAL_StatusTypeDef HAL_PMU_Set_Timer(UINT32_t timerLoadVal, void (*callbackFn) (void *args));
43 UINT32_t HAL_PMU_Disable_Timer( );
44 HAL_StatusTypeDef HAL_PMU_Timer_Interrupt_Callback();
45 
46 #endif /* HAL_INC_EOSS3_HAL_PMU_TIMER_H_ */
47