Subversion Repositories EngineBay2

Rev

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

Rev 2 Rev 3
Line 142... Line 142...
142
    /* Peripheral clock enable */
142
    /* Peripheral clock enable */
143
    __HAL_RCC_SPI1_CLK_ENABLE();
143
    __HAL_RCC_SPI1_CLK_ENABLE();
144
 
144
 
145
    /**SPI1 GPIO Configuration    
145
    /**SPI1 GPIO Configuration    
146
    PA5     ------> SPI1_SCK
146
    PA5     ------> SPI1_SCK
-
 
147
    PA6     ------> SPI1_MISO
147
    PA7     ------> SPI1_MOSI
148
    PA7     ------> SPI1_MOSI
148
    */
149
    */
149
    GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
150
    GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
150
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
151
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
151
    GPIO_InitStruct.Pull = GPIO_NOPULL;
152
    GPIO_InitStruct.Pull = GPIO_NOPULL;
152
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
153
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
153
    GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
154
    GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
154
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
155
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Line 171... Line 172...
171
    /* Peripheral clock disable */
172
    /* Peripheral clock disable */
172
    __HAL_RCC_SPI1_CLK_DISABLE();
173
    __HAL_RCC_SPI1_CLK_DISABLE();
173
 
174
 
174
    /**SPI1 GPIO Configuration    
175
    /**SPI1 GPIO Configuration    
175
    PA5     ------> SPI1_SCK
176
    PA5     ------> SPI1_SCK
-
 
177
    PA6     ------> SPI1_MISO
176
    PA7     ------> SPI1_MOSI
178
    PA7     ------> SPI1_MOSI
177
    */
179
    */
178
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_7);
180
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
179
 
181
 
180
  }
182
  }
181
  /* USER CODE BEGIN SPI1_MspDeInit 1 */
183
  /* USER CODE BEGIN SPI1_MspDeInit 1 */
182
 
184
 
183
  /* USER CODE END SPI1_MspDeInit 1 */
185
  /* USER CODE END SPI1_MspDeInit 1 */