TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
tm_stm32f4_rcc.h
1 
30 #ifndef TM_RCC_H
31 #define TM_RCC_H 100
32 
33 /* C++ detection */
34 #ifdef __cplusplus
35 extern C {
36 #endif
37 
71 #include "stm32f4xx.h"
72 #include "stm32f4xx_rcc.h"
73 #include "defines.h"
74 #include "string.h"
75 
82 /* PLL configuration */
83 #define RCC_PLLM_MASK ((uint32_t)0x0000003F)
84 #define RCC_PLLM_POS 0
85 #define RCC_PLLN_MASK ((uint32_t)0x00007FC0)
86 #define RCC_PLLN_POS 6
87 #define RCC_PLLP_MASK ((uint32_t)0x00030000)
88 #define RCC_PLLP_POS 16
89 #define RCC_PLLQ_MASK ((uint32_t)0x0F000000)
90 #define RCC_PLLQ_POS 24
91 #define RCC_PLLR_MASK ((uint32_t)0x70000000)
92 #define RCC_PLLR_POS 28
93 
107 typedef struct {
108  uint16_t PLLM;
109  uint16_t PLLN;
110  uint16_t PLLP;
111  uint16_t PLLQ;
112  uint16_t PLLR;
114 } TM_RCC_PLL_t;
115 
141 void TM_RCC_SetPLL(TM_RCC_PLL_t* PLL_Settings);
142 
149 void TM_RCC_GetPLL(TM_RCC_PLL_t* PLL_Settings);
150 
158 uint8_t TM_RCC_IsPLLReady(void);
159 
172 /* C++ detection */
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 #endif
void TM_RCC_GetPLL(TM_RCC_PLL_t *PLL_Settings)
Gets current PLL settings from RCC registers.
void TM_RCC_SetPLL(TM_RCC_PLL_t *PLL_Settings)
Sets the main PLL settings for STM32F4xx device.
uint16_t PLLP
Definition: tm_stm32f4_rcc.h:110
uint16_t PLLQ
Definition: tm_stm32f4_rcc.h:111
PLL structure with settings for read and write operations.
Definition: tm_stm32f4_rcc.h:107
uint16_t PLLR
Definition: tm_stm32f4_rcc.h:112
uint16_t PLLN
Definition: tm_stm32f4_rcc.h:109
uint16_t PLLM
Definition: tm_stm32f4_rcc.h:108
uint8_t TM_RCC_IsPLLReady(void)
Checks if main PLL is ready.