软件SPI可以驱动屏幕

This commit is contained in:
2026-07-14 14:44:07 +08:00
parent 3577003fb6
commit 0a5c478a42
53 changed files with 9354 additions and 87 deletions

View File

@@ -22,6 +22,8 @@
#include "stm32f1xx_it.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "multi_button.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -41,7 +43,7 @@
/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */
static uint8_t s_button_tick_counter = 0;
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
@@ -55,7 +57,7 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
extern DMA_HandleTypeDef hdma_spi2_tx;
/* USER CODE BEGIN EV */
/* USER CODE END EV */
@@ -188,6 +190,13 @@ void SysTick_Handler(void)
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* 每5ms调用一次button_ticks() */
s_button_tick_counter++;
if (s_button_tick_counter >= 5) {
s_button_tick_counter = 0;
button_ticks();
}
/* USER CODE END SysTick_IRQn 1 */
}
@@ -198,6 +207,20 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32f1xx.s). */
/******************************************************************************/
/**
* @brief This function handles DMA1 channel5 global interrupt.
*/
void DMA1_Channel5_IRQHandler(void)
{
/* USER CODE BEGIN DMA1_Channel5_IRQn 0 */
/* USER CODE END DMA1_Channel5_IRQn 0 */
HAL_DMA_IRQHandler(&hdma_spi2_tx);
/* USER CODE BEGIN DMA1_Channel5_IRQn 1 */
/* USER CODE END DMA1_Channel5_IRQn 1 */
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */