| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bm_timer.c
Go to the documentation of this file.
1
2
3 #include "isf_target.h"
4 #include "isf.h"
5 #include "fsl_pit_hal.h"
6 #include "fsl_pit_driver.h"
7 #include "bm_internal.h"
8 #include "bm_timer.h"
9
10
11 /*!
12 *
13 * @brief Timer initialization\n
14 *
15 * @param bEnableirq - [in] TRUE to enable timer interrupt
16 * @param usec - [in] Initial time in usec to program in timer
17 *
18 * @return \n
19 *
20 * @errors \n
21 *
22 * @constraints \n
23 *
24 * @reentrant No.
25 *
26 * @libs \n
27 *
28 * @see \n
29 *
30 */
31 void bm_timer_init(boolean bEnableirq, uint32 usec)
32 {
33 #if 0
34 pit_user_config_t pit_config = {
35 .isInterruptEnabled = bEnableirq,
36 .isTimerChained = FALSE,
37 .periodUs = usec
38 };
39 pit_init_module(FALSE);
40 pit_init_channel(ISF_BM_PIT_INSTANCE,&pit_config);
41
42 // This call will start the timer.
43 pit_set_timer_period_us(ISF_BM_PIT_INSTANCE,usec);
44
45 // Just clear the interrupt flag
46 pit_hal_clear_interrupt_flag(ISF_BM_PIT_INSTANCE);
47
48 //bm_timer_set_time(usec);
49
50 // Need to stop timer.
51 pit_timer_stop(ISF_BM_PIT_INSTANCE);
52 #endif
53
54 pit_init(bEnableirq,usec);
55
56 }
57
58
59
isf_target.h
ISF board support header files.
ISF_BM_PIT_INSTANCE
#define ISF_BM_PIT_INSTANCE
Definition: BM_pit_instance.h:2
FALSE
#define FALSE
Definition: isf_types.h:56
pit_set_timer_period_us
void pit_set_timer_period_us(uint32_t timer, uint32_t us)
Set timer period in microsecond units.
Definition: fsl_pit_driver.c:131
pit_init_module
void pit_init_module(bool isRunInDebug)
Initialize PIT module.
Definition: fsl_pit_driver.c:46
bm_timer_init
void bm_timer_init(boolean bEnableirq, uint32 usec)
Timer initialization .
Definition: bm_timer.c:31
uint32
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
pit_init
void pit_init(bool bEnableirq, uint32 usec)
Complete initialization of the PIT timer.
Definition: fsl_pit_driver.c:201
pit_init_channel
void pit_init_channel(uint32_t timer, const pit_user_config_t *config)
Initialize PIT channel.
Definition: fsl_pit_driver.c:69
pit_hal_clear_interrupt_flag
void pit_hal_clear_interrupt_flag(uint32_t timer)
Clear timer interrupt flag.
Definition: fsl_pit_hal.c:105
pit_timer_stop
void pit_timer_stop(uint32_t timer)
Stop timer counting.
Definition: fsl_pit_driver.c:118
PitUserConfig::isInterruptEnabled
bool isInterruptEnabled
Definition: fsl_pit_driver.h:39
fsl_pit_hal.h
bm_internal.h
ISF bus management internal header file.
isf.h
Main ISF header file. Contains code common to all ISF components.
fsl_pit_driver.h
fsl_pit_driver.h defines structures and types for the PIT driver.
PitUserConfig
PIT timer configuration structure.
Definition: fsl_pit_driver.h:38
bm_timer.h
Bus managment internal header file.
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.