Morgen!
Ich habe mit CubeMX ein Projekt angelegt... Alles funktioniert, bis auf
die SPI! Also habe ich die GPIO Einstellungen der MOSI Leitung auf
pull-up geändert und das Projekt neu generiert. -Jetzt kann ich diese
GPIO Einstellungen im Code aber nicht finden! (Von der USART übrigens
auch nicht, trotzdem funktioniert diese einwandfrei)
Erzeugt wurde folgendes (GPIO und SPI):
1 | static void MX_GPIO_Init(void)
|
2 | {
|
3 | GPIO_InitTypeDef GPIO_InitStruct;
|
4 |
|
5 | /* GPIO Ports Clock Enable */
|
6 | __HAL_RCC_GPIOA_CLK_ENABLE();
|
7 | __HAL_RCC_GPIOB_CLK_ENABLE();
|
8 |
|
9 | /*Configure GPIO pin Output Level */
|
10 | HAL_GPIO_WritePin(GPIOB, LED_Pin|SPI1_HOLD_Pin, GPIO_PIN_SET);
|
11 |
|
12 | /*Configure GPIO pins : LED_Pin SPI1_HOLD_Pin */
|
13 | GPIO_InitStruct.Pin = LED_Pin|SPI1_HOLD_Pin;
|
14 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
15 | GPIO_InitStruct.Pull = GPIO_NOPULL;
|
16 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
17 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
18 | }
|
19 |
|
20 | [...]
|
21 |
|
22 | static void MX_SPI1_Init(void)
|
23 | {
|
24 | hspi1.Instance = SPI1;
|
25 | hspi1.Init.Mode = SPI_MODE_MASTER;
|
26 | hspi1.Init.Direction = SPI_DIRECTION_2LINES;
|
27 | hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
|
28 | hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
|
29 | hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
|
30 | hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT;
|
31 | hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
|
32 | hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
33 | hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
|
34 | hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
35 | hspi1.Init.CRCPolynomial = 7;
|
36 | hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
|
37 | hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
|
38 | if (HAL_SPI_Init(&hspi1) != HAL_OK)
|
39 | {
|
40 | _Error_Handler(__FILE__, __LINE__);
|
41 | }
|
42 | }
|
Versteckt Cube die AF GPIO Einstellungen irgendwo anders?