Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / drivers / rcc.h
blob7a984ba21fc29940a3e36bf1c0b87ee224004fbd
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include "rcc_types.h"
25 enum rcc_reg {
26 RCC_EMPTY = 0, // make sure that default value (0) does not enable anything
27 RCC_AHB,
28 RCC_APB2,
29 RCC_APB1,
30 RCC_AHB1
33 #define RCC_ENCODE(reg, mask) (((reg) << 5) | LOG2_32BIT(mask))
34 #define RCC_AHB(periph) RCC_ENCODE(RCC_AHB, RCC_AHBENR_ ## periph ## EN)
35 #define RCC_APB2(periph) RCC_ENCODE(RCC_APB2, RCC_APB2ENR_ ## periph ## EN)
36 #define RCC_APB1(periph) RCC_ENCODE(RCC_APB1, RCC_APB1ENR_ ## periph ## EN)
37 #define RCC_AHB1(periph) RCC_ENCODE(RCC_AHB1, RCC_AHB1ENR_ ## periph ## EN)
39 void RCC_ClockCmd(rccPeriphTag_t periphTag, FunctionalState NewState);
40 void RCC_ResetCmd(rccPeriphTag_t periphTag, FunctionalState NewState);