source: rtems/c/src/lib/libbsp/arm/stm32f4/include/rcc.h @ 7be19f8

4.115
Last change on this file since 7be19f8 was 7be19f8, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 15, 2012 at 7:15:22 PM

bsp/stm32f4: API changes

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 * Copyright (c) 2012 Sebastian Huber.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#ifndef LIBBSP_ARM_STM32F4_RCC_H
16#define LIBBSP_ARM_STM32F4_RCC_H
17
18#include <stdbool.h>
19
20#include <bsp/stm32f4.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26#define STM32F4_RCC_INDEX(reg, idx) (((reg) << 5) | (idx))
27
28typedef enum {
29  STM32F4_RCC_OTGHS = STM32F4_RCC_INDEX(0, 29),
30  STM32F4_RCC_ETHMAC = STM32F4_RCC_INDEX(0, 25),
31  STM32F4_RCC_DMA2 = STM32F4_RCC_INDEX(0, 22),
32  STM32F4_RCC_DMA1 = STM32F4_RCC_INDEX(0, 21),
33  STM32F4_RCC_CRC = STM32F4_RCC_INDEX(0, 12),
34  STM32F4_RCC_GPIOI = STM32F4_RCC_INDEX(0, 8),
35  STM32F4_RCC_GPIOH = STM32F4_RCC_INDEX(0, 7),
36  STM32F4_RCC_GPIOG = STM32F4_RCC_INDEX(0, 6),
37  STM32F4_RCC_GPIOF = STM32F4_RCC_INDEX(0, 5),
38  STM32F4_RCC_GPIOE = STM32F4_RCC_INDEX(0, 4),
39  STM32F4_RCC_GPIOD = STM32F4_RCC_INDEX(0, 3),
40  STM32F4_RCC_GPIOC = STM32F4_RCC_INDEX(0, 2),
41  STM32F4_RCC_GPIOB = STM32F4_RCC_INDEX(0, 1),
42  STM32F4_RCC_GPIOA = STM32F4_RCC_INDEX(0, 0),
43
44  STM32F4_RCC_OTGFS = STM32F4_RCC_INDEX(1, 7),
45  STM32F4_RCC_RNG = STM32F4_RCC_INDEX(1, 6),
46  STM32F4_RCC_HASH = STM32F4_RCC_INDEX(1, 5),
47  STM32F4_RCC_CRYP = STM32F4_RCC_INDEX(1, 4),
48  STM32F4_RCC_DCMI = STM32F4_RCC_INDEX(1, 0),
49
50  STM32F4_RCC_FSMCR = STM32F4_RCC_INDEX(2, 0),
51
52  STM32F4_RCC_DAC = STM32F4_RCC_INDEX(4, 29),
53  STM32F4_RCC_PWR = STM32F4_RCC_INDEX(4, 28),
54  STM32F4_RCC_CAN2 = STM32F4_RCC_INDEX(4, 26),
55  STM32F4_RCC_CAN1 = STM32F4_RCC_INDEX(4, 25),
56  STM32F4_RCC_I2C3 = STM32F4_RCC_INDEX(4, 23),
57  STM32F4_RCC_I2C2 = STM32F4_RCC_INDEX(4, 22),
58  STM32F4_RCC_I2C1 = STM32F4_RCC_INDEX(4, 21),
59  STM32F4_RCC_UART5 = STM32F4_RCC_INDEX(4, 20),
60  STM32F4_RCC_UART4 = STM32F4_RCC_INDEX(4, 19),
61  STM32F4_RCC_USART3 = STM32F4_RCC_INDEX(4, 18),
62  STM32F4_RCC_USART2 = STM32F4_RCC_INDEX(4, 17),
63  STM32F4_RCC_SPI3 = STM32F4_RCC_INDEX(4, 15),
64  STM32F4_RCC_SPI2 = STM32F4_RCC_INDEX(4, 14),
65  STM32F4_RCC_WWDG = STM32F4_RCC_INDEX(4, 11),
66  STM32F4_RCC_TIM14 = STM32F4_RCC_INDEX(4, 8),
67  STM32F4_RCC_TIM13 = STM32F4_RCC_INDEX(4, 7),
68  STM32F4_RCC_TIM12 = STM32F4_RCC_INDEX(4, 6),
69  STM32F4_RCC_TIM7 = STM32F4_RCC_INDEX(4, 5),
70  STM32F4_RCC_TIM6 = STM32F4_RCC_INDEX(4, 4),
71  STM32F4_RCC_TIM5 = STM32F4_RCC_INDEX(4, 3),
72  STM32F4_RCC_TIM4 = STM32F4_RCC_INDEX(4, 2),
73  STM32F4_RCC_TIM3 = STM32F4_RCC_INDEX(4, 1),
74  STM32F4_RCC_TIM2 = STM32F4_RCC_INDEX(4, 0),
75
76  STM32F4_RCC_TIM11 = STM32F4_RCC_INDEX(5, 18),
77  STM32F4_RCC_TIM10 = STM32F4_RCC_INDEX(5, 17),
78  STM32F4_RCC_TIM9 = STM32F4_RCC_INDEX(5, 16),
79  STM32F4_RCC_SYSCFG = STM32F4_RCC_INDEX(5, 14),
80  STM32F4_RCC_SPI1 = STM32F4_RCC_INDEX(5, 12),
81  STM32F4_RCC_SDIO = STM32F4_RCC_INDEX(5, 11),
82  STM32F4_RCC_ADC3 = STM32F4_RCC_INDEX(5, 10),
83  STM32F4_RCC_ADC2 = STM32F4_RCC_INDEX(5, 9),
84  STM32F4_RCC_ADC1 = STM32F4_RCC_INDEX(5, 8),
85  STM32F4_RCC_USART6 = STM32F4_RCC_INDEX(5, 5),
86  STM32F4_RCC_USART1 = STM32F4_RCC_INDEX(5, 4),
87  STM32F4_RCC_TIM8 = STM32F4_RCC_INDEX(5, 1),
88  STM32F4_RCC_TIM1 = STM32F4_RCC_INDEX(5, 0),
89} stm32f4_rcc_index;
90
91void stm32f4_rcc_reset(stm32f4_rcc_index index);
92
93void stm32f4_rcc_set_reset(stm32f4_rcc_index index, bool set);
94
95void stm32f4_rcc_set_clock(stm32f4_rcc_index index, bool set);
96
97void stm32f4_rcc_set_low_power_clock(stm32f4_rcc_index index, bool set);
98
99#ifdef __cplusplus
100}
101#endif /* __cplusplus */
102
103#endif /* LIBBSP_ARM_STM32F4_RCC_H */
Note: See TracBrowser for help on using the repository browser.