Subversion Repositories EDIS_Ignition

Rev

Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 21
Line 21... Line 21...
21
/* Define to prevent recursive inclusion -------------------------------------*/
21
/* Define to prevent recursive inclusion -------------------------------------*/
22
#ifndef __MAIN_H
22
#ifndef __MAIN_H
23
#define __MAIN_H
23
#define __MAIN_H
24
 
24
 
25
#ifdef __cplusplus
25
#ifdef __cplusplus
26
extern "C" {
26
extern "C"
-
 
27
{
27
#endif
28
#endif
28
 
29
 
29
/* Includes ------------------------------------------------------------------*/
30
/* Includes ------------------------------------------------------------------*/
30
#include "stm32f1xx_hal.h"
31
#include "stm32f1xx_hal.h"
31
 
32
 
32
/* Private includes ----------------------------------------------------------*/
33
  /* Private includes ----------------------------------------------------------*/
33
/* USER CODE BEGIN Includes */
34
  /* USER CODE BEGIN Includes */
34
 
35
 
35
/* USER CODE END Includes */
36
  /* USER CODE END Includes */
36
 
37
 
37
/* Exported types ------------------------------------------------------------*/
38
  /* Exported types ------------------------------------------------------------*/
38
/* USER CODE BEGIN ET */
39
  /* USER CODE BEGIN ET */
39
 
40
 
40
/* USER CODE END ET */
41
  /* USER CODE END ET */
41
 
42
 
42
/* Exported constants --------------------------------------------------------*/
43
  /* Exported constants --------------------------------------------------------*/
43
/* USER CODE BEGIN EC */
44
  /* USER CODE BEGIN EC */
44
  extern SPI_HandleTypeDef hspi1;
45
  extern SPI_HandleTypeDef hspi1;
45
  extern TIM_HandleTypeDef htim2; // using Timer 2 for RPM counting via PIP signal
46
  extern TIM_HandleTypeDef htim2; // using Timer 2 for RPM counting via PIP signal
46
/* USER CODE END EC */
47
/* USER CODE END EC */
47
 
48
 
48
/* Exported macro ------------------------------------------------------------*/
49
/* Exported macro ------------------------------------------------------------*/
Line 50... Line 51...
50
#define RPMTIMER 2 // define the timer
51
#define RPMTIMER 2 // define the timer
51
#define AUXILIARY_HIGH {};
52
#define AUXILIARY_HIGH {};
52
#define AUXILIARY_LOW triggerSAW();
53
#define AUXILIARY_LOW triggerSAW();
53
  // scale for filtered RPM samples
54
  // scale for filtered RPM samples
54
  static const float Scale = 1.0;
55
  static const float Scale = 1.0;
55
/* USER CODE END EM */
56
  /* USER CODE END EM */
56
 
57
 
57
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
58
  void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
58
 
59
 
59
/* Exported functions prototypes ---------------------------------------------*/
60
  /* Exported functions prototypes ---------------------------------------------*/
60
void Error_Handler(void);
61
  void Error_Handler(void);
61
 
62
 
62
/* USER CODE BEGIN EFP */
63
  /* USER CODE BEGIN EFP */
63
extern void triggerSAW();
64
  extern void triggerSAW();
64
/* USER CODE END EFP */
65
/* USER CODE END EFP */
65
 
66
 
66
/* Private defines -----------------------------------------------------------*/
67
/* Private defines -----------------------------------------------------------*/
67
#define SAW_DELAY 5
68
#define SAW_DELAY 5
68
#define LED_Pin GPIO_PIN_13
69
#define LED_Pin GPIO_PIN_13
Line 80... Line 81...
80
#define SAW_Pin GPIO_PIN_8
81
#define SAW_Pin GPIO_PIN_8
81
#define SAW_GPIO_Port GPIOA
82
#define SAW_GPIO_Port GPIOA
82
#define dualSpark_Pin GPIO_PIN_9
83
#define dualSpark_Pin GPIO_PIN_9
83
#define dualSpark_GPIO_Port GPIOA
84
#define dualSpark_GPIO_Port GPIOA
84
 
85
 
85
/* USER CODE BEGIN Private defines */
86
  /* USER CODE BEGIN Private defines */
86
 
87
 
87
/* USER CODE END Private defines */
88
  /* USER CODE END Private defines */
88
 
89
 
89
#ifdef __cplusplus
90
#ifdef __cplusplus
90
}
91
}
91
#endif
92
#endif
92
 
93