[wip] working on display layout
This commit is contained in:
@@ -65,10 +65,30 @@ void Error_Handler(void);
|
||||
#define USART_RX_GPIO_Port GPIOA
|
||||
#define LD2_Pin GPIO_PIN_5
|
||||
#define LD2_GPIO_Port GPIOA
|
||||
#define BTN1_Pin GPIO_PIN_1
|
||||
#define BTN1_GPIO_Port GPIOB
|
||||
#define BTN2_Pin GPIO_PIN_2
|
||||
#define BTN2_GPIO_Port GPIOB
|
||||
#define BTN3_Pin GPIO_PIN_11
|
||||
#define BTN3_GPIO_Port GPIOB
|
||||
#define BTN4_Pin GPIO_PIN_12
|
||||
#define BTN4_GPIO_Port GPIOB
|
||||
#define BTN5_Pin GPIO_PIN_11
|
||||
#define BTN5_GPIO_Port GPIOA
|
||||
#define TMS_Pin GPIO_PIN_13
|
||||
#define TMS_GPIO_Port GPIOA
|
||||
#define TCK_Pin GPIO_PIN_14
|
||||
#define TCK_GPIO_Port GPIOA
|
||||
#define ST7565_CS_Pin GPIO_PIN_15
|
||||
#define ST7565_CS_GPIO_Port GPIOA
|
||||
#define ST7565_SCK_Pin GPIO_PIN_10
|
||||
#define ST7565_SCK_GPIO_Port GPIOC
|
||||
#define ST7565_RST_Pin GPIO_PIN_11
|
||||
#define ST7565_RST_GPIO_Port GPIOC
|
||||
#define ST7565_MOSI_Pin GPIO_PIN_12
|
||||
#define ST7565_MOSI_GPIO_Port GPIOC
|
||||
#define ST7565_A0_Pin GPIO_PIN_2
|
||||
#define ST7565_A0_GPIO_Port GPIOD
|
||||
#define SWO_Pin GPIO_PIN_3
|
||||
#define SWO_GPIO_Port GPIOB
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
@@ -34,11 +34,14 @@ extern "C" {
|
||||
|
||||
extern SPI_HandleTypeDef hspi2;
|
||||
|
||||
extern SPI_HandleTypeDef hspi3;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_SPI2_Init(void);
|
||||
void MX_SPI3_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
|
||||
@@ -49,9 +49,16 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOA, LD2_Pin|ST7565_CS_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ST7565_RST_GPIO_Port, ST7565_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ST7565_A0_GPIO_Port, ST7565_A0_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = B1_Pin;
|
||||
@@ -59,12 +66,38 @@ void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = LD2_Pin;
|
||||
/*Configure GPIO pins : PAPin PAPin */
|
||||
GPIO_InitStruct.Pin = LD2_Pin|ST7565_CS_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = BTN1_Pin|BTN2_Pin|BTN3_Pin|BTN4_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = BTN5_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(BTN5_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = ST7565_RST_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ST7565_RST_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = ST7565_A0_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ST7565_A0_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "ctrl_app.h"
|
||||
#include "display_gfx.h"
|
||||
#include "disp_layout.h"
|
||||
#include "st7565.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -45,7 +48,9 @@
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
st7565_handle_t hst7565;
|
||||
GFX_display_t disp;
|
||||
APP_data_t app_data;
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@@ -60,96 +65,117 @@ void SystemClock_Config(void);
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
/* USER CODE BEGIN 1 */
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||
HAL_Init();
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||
HAL_Init();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_USART2_UART_Init();
|
||||
MX_SPI2_Init();
|
||||
MX_I2C1_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_USART2_UART_Init();
|
||||
MX_SPI2_Init();
|
||||
MX_I2C1_Init();
|
||||
MX_SPI3_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
APP_init(&app_data);
|
||||
|
||||
/* USER CODE END 2 */
|
||||
hst7565.hspi = &hspi3;
|
||||
hst7565.cs_port = ST7565_CS_GPIO_Port;
|
||||
hst7565.cs_pin = ST7565_CS_Pin;
|
||||
hst7565.a0_port = ST7565_A0_GPIO_Port;
|
||||
hst7565.a0_pin = ST7565_A0_Pin;
|
||||
hst7565.rst_port = ST7565_RST_GPIO_Port;
|
||||
hst7565.rst_pin = ST7565_RST_Pin;
|
||||
ST7565_Init(&hst7565, &disp);
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
DISP_clearScreen(&disp);
|
||||
ST7565_DisplayAll(&hst7565);
|
||||
|
||||
uint32_t last_tick = HAL_GetTick();
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE END WHILE */
|
||||
CTRL_buttonsHandler();
|
||||
if (HAL_GetTick() - last_tick > 100)
|
||||
{
|
||||
last_tick = HAL_GetTick();
|
||||
ST7565_DisplayAll(&hst7565);
|
||||
LAY_drawDisplayLayout(&disp, &app_data);
|
||||
}
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
/* USER CODE BEGIN 3 */
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
|
||||
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
|
||||
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_I2C1;
|
||||
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
|
||||
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_I2C1;
|
||||
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
|
||||
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
@@ -157,33 +183,33 @@ void SystemClock_Config(void)
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
|
||||
#ifdef USE_FULL_ASSERT
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief Reports the name of the source file and the source line number
|
||||
* where the assert_param error has occurred.
|
||||
* @param file: pointer to the source file name
|
||||
* @param line: assert_param error line source number
|
||||
* @retval None
|
||||
*/
|
||||
* @brief Reports the name of the source file and the source line number
|
||||
* where the assert_param error has occurred.
|
||||
* @param file: pointer to the source file name
|
||||
* @param line: assert_param error line source number
|
||||
* @retval None
|
||||
*/
|
||||
void assert_failed(uint8_t *file, uint32_t line)
|
||||
{
|
||||
/* USER CODE BEGIN 6 */
|
||||
/* USER CODE BEGIN 6 */
|
||||
/* User can add his own implementation to report the file name and line number,
|
||||
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||
/* USER CODE END 6 */
|
||||
/* USER CODE END 6 */
|
||||
}
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
/* USER CODE END 0 */
|
||||
|
||||
SPI_HandleTypeDef hspi2;
|
||||
SPI_HandleTypeDef hspi3;
|
||||
|
||||
/* SPI2 init function */
|
||||
void MX_SPI2_Init(void)
|
||||
@@ -59,6 +60,40 @@ void MX_SPI2_Init(void)
|
||||
|
||||
/* USER CODE END SPI2_Init 2 */
|
||||
|
||||
}
|
||||
/* SPI3 init function */
|
||||
void MX_SPI3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI3_Init 0 */
|
||||
|
||||
/* USER CODE END SPI3_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI3_Init 1 */
|
||||
|
||||
/* USER CODE END SPI3_Init 1 */
|
||||
hspi3.Instance = SPI3;
|
||||
hspi3.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi3.Init.Direction = SPI_DIRECTION_1LINE;
|
||||
hspi3.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi3.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi3.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64;
|
||||
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi3.Init.CRCPolynomial = 7;
|
||||
hspi3.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
|
||||
hspi3.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
|
||||
if (HAL_SPI_Init(&hspi3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI3_Init 2 */
|
||||
|
||||
/* USER CODE END SPI3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)
|
||||
@@ -90,6 +125,30 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)
|
||||
|
||||
/* USER CODE END SPI2_MspInit 1 */
|
||||
}
|
||||
else if(spiHandle->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspInit 0 */
|
||||
|
||||
/* USER CODE END SPI3_MspInit 0 */
|
||||
/* SPI3 clock enable */
|
||||
__HAL_RCC_SPI3_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
/**SPI3 GPIO Configuration
|
||||
PC10 ------> SPI3_SCK
|
||||
PC12 ------> SPI3_MOSI
|
||||
*/
|
||||
GPIO_InitStruct.Pin = ST7565_SCK_Pin|ST7565_MOSI_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI3_MspInit 1 */
|
||||
|
||||
/* USER CODE END SPI3_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle)
|
||||
@@ -114,6 +173,24 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle)
|
||||
|
||||
/* USER CODE END SPI2_MspDeInit 1 */
|
||||
}
|
||||
else if(spiHandle->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END SPI3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_SPI3_CLK_DISABLE();
|
||||
|
||||
/**SPI3 GPIO Configuration
|
||||
PC10 ------> SPI3_SCK
|
||||
PC12 ------> SPI3_MOSI
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, ST7565_SCK_Pin|ST7565_MOSI_Pin);
|
||||
|
||||
/* USER CODE BEGIN SPI3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END SPI3_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Sat Mar 25 21:51:05 CET 2023]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Sat Apr 01 12:37:38 CEST 2023]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
@@ -85,7 +85,6 @@ C_SOURCES += ../shared_libs/bitmaps/bitmap_disp_buttons.c
|
||||
C_SOURCES += ../shared_libs/bitmaps/bitmap_font_5x7.c
|
||||
# display_layout
|
||||
C_SOURCES += ../shared_libs/disp_layout/disp_layout.c
|
||||
C_SOURCES += ../shared_libs/disp_layout/disp_layout_defs.c
|
||||
# controllers
|
||||
C_SOURCES += ../shared_libs/controllers/ctrl_bottom_button.c
|
||||
C_SOURCES += ../shared_libs/controllers/ctrl_channel_button.c
|
||||
@@ -181,8 +180,6 @@ C_INCLUDES += -I../shared_libs/controllers
|
||||
C_INCLUDES += -I../shared_libs/utils/printf
|
||||
C_INCLUDES += -I../shared_libs/utils/rtt
|
||||
|
||||
# config
|
||||
C_INCLUDES += -I../shared_libs
|
||||
|
||||
# compile gcc flags
|
||||
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
|
||||
|
||||
@@ -11,29 +11,40 @@ Mcu.IP0=I2C1
|
||||
Mcu.IP1=NVIC
|
||||
Mcu.IP2=RCC
|
||||
Mcu.IP3=SPI2
|
||||
Mcu.IP4=SYS
|
||||
Mcu.IP5=USART2
|
||||
Mcu.IPNb=6
|
||||
Mcu.IP4=SPI3
|
||||
Mcu.IP5=SYS
|
||||
Mcu.IP6=USART2
|
||||
Mcu.IPNb=7
|
||||
Mcu.Name=STM32F303R(D-E)Tx
|
||||
Mcu.Package=LQFP64
|
||||
Mcu.Pin0=PC13
|
||||
Mcu.Pin1=PC14-OSC32_IN
|
||||
Mcu.Pin10=PB15
|
||||
Mcu.Pin11=PA13
|
||||
Mcu.Pin12=PA14
|
||||
Mcu.Pin13=PB3
|
||||
Mcu.Pin14=PB6
|
||||
Mcu.Pin15=PB7
|
||||
Mcu.Pin16=VP_SYS_VS_Systick
|
||||
Mcu.Pin10=PB11
|
||||
Mcu.Pin11=PB12
|
||||
Mcu.Pin12=PB13
|
||||
Mcu.Pin13=PB14
|
||||
Mcu.Pin14=PB15
|
||||
Mcu.Pin15=PA11
|
||||
Mcu.Pin16=PA13
|
||||
Mcu.Pin17=PA14
|
||||
Mcu.Pin18=PA15
|
||||
Mcu.Pin19=PC10
|
||||
Mcu.Pin2=PC15-OSC32_OUT
|
||||
Mcu.Pin20=PC11
|
||||
Mcu.Pin21=PC12
|
||||
Mcu.Pin22=PD2
|
||||
Mcu.Pin23=PB3
|
||||
Mcu.Pin24=PB6
|
||||
Mcu.Pin25=PB7
|
||||
Mcu.Pin26=VP_SYS_VS_Systick
|
||||
Mcu.Pin3=PF0-OSC_IN
|
||||
Mcu.Pin4=PF1-OSC_OUT
|
||||
Mcu.Pin5=PA2
|
||||
Mcu.Pin6=PA3
|
||||
Mcu.Pin7=PA5
|
||||
Mcu.Pin8=PB13
|
||||
Mcu.Pin9=PB14
|
||||
Mcu.PinsNb=17
|
||||
Mcu.Pin8=PB1
|
||||
Mcu.Pin9=PB2
|
||||
Mcu.PinsNb=27
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F303RETx
|
||||
@@ -50,6 +61,10 @@ NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:true\:false\:true\:true\:true\:false
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
|
||||
PA11.GPIOParameters=GPIO_Label
|
||||
PA11.GPIO_Label=BTN5
|
||||
PA11.Locked=true
|
||||
PA11.Signal=GPIO_Input
|
||||
PA13.GPIOParameters=GPIO_Label
|
||||
PA13.GPIO_Label=TMS
|
||||
PA13.Locked=true
|
||||
@@ -60,6 +75,10 @@ PA14.GPIO_Label=TCK
|
||||
PA14.Locked=true
|
||||
PA14.Mode=Serial_Wire
|
||||
PA14.Signal=SYS_JTCK-SWCLK
|
||||
PA15.GPIOParameters=GPIO_Label
|
||||
PA15.GPIO_Label=ST7565_CS
|
||||
PA15.Locked=true
|
||||
PA15.Signal=GPIO_Output
|
||||
PA2.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
|
||||
PA2.GPIO_Label=USART_TX
|
||||
PA2.GPIO_Mode=GPIO_MODE_AF_PP
|
||||
@@ -83,12 +102,28 @@ PA5.GPIO_PuPd=GPIO_NOPULL
|
||||
PA5.GPIO_Speed=GPIO_SPEED_FREQ_LOW
|
||||
PA5.Locked=true
|
||||
PA5.Signal=GPIO_Output
|
||||
PB1.GPIOParameters=GPIO_Label
|
||||
PB1.GPIO_Label=BTN1
|
||||
PB1.Locked=true
|
||||
PB1.Signal=GPIO_Input
|
||||
PB11.GPIOParameters=GPIO_Label
|
||||
PB11.GPIO_Label=BTN3
|
||||
PB11.Locked=true
|
||||
PB11.Signal=GPIO_Input
|
||||
PB12.GPIOParameters=GPIO_Label
|
||||
PB12.GPIO_Label=BTN4
|
||||
PB12.Locked=true
|
||||
PB12.Signal=GPIO_Input
|
||||
PB13.Mode=Full_Duplex_Master
|
||||
PB13.Signal=SPI2_SCK
|
||||
PB14.Mode=Full_Duplex_Master
|
||||
PB14.Signal=SPI2_MISO
|
||||
PB15.Mode=Full_Duplex_Master
|
||||
PB15.Signal=SPI2_MOSI
|
||||
PB2.GPIOParameters=GPIO_Label
|
||||
PB2.GPIO_Label=BTN2
|
||||
PB2.Locked=true
|
||||
PB2.Signal=GPIO_Input
|
||||
PB3.GPIOParameters=GPIO_Label
|
||||
PB3.GPIO_Label=SWO
|
||||
PB3.Locked=true
|
||||
@@ -98,6 +133,19 @@ PB6.Mode=I2C
|
||||
PB6.Signal=I2C1_SCL
|
||||
PB7.Mode=I2C
|
||||
PB7.Signal=I2C1_SDA
|
||||
PC10.GPIOParameters=GPIO_Label
|
||||
PC10.GPIO_Label=ST7565_SCK
|
||||
PC10.Locked=true
|
||||
PC10.Mode=Simplex_Bidirectional_Master
|
||||
PC10.Signal=SPI3_SCK
|
||||
PC11.GPIOParameters=GPIO_Label
|
||||
PC11.GPIO_Label=ST7565_RST
|
||||
PC11.Locked=true
|
||||
PC11.Signal=GPIO_Output
|
||||
PC12.GPIOParameters=GPIO_Label
|
||||
PC12.GPIO_Label=ST7565_MOSI
|
||||
PC12.Mode=Simplex_Bidirectional_Master
|
||||
PC12.Signal=SPI3_MOSI
|
||||
PC13.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI
|
||||
PC13.GPIO_Label=B1 [Blue PushButton]
|
||||
PC13.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
|
||||
@@ -109,6 +157,10 @@ PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT.Locked=true
|
||||
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||
PD2.GPIOParameters=GPIO_Label
|
||||
PD2.GPIO_Label=ST7565_A0
|
||||
PD2.Locked=true
|
||||
PD2.Signal=GPIO_Output
|
||||
PF0-OSC_IN.Locked=true
|
||||
PF0-OSC_IN.Mode=HSE-External-Clock-Source
|
||||
PF0-OSC_IN.Signal=RCC_OSC_IN
|
||||
@@ -142,7 +194,7 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=Makefile
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_I2C1_Init-I2C1-false-HAL-true,6-MX_SPI3_Init-SPI3-false-HAL-true
|
||||
RCC.ADC12outputFreq_Value=72000000
|
||||
RCC.ADC34outputFreq_Value=72000000
|
||||
RCC.AHBFreq_Value=72000000
|
||||
@@ -201,6 +253,13 @@ SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,NSSPMode
|
||||
SPI2.Mode=SPI_MODE_MASTER
|
||||
SPI2.NSSPMode=SPI_NSS_PULSE_ENABLE
|
||||
SPI2.VirtualType=VM_MASTER
|
||||
SPI3.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_64
|
||||
SPI3.CalculateBaudRate=562.5 KBits/s
|
||||
SPI3.DataSize=SPI_DATASIZE_8BIT
|
||||
SPI3.Direction=SPI_DIRECTION_1LINE
|
||||
SPI3.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,DataSize
|
||||
SPI3.Mode=SPI_MODE_MASTER
|
||||
SPI3.VirtualType=VM_MASTER
|
||||
USART2.IPParameters=VirtualMode-Asynchronous
|
||||
USART2.VirtualMode-Asynchronous=VM_ASYNC
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
|
||||
Reference in New Issue
Block a user