changes, not working
This commit is contained in:
@ -59,7 +59,7 @@ void Error_Handler(void);
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define eepromSpi hspi1
|
||||
#define displaySpi hspi2
|
||||
#define etherSpi hspi2
|
||||
#define debugUart huart1
|
||||
#define LED_Red_Pin GPIO_PIN_13
|
||||
#define LED_Red_GPIO_Port GPIOC
|
||||
@ -73,18 +73,16 @@ void Error_Handler(void);
|
||||
#define EEPROM_MISO_GPIO_Port GPIOA
|
||||
#define EEPROM_MOSI_Pin GPIO_PIN_7
|
||||
#define EEPROM_MOSI_GPIO_Port GPIOA
|
||||
#define Display_RES_Pin GPIO_PIN_10
|
||||
#define Display_RES_GPIO_Port GPIOB
|
||||
#define Display_DC_Pin GPIO_PIN_11
|
||||
#define Display_DC_GPIO_Port GPIOB
|
||||
#define Display_CS_Pin GPIO_PIN_12
|
||||
#define Display_CS_GPIO_Port GPIOB
|
||||
#define Display_SCK_Pin GPIO_PIN_13
|
||||
#define Display_SCK_GPIO_Port GPIOB
|
||||
#define Display_MISO_Pin GPIO_PIN_14
|
||||
#define Display_MISO_GPIO_Port GPIOB
|
||||
#define Display_MOSI_Pin GPIO_PIN_15
|
||||
#define Display_MOSI_GPIO_Port GPIOB
|
||||
#define ETHER_RES_Pin GPIO_PIN_11
|
||||
#define ETHER_RES_GPIO_Port GPIOB
|
||||
#define ETHER_CS_Pin GPIO_PIN_12
|
||||
#define ETHER_CS_GPIO_Port GPIOB
|
||||
#define ETHER_SCK_Pin GPIO_PIN_13
|
||||
#define ETHER_SCK_GPIO_Port GPIOB
|
||||
#define ETHER_MISO_Pin GPIO_PIN_14
|
||||
#define ETHER_MISO_GPIO_Port GPIOB
|
||||
#define ETHER_MOSI_Pin GPIO_PIN_15
|
||||
#define ETHER_MOSI_GPIO_Port GPIOB
|
||||
#define Debug_TX_Pin GPIO_PIN_9
|
||||
#define Debug_TX_GPIO_Port GPIOA
|
||||
#define Debug_RX_Pin GPIO_PIN_10
|
||||
|
@ -55,8 +55,7 @@ void MX_GPIO_Init(void)
|
||||
HAL_GPIO_WritePin(EEPROM_CS_GPIO_Port, EEPROM_CS_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, Display_RES_Pin|Display_DC_Pin|Display_CS_Pin|Debug_Signal_2_Pin
|
||||
|Debug_Signal_1_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOB, ETHER_RES_Pin|ETHER_CS_Pin|Debug_Signal_2_Pin|Debug_Signal_1_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : PCPin PCPin */
|
||||
GPIO_InitStruct.Pin = LED_Red_Pin|LED_Green_Pin;
|
||||
@ -72,10 +71,8 @@ void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(EEPROM_CS_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin PBPin
|
||||
PBPin */
|
||||
GPIO_InitStruct.Pin = Display_RES_Pin|Display_DC_Pin|Display_CS_Pin|Debug_Signal_2_Pin
|
||||
|Debug_Signal_1_Pin;
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = ETHER_RES_Pin|ETHER_CS_Pin|Debug_Signal_2_Pin|Debug_Signal_1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
@ -121,15 +121,15 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)
|
||||
PB14 ------> SPI2_MISO
|
||||
PB15 ------> SPI2_MOSI
|
||||
*/
|
||||
GPIO_InitStruct.Pin = Display_SCK_Pin|Display_MOSI_Pin;
|
||||
GPIO_InitStruct.Pin = ETHER_SCK_Pin|ETHER_MOSI_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = Display_MISO_Pin;
|
||||
GPIO_InitStruct.Pin = ETHER_MISO_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(Display_MISO_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(ETHER_MISO_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI2_MspInit 1 */
|
||||
|
||||
@ -174,7 +174,7 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle)
|
||||
PB14 ------> SPI2_MISO
|
||||
PB15 ------> SPI2_MOSI
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOB, Display_SCK_Pin|Display_MISO_Pin|Display_MOSI_Pin);
|
||||
HAL_GPIO_DeInit(GPIOB, ETHER_SCK_Pin|ETHER_MISO_Pin|ETHER_MOSI_Pin);
|
||||
|
||||
/* USER CODE BEGIN SPI2_MspDeInit 1 */
|
||||
|
||||
|
Reference in New Issue
Block a user