Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hwconfig.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * (c) Copyright 2010, Freescale Semiconductor Inc.
3  * ALL RIGHTS RESERVED.
4  ***************************************************************************/
11 #ifndef __HWCONFIG_H
12 #define __HWCONFIG_H
13 
14 /******************************************************************************
15 * Constants
16 ******************************************************************************/
17 /*
18  [powerstage signal] [elevator signal] [cpu signal]
19  I_SENSE_DCB AN6 ADC0_SE4/PTE21
20  BEMF_SENSE_A/B/C AN0/1/2 ADC0_SE6=PTE18 / ADC0_SE9|PTB1 / ADC0_SE7|PTE19
21  V_SENSE_DCB AN4 ADC0_SE5/PTE17
22 */
23 
24 #define ADC_CHANNEL_DCBI 4
25 #define ADC_CHANNEL_DCBV 5
26 #define ADC_CHANNEL_PHASEA 6
27 #define ADC_CHANNEL_PHASEB 9
28 #define ADC_CHANNEL_PHASEC 7
29 #define ADC_CHANNEL_DISABLED 31
30 
31 #define ISR_PRIORITY_ADC0 1 // zero-cross, sensorless control
32 #define ISR_PRIORITY_SLOW_TIMER 3 // speed control loop (low ISR priority)
33 #define ISR_PRIORITY_FORCED_CMT 1 // forced commutation (when missed sensorless cmt, open loop, timing)
34 #define ISR_PRIORITY_PDB0 1 // PDB trigger error clearing
35 
36 #define CPU_CLOCK 72000000UL
37 #define BUS_CLOCK (CPU_CLOCK / 3)
38 #define TIMER_FREQUENCY (CPU_CLOCK / 128) // 585.9375 kHz @ 75 MHz, 562.5 kHz @ 72 MHz
39 #define TIMER_1MS_CONST (TIMER_FREQUENCY / 1000)
40 #define SLOW_TIMER_PERIOD (CPU_CLOCK / 2000) // 1 ms period (slow control timer uses divider by 2 and cpu clock)
41 #define PWM_MODULO 3600 // 20 kHz = 3750 @ 75 MHz, 3600 @ 72 MHz
42 #define UART_BAUDRATE 9600
43 
44 /******************************************************************************
45 * Types
46 ******************************************************************************/
47 typedef struct
48 {
49  char mask;
50  char swap;
52 
53 /******************************************************************************
54 * Global variables
55 ******************************************************************************/
56 extern const unsigned short bldcAdcSectorCfg[8];
58 
59 /******************************************************************************/
60 #endif /* __HWCONFIG_H */
char swap
Definition: hwconfig.h:50
char mask
Definition: hwconfig.h:49
Definition: hwconfig.h:47
const unsigned short bldcAdcSectorCfg[8]
Definition: peripherals_init.c:47
const Pwm_sChannelControl bldcCommutationTableComp[8]
Definition: peripherals_init.c:36