软件iic怎么一直调不出来呢
This commit is contained in:
+12
-6
@@ -253,10 +253,13 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, U_T_Pin|HC595_DLK_Pin|HC595_SLK_Pin|HC595_RLK_Pin
|
||||
|HC595_SLK2_Pin|iic_scl_Pin, GPIO_PIN_RESET);
|
||||
|HC595_SLK2_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(iic_sda_GPIO_Port, iic_sda_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(iic_sda_GPIO_Port, iic_sda_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(iic_scl_GPIO_Port, iic_scl_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pins : MOT_IN1_Pin MOT_IN2_Pin */
|
||||
GPIO_InitStruct.Pin = MOT_IN1_Pin|MOT_IN2_Pin;
|
||||
@@ -288,17 +291,20 @@ static void MX_GPIO_Init(void)
|
||||
/*Configure GPIO pin : iic_sda_Pin */
|
||||
GPIO_InitStruct.Pin = iic_sda_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(iic_sda_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : iic_scl_Pin */
|
||||
GPIO_InitStruct.Pin = iic_scl_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(iic_scl_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/**/
|
||||
HAL_I2CEx_EnableFastModePlus(SYSCFG_CFGR1_I2C_FMP_PA10);
|
||||
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI2_3_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI2_3_IRQn);
|
||||
|
||||
Reference in New Issue
Block a user