Skip to content

Commit

Permalink
feat: add ST files for mcu stm32wba52cx (#315)
Browse files Browse the repository at this point in the history
Add new files for mcu stm32wba52cx

Co-authored-by: Richard Peters <[email protected]>
  • Loading branch information
cassio-lazaro and richardapeters authored May 24, 2024
1 parent 8144afa commit f545781
Show file tree
Hide file tree
Showing 299 changed files with 343,564 additions and 0 deletions.
52 changes: 52 additions & 0 deletions hal_st/stm32fxxx/DefaultClockNucleoWBA52CG.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include DEVICE_HEADER
#include "hal_st/stm32fxxx/DefaultClockNucleoWBA52CG.hpp"

/* The system Clock is configured as follows:
* System Clock source = PLL (HSE)
* SYSCLK(Hz) = 100000000
* HCLK(Hz) = 100000000
* AHB Prescaler = 1
* APB1 Prescaler = 1
* APB2 Prescaler = 1
* APB7 Prescaler = 1
* HSE Frequency(Hz) = 32000000
* PLL_M = 4
* PLL_N = 25
* PLL_P = 2
* PLL_Q = 1
* PLL_R = 2
* Flash Latency(WS) = 4
*/
void ConfigureDefaultClockNucleoWBA52CG()
{
RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };

__HAL_RCC_PWR_CLK_ENABLE();

HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);

/* Activate PLL with HSE as source */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL1.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL1.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL1.PLLFractional = 0;
RCC_OscInitStruct.PLL1.PLLM = 4;
RCC_OscInitStruct.PLL1.PLLN = 25; /* VCO = HSE/M * N = 32 / 4 * 25 = 200 MHz */
RCC_OscInitStruct.PLL1.PLLR = 2; /* PLLSYS = 200 MHz / 2 = 100 MHz */
RCC_OscInitStruct.PLL1.PLLP = 2;
RCC_OscInitStruct.PLL1.PLLQ = 1;
HAL_RCC_OscConfig(&RCC_OscInitStruct);

/* Select PLL as system clock source and configure the HCLK, PCLK1, PCLK2 and PCLK7
clocks dividers */
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 |
RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_PCLK7);
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB7CLKDivider = RCC_HCLK_DIV1;
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
}
6 changes: 6 additions & 0 deletions hal_st/stm32fxxx/DefaultClockNucleoWBA52CG.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef HAL_ST_DEFAULT_CLOCK_HPP
#define HAL_ST_DEFAULT_CLOCK_HPP

void ConfigureDefaultClockNucleoWBA52CG();

#endif
2,826 changes: 2,826 additions & 0 deletions hal_st/stm32fxxx/ip/GPIO-STM32WBA52x_gpio_v1_0_Modes.xml

Large diffs are not rendered by default.

2,903 changes: 2,903 additions & 0 deletions hal_st/stm32fxxx/ip/GPIO-STM32WBAx_gpio_v1_0_Modes.xml

Large diffs are not rendered by default.

852 changes: 852 additions & 0 deletions hal_st/stm32fxxx/mcu/STM32WBA52CGUx.xml

Large diffs are not rendered by default.

3,271 changes: 3,271 additions & 0 deletions st/CMSIS_STM32WBAxx/ARM.CMSIS.pdsc

Large diffs are not rendered by default.

Loading

0 comments on commit f545781

Please sign in to comment.