From 1af34638975249e54a4511b474cefe85e1cda143 Mon Sep 17 00:00:00 2001 From: coreglitch Date: Mon, 1 Mar 2021 21:44:46 +0300 Subject: [PATCH] Rename net names (#355) * rename some pins * back-port main.h to cube project * regenerate code for gpio renaming * update target * fix subghz names --- firmware/targets/f5/Inc/main.h | 17 +++-- firmware/targets/f5/Src/gpio.c | 6 +- firmware/targets/f5/api-hal/api-hal-subghz.c | 16 ++--- firmware/targets/f5/cube/Inc/main.h | 52 +++++++++++++-- firmware/targets/f5/cube/Makefile | 67 ++++++++++++++++++-- firmware/targets/f5/cube/Src/gpio.c | 6 +- firmware/targets/f5/cube/Src/spi.c | 6 +- firmware/targets/f5/cube/f5.ioc | 8 ++- 8 files changed, 138 insertions(+), 40 deletions(-) diff --git a/firmware/targets/f5/Inc/main.h b/firmware/targets/f5/Inc/main.h index 718eb9f6..6e7a453a 100644 --- a/firmware/targets/f5/Inc/main.h +++ b/firmware/targets/f5/Inc/main.h @@ -76,14 +76,16 @@ void Error_Handler(void); #define PC0_GPIO_Port GPIOC #define PC1_Pin GPIO_PIN_1 #define PC1_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MISO_GPIO_Port GPIOC #define PC3_Pin GPIO_PIN_3 #define PC3_GPIO_Port GPIOC #define IR_RX_Pin GPIO_PIN_0 #define IR_RX_GPIO_Port GPIOA -#define PA_SW_0_Pin GPIO_PIN_1 -#define PA_SW_0_GPIO_Port GPIOA -#define PA_SW_1_Pin GPIO_PIN_2 -#define PA_SW_1_GPIO_Port GPIOA +#define RF_SW_0_Pin GPIO_PIN_1 +#define RF_SW_0_GPIO_Port GPIOA +#define RF_SW_1_Pin GPIO_PIN_2 +#define RF_SW_1_GPIO_Port GPIOA #define PERIPH_POWER_Pin GPIO_PIN_3 #define PERIPH_POWER_GPIO_Port GPIOA #define PA4_Pin GPIO_PIN_4 @@ -133,8 +135,8 @@ void Error_Handler(void); #define I2C_SDA_GPIO_Port GPIOA #define SD_CD_Pin GPIO_PIN_15 #define SD_CD_GPIO_Port GPIOA -#define PC10_Pin GPIO_PIN_10 -#define PC10_GPIO_Port GPIOC +#define VIBRO_Pin GPIO_PIN_10 +#define VIBRO_GPIO_Port GPIOC #define DISPLAY_CS_Pin GPIO_PIN_11 #define DISPLAY_CS_GPIO_Port GPIOC #define SD_CS_Pin GPIO_PIN_12 @@ -184,9 +186,6 @@ extern TIM_HandleTypeDef htim16; #define NFC_IRQ_Pin RFID_PULL_Pin #define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port -#define VIBRO_Pin GPIO_PIN_10 -#define VIBRO_GPIO_Port GPIOC - /* USER CODE END Private defines */ #ifdef __cplusplus diff --git a/firmware/targets/f5/Src/gpio.c b/firmware/targets/f5/Src/gpio.c index 38fd36dc..d1797788 100644 --- a/firmware/targets/f5/Src/gpio.c +++ b/firmware/targets/f5/Src/gpio.c @@ -52,7 +52,7 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOD_CLK_ENABLE(); /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOA, PA_SW_0_Pin|PA_SW_1_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOA, RF_SW_0_Pin|RF_SW_1_Pin, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); @@ -85,13 +85,13 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ - GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin|PC10_Pin; + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin|VIBRO_Pin; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /*Configure GPIO pins : PAPin PAPin */ - GPIO_InitStruct.Pin = PA_SW_0_Pin|PA_SW_1_Pin; + GPIO_InitStruct.Pin = RF_SW_0_Pin|RF_SW_1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; diff --git a/firmware/targets/f5/api-hal/api-hal-subghz.c b/firmware/targets/f5/api-hal/api-hal-subghz.c index 297f06b5..0cb09973 100644 --- a/firmware/targets/f5/api-hal/api-hal-subghz.c +++ b/firmware/targets/f5/api-hal/api-hal-subghz.c @@ -4,16 +4,16 @@ void api_hal_rf_band_set(RfBand band) { if (band == RfBand1) { - LL_GPIO_ResetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin); - LL_GPIO_SetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin); + LL_GPIO_ResetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin); + LL_GPIO_SetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin); } else if (band == RfBand2) { - LL_GPIO_SetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin); - LL_GPIO_ResetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin); + LL_GPIO_SetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin); + LL_GPIO_ResetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin); } else if (band == RfBand3) { - LL_GPIO_SetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin); - LL_GPIO_SetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin); + LL_GPIO_SetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin); + LL_GPIO_SetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin); } else if (band == RfBandIsolation) { - LL_GPIO_ResetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin); - LL_GPIO_ResetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin); + LL_GPIO_ResetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin); + LL_GPIO_ResetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin); } } diff --git a/firmware/targets/f5/cube/Inc/main.h b/firmware/targets/f5/cube/Inc/main.h index 4514e6eb..eb24cd42 100644 --- a/firmware/targets/f5/cube/Inc/main.h +++ b/firmware/targets/f5/cube/Inc/main.h @@ -7,7 +7,7 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2021 STMicroelectronics. + *

© Copyright (c) 2020 STMicroelectronics. * All rights reserved.

* * This software component is licensed by ST under Ultimate Liberty license @@ -76,14 +76,16 @@ void Error_Handler(void); #define PC0_GPIO_Port GPIOC #define PC1_Pin GPIO_PIN_1 #define PC1_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MISO_GPIO_Port GPIOC #define PC3_Pin GPIO_PIN_3 #define PC3_GPIO_Port GPIOC #define IR_RX_Pin GPIO_PIN_0 #define IR_RX_GPIO_Port GPIOA -#define PA_SW_0_Pin GPIO_PIN_1 -#define PA_SW_0_GPIO_Port GPIOA -#define PA_SW_1_Pin GPIO_PIN_2 -#define PA_SW_1_GPIO_Port GPIOA +#define RF_SW_0_Pin GPIO_PIN_1 +#define RF_SW_0_GPIO_Port GPIOA +#define RF_SW_1_Pin GPIO_PIN_2 +#define RF_SW_1_GPIO_Port GPIOA #define PERIPH_POWER_Pin GPIO_PIN_3 #define PERIPH_POWER_GPIO_Port GPIOA #define PA4_Pin GPIO_PIN_4 @@ -133,8 +135,8 @@ void Error_Handler(void); #define I2C_SDA_GPIO_Port GPIOA #define SD_CD_Pin GPIO_PIN_15 #define SD_CD_GPIO_Port GPIOA -#define PC10_Pin GPIO_PIN_10 -#define PC10_GPIO_Port GPIOC +#define VIBRO_Pin GPIO_PIN_10 +#define VIBRO_GPIO_Port GPIOC #define DISPLAY_CS_Pin GPIO_PIN_11 #define DISPLAY_CS_GPIO_Port GPIOC #define SD_CS_Pin GPIO_PIN_12 @@ -151,6 +153,42 @@ void Error_Handler(void); #define SPI_R_MOSI_GPIO_Port GPIOB /* USER CODE BEGIN Private defines */ +#define MISO_PIN GpioPin{.port = SPI_R_MISO_GPIO_Port, .pin = SPI_R_MISO_Pin} + +#define SPI_R hspi1 +#define SPI_D hspi2 +#define SPI_SD_HANDLE SPI_D + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +#define TIM_A htim1 +#define TIM_B htim2 +#define TIM_C htim16 + +#define SPEAKER_TIM htim16 +#define SPEAKER_CH TIM_CHANNEL_1 + +#define LFRFID_TIM htim1 +#define LFRFID_CH TIM_CHANNEL_1 + +#define IRDA_TX_TIM htim1 +#define IRDA_TX_CH TIM_CHANNEL_3 + +// only for reference +// IRDA RX timer dont exist in F2 +// and timer need more data to init (NVIC IRQn to set priority) +#define IRDA_RX_TIM htim2 +#define IRDA_RX_FALLING_CH TIM_CHANNEL_1 +#define IRDA_RX_RISING_CH TIM_CHANNEL_2 + +#define NFC_IRQ_Pin RFID_PULL_Pin +#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port + +#define VIBRO_Pin GPIO_PIN_10 +#define VIBRO_GPIO_Port GPIOC + /* USER CODE END Private defines */ #ifdef __cplusplus diff --git a/firmware/targets/f5/cube/Makefile b/firmware/targets/f5/cube/Makefile index bf9f4e7e..f437f041 100644 --- a/firmware/targets/f5/cube/Makefile +++ b/firmware/targets/f5/cube/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.11.0-B13] date: [Wed Feb 17 17:11:18 MSK 2021] +# File automatically-generated by tool: [projectgenerator] version: [3.11.0-B13] date: [Mon Mar 01 14:14:38 MSK 2021] ########################################################################################################################## # ------------------------------------------------ @@ -107,7 +107,57 @@ Src/system_stm32wbxx.c \ /Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \ /Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \ /Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \ -/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c +/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usb.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_hsem.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_exti.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_adc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_adc_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_adc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_comp.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_crc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_crc_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pka.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rng.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_spi.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_spi_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/croutine.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/event_groups.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/list.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/queue.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/tasks.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/timers.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \ +/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c # ASM sources ASM_SOURCES = \ @@ -174,8 +224,17 @@ C_INCLUDES = \ -I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Inc \ -I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \ -I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Device/ST/STM32WBxx/Include \ --I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Include --I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Include +-I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Include \ +-I/Users/aku/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Include \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Inc \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/STM32WBxx_HAL_Driver/Inc/Legacy \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/include \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Core/Inc \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Device/ST/STM32WBxx/Include \ +-I/home/aanper/STM32Cube/Repository/STM32Cube_FW_WB_V1.10.0/Drivers/CMSIS/Include # compile gcc flags diff --git a/firmware/targets/f5/cube/Src/gpio.c b/firmware/targets/f5/cube/Src/gpio.c index 38fd36dc..d1797788 100644 --- a/firmware/targets/f5/cube/Src/gpio.c +++ b/firmware/targets/f5/cube/Src/gpio.c @@ -52,7 +52,7 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOD_CLK_ENABLE(); /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOA, PA_SW_0_Pin|PA_SW_1_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOA, RF_SW_0_Pin|RF_SW_1_Pin, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); @@ -85,13 +85,13 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ - GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin|PC10_Pin; + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin|VIBRO_Pin; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /*Configure GPIO pins : PAPin PAPin */ - GPIO_InitStruct.Pin = PA_SW_0_Pin|PA_SW_1_Pin; + GPIO_InitStruct.Pin = RF_SW_0_Pin|RF_SW_1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; diff --git a/firmware/targets/f5/cube/Src/spi.c b/firmware/targets/f5/cube/Src/spi.c index 7450e95d..637a9807 100644 --- a/firmware/targets/f5/cube/Src/spi.c +++ b/firmware/targets/f5/cube/Src/spi.c @@ -129,12 +129,12 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) PB15 ------> SPI2_MOSI PD1 ------> SPI2_SCK */ - GPIO_InitStruct.Pin = GPIO_PIN_2; + GPIO_InitStruct.Pin = SPI_D_MISO_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + HAL_GPIO_Init(SPI_D_MISO_GPIO_Port, &GPIO_InitStruct); GPIO_InitStruct.Pin = SPI_D_MOSI_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; @@ -193,7 +193,7 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) PB15 ------> SPI2_MOSI PD1 ------> SPI2_SCK */ - HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2); + HAL_GPIO_DeInit(SPI_D_MISO_GPIO_Port, SPI_D_MISO_Pin); HAL_GPIO_DeInit(SPI_D_MOSI_GPIO_Port, SPI_D_MOSI_Pin); diff --git a/firmware/targets/f5/cube/f5.ioc b/firmware/targets/f5/cube/f5.ioc index 9b54db84..40ba686a 100644 --- a/firmware/targets/f5/cube/f5.ioc +++ b/firmware/targets/f5/cube/f5.ioc @@ -229,10 +229,11 @@ SPI1.Mode=SPI_MODE_MASTER Mcu.Pin39=PA13 RCC.LCDFreq_Value=32768 RCC.RNGFreq_Value=16000000 +PC2.GPIOParameters=GPIO_Label VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input Mcu.Pin30=PE4 NVIC.COMP_IRQn=true\:5\:0\:true\:false\:true\:false\:false\:true -PA1.GPIO_Label=PA_SW_0 +PA1.GPIO_Label=RF_SW_0 Mcu.Pin33=PB14 Mcu.Pin34=PB15 Mcu.Pin31=PB12 @@ -435,7 +436,7 @@ PA6.Signal=GPIO_Analog TIM2.Channel-Input_Capture2_from_TI1=TIM_CHANNEL_2 RCC.EnbaleCSS=true ProjectManager.ToolChainLocation= -PA2.GPIO_Label=PA_SW_1 +PA2.GPIO_Label=RF_SW_1 RCC.LSI_VALUE=32000 PB11.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING PA15.Signal=GPIO_Input @@ -451,6 +452,7 @@ SPI2.Direction=SPI_DIRECTION_2LINES PC5.Signal=SharedAnalog_PC5 SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16 OSC_IN.GPIO_Label=QUARTZ_32KHZ_IN +PC2.GPIO_Label=SPI_D_MISO PC14-OSC32_IN.Locked=true PA12.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH COMP1.TriggerMode=COMP_TRIGGERMODE_IT_RISING_FALLING @@ -468,7 +470,7 @@ SH.S_TIM2_CH1.1=TIM2_CH1,Input_Capture2_from_TI1 SH.S_TIM2_CH1.0=TIM2_CH1,Input_Capture1_from_TI1 PB8.GPIOParameters=GPIO_Label PB9.GPIO_Label=IR_TX -PC10.GPIO_Label=PC10 +PC10.GPIO_Label=VIBRO PA10.Mode=I2C ProjectManager.NoMain=false SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,CLKPhase,BaudRatePrescaler