添加编码器功能
This commit is contained in:
parent
75e2c0c116
commit
7a50a755c3
|
@ -103,6 +103,10 @@ void Error_Handler(void);
|
|||
#define LED3_G_GPIO_Port GPIOB
|
||||
#define LED3_Y_Pin GPIO_PIN_7
|
||||
#define LED3_Y_GPIO_Port GPIOE
|
||||
#define EC11_A_Pin GPIO_PIN_9
|
||||
#define EC11_A_GPIO_Port GPIOE
|
||||
#define EC11_B_Pin GPIO_PIN_11
|
||||
#define EC11_B_GPIO_Port GPIOE
|
||||
#define LED2_R_Pin GPIO_PIN_12
|
||||
#define LED2_R_GPIO_Port GPIOE
|
||||
#define LED2_G_Pin GPIO_PIN_13
|
||||
|
|
|
@ -61,8 +61,8 @@ void DMA1_Stream3_IRQHandler(void);
|
|||
void DMA1_Stream4_IRQHandler(void);
|
||||
void DMA1_Stream5_IRQHandler(void);
|
||||
void DMA1_Stream6_IRQHandler(void);
|
||||
void TIM1_UP_TIM10_IRQHandler(void);
|
||||
void TIM3_IRQHandler(void);
|
||||
void TIM4_IRQHandler(void);
|
||||
void USART2_IRQHandler(void);
|
||||
void USART3_IRQHandler(void);
|
||||
void DMA1_Stream7_IRQHandler(void);
|
||||
|
|
|
@ -32,6 +32,8 @@ extern "C" {
|
|||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern TIM_HandleTypeDef htim1;
|
||||
|
||||
extern TIM_HandleTypeDef htim2;
|
||||
|
||||
extern TIM_HandleTypeDef htim3;
|
||||
|
@ -84,6 +86,7 @@ extern TIM_HandleTypeDef htim3;
|
|||
} while (__LINE__ == -1)
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_TIM1_Init(void);
|
||||
void MX_TIM2_Init(void);
|
||||
void MX_TIM3_Init(void);
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "ad7124.h"
|
||||
#include "usart.h"
|
||||
#include "communication_protocol.h"
|
||||
#include "tim.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -55,10 +56,13 @@ osThreadId led_taskHandle;
|
|||
osThreadId dac_taskHandle;
|
||||
osThreadId adc_taskHandle;
|
||||
osThreadId gpio_di_do_taskHandle;
|
||||
osThreadId ec11_taskHandle;
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* USER CODE BEGIN FunctionPrototypes */
|
||||
extern float current_buff[2];
|
||||
int direction = 0;
|
||||
int encode_num = 0;
|
||||
/* USER CODE END FunctionPrototypes */
|
||||
|
||||
void start_tcp_task(void const *argument);
|
||||
|
@ -66,6 +70,7 @@ void start_led_toggle_task(void const *argument);
|
|||
void start_dac_task(void const *argument);
|
||||
void start_adc_task(void const *argument);
|
||||
void start_gpio_di_do_task(void const *argument);
|
||||
void start_ec11_task(void const *argument);
|
||||
|
||||
extern void MX_LWIP_Init(void);
|
||||
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */
|
||||
|
@ -134,6 +139,10 @@ void MX_FREERTOS_Init(void)
|
|||
osThreadDef(gpio_di_do_task, start_gpio_di_do_task, osPriorityNormal, 0, 128);
|
||||
gpio_di_do_taskHandle = osThreadCreate(osThread(gpio_di_do_task), NULL);
|
||||
|
||||
/* definition and creation of ec11_task */
|
||||
osThreadDef(ec11_task, start_ec11_task, osPriorityNormal, 0, 128);
|
||||
ec11_taskHandle = osThreadCreate(osThread(ec11_task), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
@ -263,11 +272,31 @@ void start_gpio_di_do_task(void const *argument)
|
|||
/* Infinite loop */
|
||||
for (;;)
|
||||
{
|
||||
osDelay(1);
|
||||
vTaskDelay(500);
|
||||
}
|
||||
/* USER CODE END start_gpio_di_do_task */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN Header_start_ec11_task */
|
||||
/**
|
||||
* @brief Function implementing the ec11_task thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_start_ec11_task */
|
||||
void start_ec11_task(void const *argument)
|
||||
{
|
||||
/* USER CODE BEGIN start_ec11_task */
|
||||
/* Infinite loop */
|
||||
for (;;)
|
||||
{
|
||||
direction = __HAL_TIM_IS_TIM_COUNTING_DOWN(&htim1);
|
||||
encode_num = (short)__HAL_TIM_GET_COUNTER(&htim1);
|
||||
osDelay(1);
|
||||
}
|
||||
/* USER CODE END start_ec11_task */
|
||||
}
|
||||
|
||||
/* Private application code --------------------------------------------------*/
|
||||
/* USER CODE BEGIN Application */
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ int main(void)
|
|||
|
||||
/* USER CODE END Init */
|
||||
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
|
@ -117,6 +116,7 @@ int main(void)
|
|||
MX_UART5_Init();
|
||||
MX_USART2_UART_Init();
|
||||
MX_USART3_UART_Init();
|
||||
MX_TIM1_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
// HAL_GPIO_WritePin(DO_EN_GPIO_Port, DO_EN_Pin, GPIO_PIN_SET); // DO输出使能
|
||||
|
||||
|
@ -127,6 +127,7 @@ int main(void)
|
|||
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, hart2_uart2.rx_data_temp, ARRAY_LEN(hart2_uart2.rx_data_temp));
|
||||
hart_ht1200m_reset(); // 初始化HT1200M模块
|
||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); // PWM输出,用于驱动HT1200M模块
|
||||
HAL_TIM_Encoder_Start(&htim1, TIM_CHANNEL_ALL);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Call init function for freertos objects (in freertos.c) */
|
||||
|
@ -259,7 +260,7 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
|
|||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM1 interrupt took place, inside
|
||||
* @note This function is called when TIM4 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
|
@ -270,7 +271,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
|||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM1) {
|
||||
if (htim->Instance == TIM4) {
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
TIM_HandleTypeDef htim1;
|
||||
TIM_HandleTypeDef htim4;
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief This function configures the TIM1 as a time base source.
|
||||
* @brief This function configures the TIM4 as a time base source.
|
||||
* The time source is configured to have 1ms time base with a dedicated
|
||||
* Tick interrupt priority.
|
||||
* @note This function is called automatically at the beginning of program after
|
||||
|
@ -41,54 +41,63 @@ TIM_HandleTypeDef htim1;
|
|||
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||
{
|
||||
RCC_ClkInitTypeDef clkconfig;
|
||||
uint32_t uwTimclock = 0U;
|
||||
uint32_t uwTimclock, uwAPB1Prescaler = 0U;
|
||||
|
||||
uint32_t uwPrescalerValue = 0U;
|
||||
uint32_t pFLatency;
|
||||
HAL_StatusTypeDef status;
|
||||
|
||||
/* Enable TIM1 clock */
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
/* Enable TIM4 clock */
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
|
||||
/* Get clock configuration */
|
||||
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
|
||||
|
||||
/* Compute TIM1 clock */
|
||||
uwTimclock = 2*HAL_RCC_GetPCLK2Freq();
|
||||
/* Get APB1 prescaler */
|
||||
uwAPB1Prescaler = clkconfig.APB1CLKDivider;
|
||||
/* Compute TIM4 clock */
|
||||
if (uwAPB1Prescaler == RCC_HCLK_DIV1)
|
||||
{
|
||||
uwTimclock = HAL_RCC_GetPCLK1Freq();
|
||||
}
|
||||
else
|
||||
{
|
||||
uwTimclock = 2UL * HAL_RCC_GetPCLK1Freq();
|
||||
}
|
||||
|
||||
/* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */
|
||||
/* Compute the prescaler value to have TIM4 counter clock equal to 1MHz */
|
||||
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U);
|
||||
|
||||
/* Initialize TIM1 */
|
||||
htim1.Instance = TIM1;
|
||||
/* Initialize TIM4 */
|
||||
htim4.Instance = TIM4;
|
||||
|
||||
/* Initialize TIMx peripheral as follow:
|
||||
|
||||
+ Period = [(TIM1CLK/1000) - 1]. to have a (1/1000) s time base.
|
||||
+ Period = [(TIM4CLK/1000) - 1]. to have a (1/1000) s time base.
|
||||
+ Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
|
||||
+ ClockDivision = 0
|
||||
+ Counter direction = Up
|
||||
*/
|
||||
htim1.Init.Period = (1000000U / 1000U) - 1U;
|
||||
htim1.Init.Prescaler = uwPrescalerValue;
|
||||
htim1.Init.ClockDivision = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
htim4.Init.Period = (1000000U / 1000U) - 1U;
|
||||
htim4.Init.Prescaler = uwPrescalerValue;
|
||||
htim4.Init.ClockDivision = 0;
|
||||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
||||
status = HAL_TIM_Base_Init(&htim1);
|
||||
status = HAL_TIM_Base_Init(&htim4);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Start the TIM time Base generation in interrupt mode */
|
||||
status = HAL_TIM_Base_Start_IT(&htim1);
|
||||
status = HAL_TIM_Base_Start_IT(&htim4);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Enable the TIM1 global Interrupt */
|
||||
HAL_NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn);
|
||||
/* Enable the TIM4 global Interrupt */
|
||||
HAL_NVIC_EnableIRQ(TIM4_IRQn);
|
||||
/* Configure the SysTick IRQ priority */
|
||||
if (TickPriority < (1UL << __NVIC_PRIO_BITS))
|
||||
{
|
||||
/* Configure the TIM IRQ priority */
|
||||
HAL_NVIC_SetPriority(TIM1_UP_TIM10_IRQn, TickPriority, 0U);
|
||||
HAL_NVIC_SetPriority(TIM4_IRQn, TickPriority, 0U);
|
||||
uwTickPrio = TickPriority;
|
||||
}
|
||||
else
|
||||
|
@ -104,25 +113,25 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||
|
||||
/**
|
||||
* @brief Suspend Tick increment.
|
||||
* @note Disable the tick increment by disabling TIM1 update interrupt.
|
||||
* @note Disable the tick increment by disabling TIM4 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_SuspendTick(void)
|
||||
{
|
||||
/* Disable TIM1 update Interrupt */
|
||||
__HAL_TIM_DISABLE_IT(&htim1, TIM_IT_UPDATE);
|
||||
/* Disable TIM4 update Interrupt */
|
||||
__HAL_TIM_DISABLE_IT(&htim4, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resume Tick increment.
|
||||
* @note Enable the tick increment by Enabling TIM1 update interrupt.
|
||||
* @note Enable the tick increment by Enabling TIM4 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_ResumeTick(void)
|
||||
{
|
||||
/* Enable TIM1 Update interrupt */
|
||||
__HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE);
|
||||
/* Enable TIM4 Update interrupt */
|
||||
__HAL_TIM_ENABLE_IT(&htim4, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ extern UART_HandleTypeDef huart5;
|
|||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
extern UART_HandleTypeDef huart6;
|
||||
extern TIM_HandleTypeDef htim1;
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
|
@ -308,20 +308,6 @@ void DMA1_Stream6_IRQHandler(void)
|
|||
/* USER CODE END DMA1_Stream6_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM1 update interrupt and TIM10 global interrupt.
|
||||
*/
|
||||
void TIM1_UP_TIM10_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_UP_TIM10_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM1_UP_TIM10_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim1);
|
||||
/* USER CODE BEGIN TIM1_UP_TIM10_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM1_UP_TIM10_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM3 global interrupt.
|
||||
*/
|
||||
|
@ -336,6 +322,20 @@ void TIM3_IRQHandler(void)
|
|||
/* USER CODE END TIM3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM4 global interrupt.
|
||||
*/
|
||||
void TIM4_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM4_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim4);
|
||||
/* USER CODE BEGIN TIM4_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM4_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART2 global interrupt.
|
||||
*/
|
||||
|
|
|
@ -24,9 +24,55 @@
|
|||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
|
||||
/* TIM1 init function */
|
||||
void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 0 */
|
||||
|
||||
/* USER CODE END TIM1_Init 0 */
|
||||
|
||||
TIM_Encoder_InitTypeDef sConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 1 */
|
||||
|
||||
/* USER CODE END TIM1_Init 1 */
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 2;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 65535;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
sConfig.EncoderMode = TIM_ENCODERMODE_TI12;
|
||||
sConfig.IC1Polarity = TIM_ICPOLARITY_RISING;
|
||||
sConfig.IC1Selection = TIM_ICSELECTION_DIRECTTI;
|
||||
sConfig.IC1Prescaler = TIM_ICPSC_DIV1;
|
||||
sConfig.IC1Filter = 0;
|
||||
sConfig.IC2Polarity = TIM_ICPOLARITY_RISING;
|
||||
sConfig.IC2Selection = TIM_ICSELECTION_DIRECTTI;
|
||||
sConfig.IC2Prescaler = TIM_ICPSC_DIV1;
|
||||
sConfig.IC2Filter = 0;
|
||||
if (HAL_TIM_Encoder_Init(&htim1, &sConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM1_Init 2 */
|
||||
|
||||
/* USER CODE END TIM1_Init 2 */
|
||||
|
||||
}
|
||||
/* TIM2 init function */
|
||||
void MX_TIM2_Init(void)
|
||||
{
|
||||
|
@ -122,6 +168,36 @@ void MX_TIM3_Init(void)
|
|||
|
||||
}
|
||||
|
||||
void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef* tim_encoderHandle)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(tim_encoderHandle->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 0 */
|
||||
/* TIM1 clock enable */
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
/**TIM1 GPIO Configuration
|
||||
PE9 ------> TIM1_CH1
|
||||
PE11 ------> TIM1_CH2
|
||||
*/
|
||||
GPIO_InitStruct.Pin = EC11_A_Pin|EC11_B_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM1_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
|
@ -180,6 +256,29 @@ void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle)
|
|||
|
||||
}
|
||||
|
||||
void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef* tim_encoderHandle)
|
||||
{
|
||||
|
||||
if(tim_encoderHandle->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM1_CLK_DISABLE();
|
||||
|
||||
/**TIM1 GPIO Configuration
|
||||
PE9 ------> TIM1_CH1
|
||||
PE11 ------> TIM1_CH2
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOE, EC11_A_Pin|EC11_B_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
|
|
|
@ -165,6 +165,16 @@
|
|||
<WinNumber>1</WinNumber>
|
||||
<ItemText>xReturn</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>direction</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>encode_num</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
|
@ -248,7 +258,7 @@
|
|||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/main.c</PathWithFileName>
|
||||
|
@ -272,7 +282,7 @@
|
|||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/freertos.c</PathWithFileName>
|
||||
|
|
|
@ -117,7 +117,7 @@ ETH.IPParameters=MediaInterface
|
|||
ETH.MediaInterface=HAL_ETH_RMII_MODE
|
||||
FREERTOS.FootprintOK=true
|
||||
FREERTOS.IPParameters=Tasks01,configMAX_TASK_NAME_LEN,configENABLE_FPU,configMAX_PRIORITIES,FootprintOK
|
||||
FREERTOS.Tasks01=lwip_task,2,512,start_tcp_task,Default,NULL,Dynamic,NULL,NULL;led_task,-2,128,start_led_toggle_task,Default,NULL,Dynamic,NULL,NULL;dac_task,0,512,start_dac_task,Default,NULL,Dynamic,NULL,NULL;adc_task,-1,128,start_adc_task,Default,NULL,Dynamic,NULL,NULL;gpio_di_do_task,0,128,start_gpio_di_do_task,Default,NULL,Dynamic,NULL,NULL
|
||||
FREERTOS.Tasks01=lwip_task,2,512,start_tcp_task,Default,NULL,Dynamic,NULL,NULL;led_task,-2,128,start_led_toggle_task,Default,NULL,Dynamic,NULL,NULL;dac_task,0,512,start_dac_task,Default,NULL,Dynamic,NULL,NULL;adc_task,-1,128,start_adc_task,Default,NULL,Dynamic,NULL,NULL;gpio_di_do_task,0,128,start_gpio_di_do_task,Default,NULL,Dynamic,NULL,NULL;ec11_task,0,128,start_ec11_task,Default,NULL,Dynamic,NULL,NULL
|
||||
FREERTOS.configENABLE_FPU=1
|
||||
FREERTOS.configMAX_PRIORITIES=32
|
||||
FREERTOS.configMAX_TASK_NAME_LEN=24
|
||||
|
@ -147,20 +147,21 @@ Mcu.CPN=STM32F407VGT6
|
|||
Mcu.Family=STM32F4
|
||||
Mcu.IP0=DMA
|
||||
Mcu.IP1=ETH
|
||||
Mcu.IP10=UART4
|
||||
Mcu.IP11=UART5
|
||||
Mcu.IP12=USART2
|
||||
Mcu.IP13=USART3
|
||||
Mcu.IP14=USART6
|
||||
Mcu.IP10=TIM3
|
||||
Mcu.IP11=UART4
|
||||
Mcu.IP12=UART5
|
||||
Mcu.IP13=USART2
|
||||
Mcu.IP14=USART3
|
||||
Mcu.IP15=USART6
|
||||
Mcu.IP2=FREERTOS
|
||||
Mcu.IP3=LWIP
|
||||
Mcu.IP4=NVIC
|
||||
Mcu.IP5=RCC
|
||||
Mcu.IP6=SPI1
|
||||
Mcu.IP7=SYS
|
||||
Mcu.IP8=TIM2
|
||||
Mcu.IP9=TIM3
|
||||
Mcu.IPNb=15
|
||||
Mcu.IP8=TIM1
|
||||
Mcu.IP9=TIM2
|
||||
Mcu.IPNb=16
|
||||
Mcu.Name=STM32F407V(E-G)Tx
|
||||
Mcu.Package=LQFP100
|
||||
Mcu.Pin0=PE2
|
||||
|
@ -169,61 +170,63 @@ Mcu.Pin10=PC5
|
|||
Mcu.Pin11=PB1
|
||||
Mcu.Pin12=PB2
|
||||
Mcu.Pin13=PE7
|
||||
Mcu.Pin14=PE12
|
||||
Mcu.Pin15=PE13
|
||||
Mcu.Pin16=PE14
|
||||
Mcu.Pin17=PB11
|
||||
Mcu.Pin18=PB12
|
||||
Mcu.Pin19=PB13
|
||||
Mcu.Pin14=PE9
|
||||
Mcu.Pin15=PE11
|
||||
Mcu.Pin16=PE12
|
||||
Mcu.Pin17=PE13
|
||||
Mcu.Pin18=PE14
|
||||
Mcu.Pin19=PB11
|
||||
Mcu.Pin2=PH0-OSC_IN
|
||||
Mcu.Pin20=PD8
|
||||
Mcu.Pin21=PD9
|
||||
Mcu.Pin22=PD11
|
||||
Mcu.Pin23=PD12
|
||||
Mcu.Pin24=PD13
|
||||
Mcu.Pin25=PD14
|
||||
Mcu.Pin26=PD15
|
||||
Mcu.Pin27=PC6
|
||||
Mcu.Pin28=PC7
|
||||
Mcu.Pin29=PC8
|
||||
Mcu.Pin20=PB12
|
||||
Mcu.Pin21=PB13
|
||||
Mcu.Pin22=PD8
|
||||
Mcu.Pin23=PD9
|
||||
Mcu.Pin24=PD11
|
||||
Mcu.Pin25=PD12
|
||||
Mcu.Pin26=PD13
|
||||
Mcu.Pin27=PD14
|
||||
Mcu.Pin28=PD15
|
||||
Mcu.Pin29=PC6
|
||||
Mcu.Pin3=PH1-OSC_OUT
|
||||
Mcu.Pin30=PC9
|
||||
Mcu.Pin31=PA8
|
||||
Mcu.Pin32=PA11
|
||||
Mcu.Pin33=PA12
|
||||
Mcu.Pin34=PA13
|
||||
Mcu.Pin35=PA14
|
||||
Mcu.Pin36=PA15
|
||||
Mcu.Pin37=PC10
|
||||
Mcu.Pin38=PC11
|
||||
Mcu.Pin39=PC12
|
||||
Mcu.Pin30=PC7
|
||||
Mcu.Pin31=PC8
|
||||
Mcu.Pin32=PC9
|
||||
Mcu.Pin33=PA8
|
||||
Mcu.Pin34=PA11
|
||||
Mcu.Pin35=PA12
|
||||
Mcu.Pin36=PA13
|
||||
Mcu.Pin37=PA14
|
||||
Mcu.Pin38=PA15
|
||||
Mcu.Pin39=PC10
|
||||
Mcu.Pin4=PC0
|
||||
Mcu.Pin40=PD0
|
||||
Mcu.Pin41=PD1
|
||||
Mcu.Pin42=PD2
|
||||
Mcu.Pin43=PD3
|
||||
Mcu.Pin44=PD4
|
||||
Mcu.Pin45=PD5
|
||||
Mcu.Pin46=PD6
|
||||
Mcu.Pin47=PD7
|
||||
Mcu.Pin48=PB3
|
||||
Mcu.Pin49=PB4
|
||||
Mcu.Pin40=PC11
|
||||
Mcu.Pin41=PC12
|
||||
Mcu.Pin42=PD0
|
||||
Mcu.Pin43=PD1
|
||||
Mcu.Pin44=PD2
|
||||
Mcu.Pin45=PD3
|
||||
Mcu.Pin46=PD4
|
||||
Mcu.Pin47=PD5
|
||||
Mcu.Pin48=PD6
|
||||
Mcu.Pin49=PD7
|
||||
Mcu.Pin5=PC1
|
||||
Mcu.Pin50=PB5
|
||||
Mcu.Pin51=PB6
|
||||
Mcu.Pin52=PB7
|
||||
Mcu.Pin53=PE0
|
||||
Mcu.Pin54=PE1
|
||||
Mcu.Pin55=VP_FREERTOS_VS_CMSIS_V1
|
||||
Mcu.Pin56=VP_LWIP_VS_Enabled
|
||||
Mcu.Pin57=VP_SYS_VS_tim1
|
||||
Mcu.Pin58=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin59=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin50=PB3
|
||||
Mcu.Pin51=PB4
|
||||
Mcu.Pin52=PB5
|
||||
Mcu.Pin53=PB6
|
||||
Mcu.Pin54=PB7
|
||||
Mcu.Pin55=PE0
|
||||
Mcu.Pin56=PE1
|
||||
Mcu.Pin57=VP_FREERTOS_VS_CMSIS_V1
|
||||
Mcu.Pin58=VP_LWIP_VS_Enabled
|
||||
Mcu.Pin59=VP_SYS_VS_tim4
|
||||
Mcu.Pin6=PA1
|
||||
Mcu.Pin60=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin61=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin7=PA2
|
||||
Mcu.Pin8=PA7
|
||||
Mcu.Pin9=PC4
|
||||
Mcu.PinsNb=60
|
||||
Mcu.PinsNb=62
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F407VGTx
|
||||
|
@ -255,10 +258,10 @@ NVIC.SavedPendsvIrqHandlerGenerated=true
|
|||
NVIC.SavedSvcallIrqHandlerGenerated=true
|
||||
NVIC.SavedSystickIrqHandlerGenerated=true
|
||||
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
|
||||
NVIC.TIM1_UP_TIM10_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
|
||||
NVIC.TIM3_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
|
||||
NVIC.TimeBase=TIM1_UP_TIM10_IRQn
|
||||
NVIC.TimeBaseIP=TIM1
|
||||
NVIC.TIM4_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
|
||||
NVIC.TimeBase=TIM4_IRQn
|
||||
NVIC.TimeBaseIP=TIM4
|
||||
NVIC.UART4_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
|
||||
NVIC.UART5_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
|
||||
NVIC.USART2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
|
||||
|
@ -487,6 +490,11 @@ PE1.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
|
|||
PE1.Locked=true
|
||||
PE1.PinState=GPIO_PIN_SET
|
||||
PE1.Signal=GPIO_Output
|
||||
PE11.GPIOParameters=GPIO_PuPd,GPIO_Label
|
||||
PE11.GPIO_Label=EC11_B
|
||||
PE11.GPIO_PuPd=GPIO_PULLUP
|
||||
PE11.Locked=true
|
||||
PE11.Signal=S_TIM1_CH2
|
||||
PE12.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PE12.GPIO_Label=LED2_R
|
||||
PE12.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||
|
@ -527,6 +535,11 @@ PE7.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM
|
|||
PE7.Locked=true
|
||||
PE7.PinState=GPIO_PIN_SET
|
||||
PE7.Signal=GPIO_Output
|
||||
PE9.GPIOParameters=GPIO_PuPd,GPIO_Label
|
||||
PE9.GPIO_Label=EC11_A
|
||||
PE9.GPIO_PuPd=GPIO_PULLUP
|
||||
PE9.Locked=true
|
||||
PE9.Signal=S_TIM1_CH1
|
||||
PH0-OSC_IN.Mode=HSE-External-Oscillator
|
||||
PH0-OSC_IN.Signal=RCC_OSC_IN
|
||||
PH1-OSC_OUT.Mode=HSE-External-Oscillator
|
||||
|
@ -598,6 +611,10 @@ SH.GPXTI1.0=GPIO_EXTI1
|
|||
SH.GPXTI1.ConfNb=1
|
||||
SH.GPXTI3.0=GPIO_EXTI3
|
||||
SH.GPXTI3.ConfNb=1
|
||||
SH.S_TIM1_CH1.0=TIM1_CH1,Encoder_Interface
|
||||
SH.S_TIM1_CH1.ConfNb=1
|
||||
SH.S_TIM1_CH2.0=TIM1_CH2,Encoder_Interface
|
||||
SH.S_TIM1_CH2.ConfNb=1
|
||||
SH.S_TIM2_CH1_ETR.0=TIM2_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM2_CH1_ETR.ConfNb=1
|
||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256
|
||||
|
@ -608,6 +625,9 @@ SPI1.Direction=SPI_DIRECTION_2LINES
|
|||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,CLKPolarity,CLKPhase
|
||||
SPI1.Mode=SPI_MODE_MASTER
|
||||
SPI1.VirtualType=VM_MASTER
|
||||
TIM1.EncoderMode=TIM_ENCODERMODE_TI12
|
||||
TIM1.IPParameters=EncoderMode,Prescaler
|
||||
TIM1.Prescaler=2
|
||||
TIM2.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM2.IPParameters=Channel-PWM Generation1 CH1,Period,Pulse-PWM Generation1 CH1
|
||||
TIM2.Period=119
|
||||
|
@ -636,8 +656,8 @@ VP_FREERTOS_VS_CMSIS_V1.Mode=CMSIS_V1
|
|||
VP_FREERTOS_VS_CMSIS_V1.Signal=FREERTOS_VS_CMSIS_V1
|
||||
VP_LWIP_VS_Enabled.Mode=Enabled
|
||||
VP_LWIP_VS_Enabled.Signal=LWIP_VS_Enabled
|
||||
VP_SYS_VS_tim1.Mode=TIM1
|
||||
VP_SYS_VS_tim1.Signal=SYS_VS_tim1
|
||||
VP_SYS_VS_tim4.Mode=TIM4
|
||||
VP_SYS_VS_tim4.Signal=SYS_VS_tim4
|
||||
VP_TIM2_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||
|
|
Loading…
Reference in New Issue