display pins
This commit is contained in:
@ -63,6 +63,8 @@ void Error_Handler(void);
|
||||
#define frontendAdc hadc1
|
||||
#define eepromSpi hspi2
|
||||
#define etherSpi hspi1
|
||||
#define displaySpi hspi3
|
||||
#define debugUartIRQn UART4_IRQn
|
||||
#define Loop_Enable_Pin GPIO_PIN_2
|
||||
#define Loop_Enable_GPIO_Port GPIOE
|
||||
#define Loop_Disable_Pin GPIO_PIN_3
|
||||
@ -110,6 +112,18 @@ void Error_Handler(void);
|
||||
#define Frontend_Out_GPIO_Port GPIOD
|
||||
#define MBus_RX_Pin GPIO_PIN_2
|
||||
#define MBus_RX_GPIO_Port GPIOD
|
||||
#define Display_CS_Pin GPIO_PIN_7
|
||||
#define Display_CS_GPIO_Port GPIOD
|
||||
#define Display_SCLK_Pin GPIO_PIN_3
|
||||
#define Display_SCLK_GPIO_Port GPIOB
|
||||
#define Display_MISO_Pin GPIO_PIN_4
|
||||
#define Display_MISO_GPIO_Port GPIOB
|
||||
#define Display_MOSI_Pin GPIO_PIN_5
|
||||
#define Display_MOSI_GPIO_Port GPIOB
|
||||
#define Display_DC_Pin GPIO_PIN_6
|
||||
#define Display_DC_GPIO_Port GPIOB
|
||||
#define Display_RES_Pin GPIO_PIN_7
|
||||
#define Display_RES_GPIO_Port GPIOB
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
@ -57,10 +57,10 @@ void MX_GPIO_Init(void)
|
||||
HAL_GPIO_WritePin(GPIOA, ETHER_RES_Pin|ETHER_CS_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, Debug_Signal_1_Pin|EEPROM_CS_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOB, Debug_Signal_1_Pin|EEPROM_CS_Pin|Display_DC_Pin|Display_RES_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(Frontend_Out_GPIO_Port, Frontend_Out_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOD, Frontend_Out_Pin|Display_CS_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : PEPin PEPin PEPin PEPin
|
||||
PEPin */
|
||||
@ -90,19 +90,19 @@ void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(ETHER_INT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = Debug_Signal_1_Pin|EEPROM_CS_Pin;
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = Debug_Signal_1_Pin|EEPROM_CS_Pin|Display_DC_Pin|Display_RES_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = Frontend_Out_Pin;
|
||||
/*Configure GPIO pins : PDPin PDPin */
|
||||
GPIO_InitStruct.Pin = Frontend_Out_Pin|Display_CS_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(Frontend_Out_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI4_IRQn, 0, 0);
|
||||
|
@ -172,15 +172,15 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)
|
||||
PB4 ------> SPI3_MISO
|
||||
PB5 ------> SPI3_MOSI
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_5;
|
||||
GPIO_InitStruct.Pin = Display_SCLK_Pin|Display_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 = GPIO_PIN_4;
|
||||
GPIO_InitStruct.Pin = Display_MISO_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(Display_MISO_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI3_MspInit 1 */
|
||||
|
||||
@ -244,7 +244,7 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle)
|
||||
PB4 ------> SPI3_MISO
|
||||
PB5 ------> SPI3_MOSI
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5);
|
||||
HAL_GPIO_DeInit(GPIOB, Display_SCLK_Pin|Display_MISO_Pin|Display_MOSI_Pin);
|
||||
|
||||
/* USER CODE BEGIN SPI3_MspDeInit 1 */
|
||||
|
||||
|
Reference in New Issue
Block a user