1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

exti_io from Peter Ledvina

This commit is contained in:
Petr Ledvina 2016-05-31 21:19:00 +10:00 committed by borisbstyle
parent a74acccb84
commit 9e30e69cee
34 changed files with 2020 additions and 19 deletions

21
src/main/drivers/rcc.h Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include "common/utils.h"
enum rcc_reg {
RCC_EMPTY = 0, // make sure that default value (0) does not enable anything
RCC_AHB,
RCC_APB2,
RCC_APB1,
};
#define RCC_ENCODE(reg, mask) (((reg) << 5) | LOG2_32BIT(mask))
#define RCC_AHB(periph) RCC_ENCODE(RCC_AHB, RCC_AHBENR_ ## periph ## EN)
#define RCC_APB2(periph) RCC_ENCODE(RCC_APB2, RCC_APB2ENR_ ## periph ## EN)
#define RCC_APB1(periph) RCC_ENCODE(RCC_APB1, RCC_APB1ENR_ ## periph ## EN)
typedef uint8_t rccPeriphTag_t;
void RCC_ClockCmd(rccPeriphTag_t periphTag, FunctionalState NewState);