| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Cpu.c
Go to the documentation of this file.
1 /** ###################################################################
2 ** This component module is generated by Processor Expert. Do not modify it.
3 ** Filename : Cpu.c
4 ** Project : ISF2P2_K64F_MQX_PROJ
5 ** Processor : MK64FN1M0VLL12
6 ** Component : MK64FN1M0LL12_4SDK
7 ** Version : Component 1.2.0, Driver 01.00, CPU db: 3.00.000
8 ** Repository : KSDK 1.2.0
9 ** Datasheet : K64P144M120SF5RM, Rev.2, January 2014
10 ** Compiler : GNU C Compiler
11 ** Date/Time : 2016-10-06, 13:38, # CodeGen: 0
12 ** Abstract :
13 **
14 ** Settings :
15 **
16 ** Contents :
17 ** SystemInit - void SystemInit(void);
18 ** SystemCoreClockUpdate - void SystemCoreClockUpdate(void);
19 **
20 ** (c) Freescale Semiconductor, Inc.
21 ** 2004 All Rights Reserved
22 **
23 ** Copyright : 1997 - 2015 Freescale Semiconductor, Inc.
24 ** All Rights Reserved.
25 **
26 ** Redistribution and use in source and binary forms, with or without modification,
27 ** are permitted provided that the following conditions are met:
28 **
29 ** o Redistributions of source code must retain the above copyright notice, this list
30 ** of conditions and the following disclaimer.
31 **
32 ** o Redistributions in binary form must reproduce the above copyright notice, this
33 ** list of conditions and the following disclaimer in the documentation and/or
34 ** other materials provided with the distribution.
35 **
36 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
37 ** contributors may be used to endorse or promote products derived from this
38 ** software without specific prior written permission.
39 **
40 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
41 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
42 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
44 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
45 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
47 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
49 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 **
51 ** http: www.freescale.com
52 ** mail: support@freescale.com
53 ** ###################################################################*/
54 /*!
55 ** @file Cpu.c
56 ** @version 01.00
57 ** @brief
58 **
59 */
60 /*!
61 ** @addtogroup Cpu_module Cpu module documentation
62 ** @{
63 */
64
65 /* MODULE Cpu. */
66
67 /* {Default RTOS Adapter} No RTOS includes */
68 #include "Cpu.h"
69 #include "Events.h"
70 #include "rtos_main_task.h"
71 #include "os_tasks.h"
72 #include "App1_Functions.h"
73 #include "BasicApp1_Functions.h"
74 #include "fsl_Sensor_Custom_1_Functions.h"
75 #include "fsl_Sensor_Analog_1_Functions.h"
76
77
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81
82 /*
83 ** ===================================================================
84 ** Method : Common_Init (component MK64FN1M0LL12_4SDK)
85 ** Description :
86 ** Initialization of registers for that there is no
87 ** initialization component.
88 ** Parameters : None
89 ** Returns : Nothing
90 ** ===================================================================
91 */
92 #if CPU_COMMON_INIT
93 void Common_Init(void)
94 {
95 }
96
97 #endif /* CPU_COMMON_INIT */
98 /*
99 ** ===================================================================
100 ** Method : Components_Init (component MK64FN1M0LL12_4SDK)
101 ** Description :
102 ** Initialization of components (with exception for Peripheral
103 ** Initialization Components which are initialized in
104 ** Peripherals_Init() method).
105 ** For example, if automatic initialization feature
106 ** is enabled in LDD component then its Init method call
107 ** is executed in Components_Init() method.
108 ** Parameters : None
109 ** Returns : Nothing
110 ** ===================================================================
111 */
112 #if CPU_COMPONENTS_INIT
113 void Components_Init(void)
114 {
115
116 /*! ISF_I2C1 Auto initialization start */
117 NVIC_SetPriority(I2C1_IRQn, 7U);
118 OSA_InstallIntHandler(I2C1_IRQn, ISF_I2C1_IRQHandler);
119 I2C_DRV_MasterInit(FSL_ISF_I2C1, &ISF_I2C1_MasterState);
120 I2C_DRV_MasterSetBaudRate(FSL_ISF_I2C1, &ISF_I2C1_MasterConfig0);
121 /*! ISF_I2C1 Auto initialization end */
122
123 /* ### ISF_KSDK_CommChannel_I2C "I2C1" init code ... */
124 /* Write code here ... */
125 /*! ISF_UART1 Auto initialization start */
126 NVIC_SetPriority(UART0_RX_TX_IRQn, 7U);
127 OSA_InstallIntHandler(UART0_RX_TX_IRQn, ISF_UART1_IRQHandler);
128 UART_DRV_Init(FSL_ISF_UART1,&ISF_UART1_State,&ISF_UART1_InitConfig0);
129 /*! ISF_UART1 Auto initialization end */
130 /* ### ISF_KSDK_CommChannel_UART "UART2" init code ... */
131 uart_user_init(FSL_ISF_UART1, &UART2_UserDefinedVars);
132 /*! ISF_SPI1 Auto initialization start */
133 NVIC_SetPriority(SPI0_IRQn, 7U);
134 OSA_InstallIntHandler(SPI0_IRQn, ISF_SPI1_IRQHandler);
135 DSPI_DRV_MasterInit(FSL_ISF_SPI1, &ISF_SPI1_MasterState, &ISF_SPI1_MasterConfig0);
136 DSPI_DRV_MasterConfigureBus(FSL_ISF_SPI1, &ISF_SPI1_BusConfig0, &ISF_SPI1_calculatedBaudRate);
137 /*! ISF_SPI1 Auto initialization end */
138
139 /* ### ISF_KSDK_CommChannel_SPI "SPI1" init code ... */
140 /* Write code here ... */
141 /* ### ISF_KSDK_CI_Protocol "Protocol1" init code ... */
142 /* Write code here ... */
143 /* ### ISF_KSDK_Sensor_Custom_Adaptor "Custom_1" init code ... */
144 /* Write code here ... */
145 /* ### ISF_KSDK_Sensor_FXAS21002_Gyrometer "FXAS21002_1" init code ... */
146 /* Write code here ... */
147 /*! SensorReset Auto initialization start */
148 GPIO_DRV_Init(NULL,ResetSensor_OutConfig0);
149 /*! SensorReset Auto initialization end */
150
151 /* ### ISF_KSDK_Sensor_FXAS21002_Gyrometer "FXAS21002_2" init code ... */
152 /* Write code here ... */
153 /* ### ISF_KSDK_Sensor_FXLC95000_Accelerometer "FXLC95000_1" init code ... */
154 /* Write code here ... */
155 /*! SPIChipSelect Auto initialization start */
156 GPIO_DRV_Init(NULL,ChipSelect_OutConfig0);
157 /*! SPIChipSelect Auto initialization end */
158
159 /*! SPISelect Auto initialization start */
160 GPIO_DRV_Init(NULL,SPISelect_OutConfig0);
161 /*! SPISelect Auto initialization end */
162
163 /*! ResetSensor Auto initialization start */
164 GPIO_DRV_Init(NULL,ResetSensor_OutConfig0);
165 /*! ResetSensor Auto initialization end */
166
167 /* ### ISF_KSDK_Sensor_FXLC95000_Accelerometer "FXLC95000_2" init code ... */
168 /* Write code here ... */
169 /* ### ISF_KSDK_Sensor_FXLS8471_Accelerometer "FXLS8471_1" init code ... */
170 /* Write code here ... */
171 /* ### ISF_KSDK_Sensor_FXLS8952_Accelerometer "FXLS8952_1" init code ... */
172 /* Write code here ... */
173 /* ### ISF_KSDK_Sensor_FXLS8471_Accelerometer "FXLS8471_2" init code ... */
174 /* Write code here ... */
175 /* ### ISF_KSDK_Sensor_FXOS8700_ECompass "FXOS8700_1" init code ... */
176 /* Write code here ... */
177 /* ### ISF_KSDK_Sensor_FXOS8700_ECompass "FXOS8700_2" init code ... */
178 /* Write code here ... */
179 /*! ADC1 Auto initialization start */
180 ADC16_DRV_Init(FSL_ADC1, &ADC1_InitConfig0);
181 ADC16_DRV_ConfigConvChn(FSL_ADC1, 0U, &ADC1_ChnConfig0);
182 /*! ADC1 Auto initialization end */
183
184 /* ### ISF_KSDK_Sensor_Generic_Analog "Analog_1" init code ... */
185 /* Write code here ... */
186 /* ### ISF_KSDK_Sensor_MAG3110_Magnetometer "MAG3110_1" init code ... */
187 /* Write code here ... */
188 /*! SensorEnable Auto initialization start */
189 GPIO_DRV_Init(NULL,SensorEnable_OutConfig0);
190 /*! SensorEnable Auto initialization end */
191
192 /*! OutX Auto initialization start */
193 GPIO_DRV_Init(OutX_OutConfig0,NULL);
194 /*! OutX Auto initialization end */
195
196 /*! OutY Auto initialization start */
197 GPIO_DRV_Init(OutY_OutConfig0,NULL);
198 /*! OutY Auto initialization end */
199
200 /*! OutZ Auto initialization start */
201 GPIO_DRV_Init(OutZ_OutConfig0,NULL);
202 /*! OutZ Auto initialization end */
203
204 /* ### ISF_KSDK_Sensor_MMA8491Q_Accelerometer "MMA8491Q_1" init code ... */
205 /* Write code here ... */
206 /* ### ISF_KSDK_Sensor_MMA865x_Accelerometer "MMA865x_1" init code ... */
207 /* Write code here ... */
208 /* ### ISF_KSDK_Sensor_MMA955x_Pedometer "MMA955x_1" init code ... */
209 /* Write code here ... */
210 /*! ChipSelect Auto initialization start */
211 GPIO_DRV_Init(NULL,ChipSelect_OutConfig0);
212 /*! ChipSelect Auto initialization end */
213
214 /* ### ISF_KSDK_Sensor_MMA955x_Pedometer "MMA955x_2" init code ... */
215 /* Write code here ... */
216 /* ### ISF_KSDK_Sensor_MPL3115_Pressure "MPL3115_1" init code ... */
217 /* Write code here ... */
218 /* ### ISF_KSDK_Sensor_Virtual_Orientation "ORIENT_1" init code ... */
219 /* Write code here ... */
220 /*! BMTIMER1 Auto initialization start */
221 PIT_DRV_Init(FSL_BMTIMER1,true);
222 PIT_DRV_InitChannel(FSL_BMTIMER1,FSL_BMTIMER1_CHANNEL,&BMTIMER1_InitConfig0);
223 PIT_DRV_StartTimer(FSL_BMTIMER1,FSL_BMTIMER1_CHANNEL);
224 /*! BMTIMER1 Auto initialization end */
225 /* ### ISF_KSDK_BusManager "ISFBusManager1" init code ... */
226 /* Write code here ... */
227 /*! EventHandler_Task1 Auto initialization start */
228 (void)EventHandler_Task1_Init();
229 /*! EventHandler_Task1 Auto initialization end */
230 /* ### ISF_KSDK_Protocol_Adapter "CommChannelConfig1" init code ... */
231 /* Write code here ... */
232 /* ### ISF_KSDK_Core "ISFCore1" init code ... */
233 /* Write code here ... */
234 /* ### ISF_KSDK_EmbApp "App1" init code ... */
235 App1_init();
236 /* ### ISF_KSDK_BasicApp "BasicApp1" init code ... */
237 BasicApp1_init();
238 /* ### ISF_KSDK_RLI "RLI1" init code ... */
239 RLI1_init();
240 }
241 #endif /* CPU_COMPONENTS_INIT */
242
243
244 #ifdef __cplusplus
245 }
246 #endif
247
248 /* END Cpu. */
249
Cpu.h
ISF_UART1_IRQHandler
void ISF_UART1_IRQHandler(void)
Definition: ISF_UART1.c:74
ChipSelect_OutConfig0
const gpio_output_pin_user_config_t ChipSelect_OutConfig0[]
Configuration structure 0 for output pins.
Definition: ChipSelect.c:56
FSL_ISF_I2C1
#define FSL_ISF_I2C1
Device instance number.
Definition: ISF_I2C1.h:91
ISF_SPI1_BusConfig0
const dspi_device_t ISF_SPI1_BusConfig0
Master bus configuration declaration.
Definition: ISF_SPI1.c:60
fsl_Sensor_Analog_1_Functions.h
This is user's event module. Put your event handler code here.
App1_init
void App1_init(void)
Definition: App1.c:397
EventHandler_Task1_Init
osa_status_t EventHandler_Task1_Init(void)
Definition: EventHandler_Task1.c:74
OutY_OutConfig0
const gpio_input_pin_user_config_t OutY_OutConfig0[]
Configuration structure 0 for input pins.
Definition: OutY.c:56
BMTIMER1_InitConfig0
const pit_user_config_t BMTIMER1_InitConfig0
PIT configuration declaration.
Definition: BMTIMER1.c:57
UART2_UserDefinedVars
const uart_UserDefinedVars_t UART2_UserDefinedVars
Definition: UART2.c:44
Components_Init
void Components_Init(void)
Definition: Cpu.c:113
App1_Functions.h
This is user's event module. Put your event handler code here.
ISF_UART1_State
uart_state_t ISF_UART1_State
Definition: ISF_UART1.c:70
FSL_ISF_UART1
#define FSL_ISF_UART1
Definition: ISF_UART1.h:77
FSL_ISF_SPI1
#define FSL_ISF_SPI1
Device instance number.
Definition: ISF_SPI1.h:79
ResetSensor_OutConfig0
const gpio_output_pin_user_config_t ResetSensor_OutConfig0[]
Configuration structure 0 for output pins.
Definition: ResetSensor.c:56
FSL_BMTIMER1_CHANNEL
#define FSL_BMTIMER1_CHANNEL
PIT timer channel.
Definition: BMTIMER1.h:79
ISF_I2C1_MasterState
i2c_master_state_t ISF_I2C1_MasterState
Driver state structure which holds driver runtime data.
Definition: ISF_I2C1.c:57
ISF_UART1_InitConfig0
const uart_user_config_t ISF_UART1_InitConfig0
UART configuration declaration.
Definition: ISF_UART1.c:61
FSL_BMTIMER1
#define FSL_BMTIMER1
Device instance number.
Definition: BMTIMER1.h:77
SPISelect_OutConfig0
const gpio_output_pin_user_config_t SPISelect_OutConfig0[]
Configuration structure 0 for output pins.
Definition: SPISelect.c:56
SensorEnable_OutConfig0
const gpio_output_pin_user_config_t SensorEnable_OutConfig0[]
Configuration structure 0 for output pins.
Definition: SensorEnable.c:56
OutX_OutConfig0
const gpio_input_pin_user_config_t OutX_OutConfig0[]
Configuration structure 0 for input pins.
Definition: OutX.c:56
ISF_I2C1_MasterConfig0
const i2c_device_t ISF_I2C1_MasterConfig0
Master configuration declaration.
Definition: ISF_I2C1.c:60
ISF_SPI1_calculatedBaudRate
uint32_t ISF_SPI1_calculatedBaudRate
Driver calculated baudrate is returned from DSPI_DRV_MasterInit() call. Generated due to enabled auto...
Definition: ISF_SPI1.c:58
ADC1_ChnConfig0
const adc16_chn_config_t ADC1_ChnConfig0
Channel configuration declaration.
Definition: ADC1.c:81
RLI1_init
void RLI1_init(void)
Definition: RLI1.c:87
Events.h
This is user's event module. Put your event handler code here.
uart_user_init
uart_status_t uart_user_init(uint32_t instance, const uart_UserDefinedVars_t *userDefinedVars)
Initializes UART User defined parameters.
Definition: isf_uart_adapter.c:432
BasicApp1_init
void BasicApp1_init(void)
Definition: BasicApp1.c:683
ISF_SPI1_MasterConfig0
const dspi_master_user_config_t ISF_SPI1_MasterConfig0
Master configuration declaration.
Definition: ISF_SPI1.c:68
ADC1_InitConfig0
const adc16_converter_config_t ADC1_InitConfig0
ADC configuration declaration.
Definition: ADC1.c:57
FSL_ADC1
#define FSL_ADC1
Device instance number.
Definition: ADC1.h:76
BasicApp1_Functions.h
This is user's event module. Put your event handler code here.
OutZ_OutConfig0
const gpio_input_pin_user_config_t OutZ_OutConfig0[]
Configuration structure 0 for input pins.
Definition: OutZ.c:56
ISF_SPI1_MasterState
dspi_master_state_t ISF_SPI1_MasterState
Driver state structure. Generated due to enabled auto initialization.
Definition: ISF_SPI1.c:57
fsl_Sensor_Custom_1_Functions.h
This is user's event module. Put your event handler code here.
ISF_I2C1_IRQHandler
void ISF_I2C1_IRQHandler(void)
Definition: Events.c:74
ISF_SPI1_IRQHandler
void ISF_SPI1_IRQHandler(void)
Definition: Events.c:63
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.