2067 |
kakl |
1 |
// |
|
|
2 |
// definitions.h - Include file for general definitions |
|
|
3 |
// |
|
|
4 |
|
|
|
5 |
#ifndef _DEFINITIONS_H_ |
|
|
6 |
#define _DEFINITIONS_H_ |
|
|
7 |
|
|
|
8 |
#include "common.h" |
|
|
9 |
#include <STM32F_Common.h> |
|
|
10 |
|
|
|
11 |
extern vu32 g_nFlags; |
|
|
12 |
#define g_flgTimerReady (*((vu32*)BITBAND_SRAM(&g_nFlags, 0))) |
|
|
13 |
|
|
|
14 |
//********************************************************** |
|
|
15 |
//Definitions for STM32F_Common module - clock subsystem |
|
|
16 |
#define RCC_USE_HCE |
|
|
17 |
|
|
|
18 |
#define SET_FLASH_Latency (FLASH_Latency_2 | FLASH_PrefetchBuffer_Enable) |
|
|
19 |
|
|
|
20 |
#define CLK_Config |
|
|
21 |
#define AHB_CLK_Div RCC_SYSCLK_Div1 |
|
|
22 |
#define APB1_CLK_Div RCC_HCLK_Div2 |
|
|
23 |
#define APB2_CLK_Div RCC_HCLK_Div1 |
|
|
24 |
|
|
|
25 |
#define RCC_USE_PLL |
|
|
26 |
#define RCC_PLL_MUL RCC_PLLMul_9 |
|
|
27 |
#define RCC_PLL_DIV RCC_PLLSource_HSE_Div1 |
|
|
28 |
|
|
|
29 |
//********************************************************** |
|
|
30 |
//Definitions for Timer module |
|
|
31 |
#define SYSTEM_CLOCK 72000000 |
|
|
32 |
#define SYS_CLOCK_DIV8 |
|
|
33 |
// 0x15F90 = 90000 = 72000000 / 8 / 100 ~ 10 msec |
|
|
34 |
// 0x0EA60 = 60000 = 48000000 / 8 / 100 ~ 10 msec |
|
|
35 |
// 0x07530 = 30000 = 24000000 / 8 / 100 ~ 10 msec |
|
|
36 |
// 0x02710 = 10000 = 08000000 / 8 / 100 ~ 10 msec |
|
|
37 |
#define CounterPreset 0x15F90 |
|
|
38 |
|
|
|
39 |
#define NumOfTimers 8 |
|
|
40 |
|
|
|
41 |
//#define _USE_DELAY_US_ |
|
|
42 |
|
|
|
43 |
#endif |